Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/plivo/api/models/profile/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/plivo/api/models/profile/ProfileAdder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public class ProfileAdder extends Creator<ProfileAddResponse> {
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;
Expand All @@ -40,6 +41,7 @@ public class ProfileAdder extends Creator<ProfileAddResponse> {
this.plivoSubaccount = plivoSubaccount;
this.authorizedContact = authorizedContact;
this.businessContactEmail = businessContactEmail;
this.doingBusinessAs = doingBusinessAs;
}
public String profileAlias(){
return this.profileAlias;
Expand Down Expand Up @@ -89,6 +91,9 @@ public ProfileAuthorizedContact authorizedContact(){
public String businessContactEmail(){
return this.businessContactEmail;
}
public String doingBusinessAs(){
return this.doingBusinessAs;
}

@Override
protected Call<ProfileAddResponse> obtainCall() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -96,6 +96,10 @@ public String getCreatedAt(){
return createdAt;
}

public String getDoingBusinessAs(){
return doingBusinessAs;
}

@Override
public String getId() {
return this.profileUUID;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/plivo/api/models/profile/ProfileUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class ProfileUpdater extends MessagingProfileUpdater<Profile> {
private String einIssuingCountry;
private String altBusinessId;
private String altBusinessIdType;
private String doingBusinessAs;

public ProfileUpdater(String id) {
super(id);
Expand Down Expand Up @@ -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<Profile> obtainCall() {
return client().getApiService().profileUpdate(client().getAuthId(), id, this);
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/com/plivo/api/ProfileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
}

Expand All @@ -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
Expand All @@ -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/");
}
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/com/plivo/api/profileGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading