Skip to content
Open
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## [5.28.0](https://github.com/plivo/plivo-java/tree/v5.28.0) (2023-06-27)
**Feature - CNAM**
- Added New Param `cnam` in to the response of the [list all numbers API], [list single number API]
- Added `cnam` parameter to buy number[Buy a Phone Number] to configure CNAM while buying a US number
- Added `callback_url` parameter to buy number[Buy a Phone Number] to configure CNAM callback url while buying a US number
- Added `callback_method` parameter to buy number[Buy a Phone Number] to configure CNAM callback method while buying a US number
- Added `cnam` parameter to update number[Update an account phone number] to configure CNAM while updating a US number
- Added `callback_url` parameter to update number[Update an account phone number] to configure CNAM callback url while updating a US number
- Added `callback_method` parameter to update number[Update an account phone number] to configure CNAM callback method while updating a US number


## [5.27.0](https://github.com/plivo/plivo-java/tree/v5.27.0) (2023-05-02)
**Feature - CNAM Lookup**
- Added New Param `cnam_lookup` in to the response of the [list all numbers API], [list single number API]
Expand Down
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Written manually.

version=5.27.0
version=5.28.0
groupId=com.plivo
artifactId=plivo-java
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.27.0</version>
<version>5.28.0</version>
<name>plivo-java</name>
<description>A Java SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML</description>
<licenses>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/plivo/api/models/number/Number.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class Number extends BaseResource {
private String tollFreeSmsVerification;
private String renewalDate;
private String cnamLookup;
private String cnam;


public Boolean getActive() {
return active;
Expand Down Expand Up @@ -154,4 +156,8 @@ public String getRenewalDate() {
public String getCnamLookup() {
return cnamLookup;
}

public String getCnam() {
return cnam;
}
}
9 changes: 9 additions & 0 deletions src/main/java/com/plivo/api/models/number/NumberLister.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class NumberLister extends Lister<Number> {
private String tollFreeSmsVerification;
private PropertyFilter<String> renewalDate;
private String cnamLookup;
private String cnam;

public NumberType numberType() {
return this.numberType;
Expand Down Expand Up @@ -55,6 +56,9 @@ public PropertyFilter<String> renewalDate() {
public String cnamLookup() {
return this.cnamLookup;
}
public String cnam() {
return this.cnam;
}

public NumberLister numberType(final NumberType numberType) {
this.numberType = numberType;
Expand All @@ -70,6 +74,11 @@ public NumberLister cnamLookup(final String cnamLookup) {
this.cnamLookup = cnamLookup;
return this;
}

public NumberLister cnam(final String cnam) {
this.cnam = cnam;
return this;
}
public NumberLister numberStartswith(final String numberStartswith) {
this.numberStartswith = numberStartswith;
return this;
Expand Down
34 changes: 32 additions & 2 deletions src/main/java/com/plivo/api/models/number/NumberUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class NumberUpdater extends Updater<NumberUpdateResponse> {
private String subaccount;
private String alias;
private String cnamLookup;
private String cnam;
private String callbackUrl;
private String callbackMethod;

NumberUpdater(final String number) {
super(number);
Expand All @@ -31,6 +34,18 @@ public String cnamLookup() {
return this.cnamLookup;
}

public String cnam() {
return this.cnam;
}

public String callbackUrl() {
return this.callbackUrl;
}

public String callbackMethod() {
return this.callbackMethod;
}

public NumberUpdater appId(final String appId) {
this.appId = appId;
return this;
Expand All @@ -50,10 +65,25 @@ public NumberUpdater cnamLookup(final String cnamLookup) {
return this;
}

public NumberUpdater cnam(final String cnam) {
this.cnam = cnam;
return this;
}

public NumberUpdater callbackUrl(final String callbackUrl) {
this.callbackUrl = callbackUrl;
return this;
}

public NumberUpdater callbackMethod(final String callbackMethod) {
this.callbackMethod = callbackMethod;
return this;
}

@Override
protected void validate() {
if (!Utils.anyNotNull(alias, subaccount, appId, cnamLookup)) {
throw new IllegalStateException("one of alias, subaccount, appId, cnamLookup must be non-null");
if (!Utils.anyNotNull(alias, subaccount, appId, cnamLookup, cnam)) {
throw new IllegalStateException("one of alias, subaccount, appId, cnamLookup, cnam must be non-null");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also add the cnam in the above check, right?

}
super.validate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class PhoneNumberCreationStatus {

private String number;
private String status;
private String NewCnam;
private String CnamUpdateStatus;

public String getNumber() {
return number;
Expand All @@ -12,4 +14,12 @@ public String getNumber() {
public String getStatus() {
return status;
}

public String getNewCnam() {
return NewCnam;
}

public String getCnamUpdateStatus() {
return CnamUpdateStatus;
}
}
30 changes: 30 additions & 0 deletions src/main/java/com/plivo/api/models/number/PhoneNumberCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public class PhoneNumberCreator extends Creator<PhoneNumberCreateResponse> {
private String number;
private String appId;
private String cnamLookup;
private String cnam;
private String callbackUrl;
private String callbackMethod;

public PhoneNumberCreator(String number) {
if (number == null) {
Expand All @@ -25,6 +28,18 @@ public String cnamLookup() {
return this.cnamLookup;
}

public String cnam() {
return this.cnam;
}

public String callbackUrl() {
return this.callbackUrl;
}

public String callbackMethod() {
return this.callbackMethod;
}

public PhoneNumberCreator appId(final String appId) {
this.appId = appId;
return this;
Expand All @@ -35,6 +50,21 @@ public PhoneNumberCreator cnamLookup(final String cnamLookup) {
return this;
}

public PhoneNumberCreator cnam(final String cnam) {
this.cnam = cnam;
return this;
}

public PhoneNumberCreator callbackMethod(final String callbackMethod) {
this.callbackMethod = callbackMethod;
return this;
}

public PhoneNumberCreator callbackUrl(final String callbackUrl) {
this.callbackUrl = callbackUrl;
return this;
}

@Override
protected Call<PhoneNumberCreateResponse> obtainCall() {
return client().getApiService().phoneNumberCreate(client().getAuthId(), number, this);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/plivo/api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.27.0
5.28.0
3 changes: 2 additions & 1 deletion src/test/resources/com/plivo/api/numberGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": null,
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
"cnam_lookup": "enabled",
"cnam": "test1"
}
9 changes: 6 additions & 3 deletions src/test/resources/com/plivo/api/numberListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": null,
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
"cnam_lookup": "enabled",
"cnam": "test1"
},
{
"added_on": "2013-01-01",
Expand All @@ -48,7 +49,8 @@
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": null,
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
"cnam_lookup": "enabled",
"cnam": "test1"
},
{
"added_on": "2013-03-25",
Expand All @@ -69,7 +71,8 @@
"tendlc_registration_status": null,
"toll_free_sms_verification": "verified",
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
"cnam_lookup": "enabled",
"cnam": "test1"
}
]
}