diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b5128be..5be50f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log ## [5.48.1](https://github.com/plivo/plivo-java/tree/v5.48.1) (2026-05-26) +**Feature - Profile API DBA field support** +- Added Doing Business As (DBA) field support to Profile API + **Feature - Expose sub_account_name on Number resource** - Added `subAccountName` field and `getSubAccountName()` getter to the `Number` resource, surfacing the subaccount's name alongside the existing `subAccount` (auth_id) on rented number listing and get APIs diff --git a/src/main/java/com/plivo/api/models/profile/Profile.java b/src/main/java/com/plivo/api/models/profile/Profile.java index b1c57149..d777ed0d 100644 --- a/src/main/java/com/plivo/api/models/profile/Profile.java +++ b/src/main/java/com/plivo/api/models/profile/Profile.java @@ -29,7 +29,11 @@ public class Profile extends BaseResource { public static ProfileAdder creator(String profileAlias,String customerType,String entityType,String companyName,String ein,String einIssuingCountry,ProfileAddress address,String stockSymbol,String stockExchange,String website,String vertical,String altBusinessID,String altBusinessIdType,String plivoSubaccount,ProfileAuthorizedContact authorizedContact,String businessContactEmail) { - return new ProfileAdder(profileAlias,customerType,entityType,companyName,ein,einIssuingCountry,address,stockSymbol,stockExchange,website,vertical,altBusinessID,altBusinessIdType,plivoSubaccount,authorizedContact,businessContactEmail); + return new ProfileAdder(profileAlias,customerType,entityType,companyName,ein,einIssuingCountry,address,stockSymbol,stockExchange,website,vertical,altBusinessID,altBusinessIdType,plivoSubaccount,authorizedContact,businessContactEmail, null); + } + + public static ProfileAdder creator(String profileAlias,String customerType,String entityType,String companyName,String ein,String einIssuingCountry,ProfileAddress address,String stockSymbol,String stockExchange,String website,String vertical,String altBusinessID,String altBusinessIdType,String plivoSubaccount,ProfileAuthorizedContact authorizedContact,String businessContactEmail,String doingBusinessAs) { + return new ProfileAdder(profileAlias,customerType,entityType,companyName,ein,einIssuingCountry,address,stockSymbol,stockExchange,website,vertical,altBusinessID,altBusinessIdType,plivoSubaccount,authorizedContact,businessContactEmail, doingBusinessAs); } public static ProfileGetter getter(String id) { diff --git a/src/main/java/com/plivo/api/models/profile/ProfileAdder.java b/src/main/java/com/plivo/api/models/profile/ProfileAdder.java index b0a3833d..6ec9acfb 100644 --- a/src/main/java/com/plivo/api/models/profile/ProfileAdder.java +++ b/src/main/java/com/plivo/api/models/profile/ProfileAdder.java @@ -22,8 +22,9 @@ public class ProfileAdder extends Creator { private String plivoSubaccount; private ProfileAuthorizedContact authorizedContact; private String businessContactEmail; + private String doingBusinessAs; - ProfileAdder(String profileAlias,String customerType,String entityType,String companyName,String ein,String einIssuingCountry,ProfileAddress address,String stockSymbol,String stockExchange,String website,String vertical,String altBusinessID,String altBusinessIdType,String plivoSubaccount,ProfileAuthorizedContact authorizedContact,String businessContactEmail) { + ProfileAdder(String profileAlias,String customerType,String entityType,String companyName,String ein,String einIssuingCountry,ProfileAddress address,String stockSymbol,String stockExchange,String website,String vertical,String altBusinessID,String altBusinessIdType,String plivoSubaccount,ProfileAuthorizedContact authorizedContact,String businessContactEmail,String doingBusinessAs) { this.profileAlias = profileAlias; this.customerType = customerType; this.entityType = entityType; @@ -40,6 +41,7 @@ public class ProfileAdder extends Creator { this.plivoSubaccount = plivoSubaccount; this.authorizedContact = authorizedContact; this.businessContactEmail = businessContactEmail; + this.doingBusinessAs = doingBusinessAs; } public String profileAlias(){ return this.profileAlias; @@ -89,6 +91,9 @@ public ProfileAuthorizedContact authorizedContact(){ public String businessContactEmail(){ return this.businessContactEmail; } + public String doingBusinessAs(){ + return this.doingBusinessAs; + } @Override protected Call obtainCall() { diff --git a/src/main/java/com/plivo/api/models/profile/ProfileResponse.java b/src/main/java/com/plivo/api/models/profile/ProfileResponse.java index ea1c2ff3..fb39bd87 100644 --- a/src/main/java/com/plivo/api/models/profile/ProfileResponse.java +++ b/src/main/java/com/plivo/api/models/profile/ProfileResponse.java @@ -1,6 +1,5 @@ package com.plivo.api.models.profile; import com.fasterxml.jackson.annotation.JsonInclude; - import com.plivo.api.models.base.BaseResource; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -23,6 +22,7 @@ public class ProfileResponse extends BaseResource{ private String profileType; private String profileUUID; private String createdAt; + private String doingBusinessAs; public String getProfileAlias(){ return profileAlias; @@ -96,6 +96,10 @@ public String getCreatedAt(){ return createdAt; } + public String getDoingBusinessAs(){ + return doingBusinessAs; + } + @Override public String getId() { return this.profileUUID; diff --git a/src/main/java/com/plivo/api/models/profile/ProfileUpdater.java b/src/main/java/com/plivo/api/models/profile/ProfileUpdater.java index 94e1b40d..e0a7a620 100644 --- a/src/main/java/com/plivo/api/models/profile/ProfileUpdater.java +++ b/src/main/java/com/plivo/api/models/profile/ProfileUpdater.java @@ -17,6 +17,7 @@ public class ProfileUpdater extends MessagingProfileUpdater { private String einIssuingCountry; private String altBusinessId; private String altBusinessIdType; + private String doingBusinessAs; public ProfileUpdater(String id) { super(id); @@ -116,6 +117,15 @@ public String getAltBusinessIdType(){ return altBusinessIdType; } + public ProfileUpdater doingBusinessAs (String doingBusinessAs) { + this.doingBusinessAs = doingBusinessAs; + return this; + } + + public String getDoingBusinessAs(){ + return doingBusinessAs; + } + @Override protected Call obtainCall() { return client().getApiService().profileUpdate(client().getAuthId(), id, this); diff --git a/src/test/java/com/plivo/api/ProfileTest.java b/src/test/java/com/plivo/api/ProfileTest.java index 6c1da12a..83883561 100644 --- a/src/test/java/com/plivo/api/ProfileTest.java +++ b/src/test/java/com/plivo/api/ProfileTest.java @@ -27,8 +27,8 @@ public void profileCreateShouldSucceed() throws Exception { expectResponse(fixtureName, 202); ProfileAddress address = new ProfileAddress("123 Main Street", "San Francisco", "CA", "94105", "US"); ProfileAuthorizedContact authContact = new ProfileAuthorizedContact("John", "Doe", "+14155551234", "test@example.com", "CEO", "C_LEVEL"); - ProfileAddResponse response = Profile.creator("Test Profile", "DIRECT", "PUBLIC", "Test Company Inc", "12-3456789", "US", address, "TEST", "NASDAQ", "https://testcompany.com", "TECHNOLOGY", "", "NONE", "", authContact, "employee@company.com").create(); - + ProfileAddResponse response = Profile.creator("Test Profile", "DIRECT", "PUBLIC", "Test Company Inc", "12-3456789", "US", address, "TEST", "NASDAQ", "https://testcompany.com", "TECHNOLOGY", "", "NONE", "", authContact, "employee@company.com", "Test DBA").create(); + assertRequest("POST", "Profile/"); } @@ -42,6 +42,7 @@ public void profileGetShouldSucceed() throws Exception { assertRequest("GET", "Profile/%s/", profileUUID); assertEquals(profileUUID, response.getProfile().getProfileUUID()); + assertEquals("ABC DBA", response.getProfile().getDoingBusinessAs()); } @Test @@ -61,7 +62,7 @@ public void profileUpdateShouldSucceed() throws Exception { expectResponse(fixtureName, 202); ProfileAddress address = new ProfileAddress("123 Main Street", "San Francisco", "CA", "94105", "US"); ProfileAuthorizedContact authContact = new ProfileAuthorizedContact("John", "Doe", "+14155551234", "test@example.com", "CEO", "C_LEVEL"); - Profile response = Profile.update("8abd0935-fd17-4876-9b40-5855488ac5b5").entityType("PUBLIC").address(address).authorizedContact(authContact).businessContactEmail("employee@company.com").update(); + Profile response = Profile.update("8abd0935-fd17-4876-9b40-5855488ac5b5").entityType("PUBLIC").address(address).authorizedContact(authContact).businessContactEmail("employee@company.com").doingBusinessAs("Updated DBA").update(); assertRequest("POST", "Profile/8abd0935-fd17-4876-9b40-5855488ac5b5/"); } diff --git a/src/test/resources/com/plivo/api/profileGetResponse.json b/src/test/resources/com/plivo/api/profileGetResponse.json index f54aab29..e41fce09 100644 --- a/src/test/resources/com/plivo/api/profileGetResponse.json +++ b/src/test/resources/com/plivo/api/profileGetResponse.json @@ -7,6 +7,7 @@ }, "company_name": "ABC Inc.", "customer_type": "RESELLER", + "doing_business_as": "ABC DBA", "ein": "111111111", "ein_issuing_country": "US", "entity_type": "PUBLIC_PROFIT",