Skip to content

Commit

Permalink
PHONUM-3179 (#263)
Browse files Browse the repository at this point in the history
* tollfree verification api integration

* added tf fields in list numbers response

* updated optin field names

* added release notes
  • Loading branch information
kapilp93 authored Nov 3, 2023
1 parent 81b9f12 commit a85091b
Show file tree
Hide file tree
Showing 21 changed files with 854 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Change Log
## [5.34.0](https://github.com/plivo/plivo-java/tree/v5.34.0) (2023-11-03)
**Feature - TollFree Verification API Support**
- API support for Create, Update, Get, Delete and List Tollfree Verification.
- Added New Param `toll_free_sms_verification_id` and `toll_free_sms_verification_order_status `in to the response of the [list all numbers API], [list single number API]
- Added `toll_free_sms_verification_order_status` filter to AccountPhoneNumber - list all my numbers API.

## [5.33.0](https://github.com/plivo/plivo-java/tree/v5.33.0) (2023-10-20)
**Feature - campaign_source field**
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ The Plivo Java SDK makes it simpler to integrate communications into your Java a

### To Install Stable release

You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.33.0/plivo-java-5.33.0.jar).
You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.34.0/plivo-java-5.34.0.jar).

If you are using Maven, use the following XML to include the Plivo SDK as a dependency.

```xml
<dependency>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.33.0</version>
<version>5.34.0</version>
</dependency>
```

If you are using Gradle, use the following line in your dependencies.
```
compile 'com.plivo:plivo-java:5.33.0'
compile 'com.plivo:plivo-java:5.34.0'
```

### To Install Beta release
Expand Down
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Written manually.

version=5.33.0
version=5.34.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.33.0</version>
<version>5.34.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
25 changes: 25 additions & 0 deletions src/main/java/com/plivo/api/PlivoAPIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.plivo.api.models.profile.*;
import com.plivo.api.models.token.TokenCreateResponse;
import com.plivo.api.models.token.TokenCreator;
import com.plivo.api.models.tollfree_verification.*;
import com.plivo.api.models.verify.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
Expand Down Expand Up @@ -758,4 +759,28 @@ Call<CallStreamGetSpecificResponse> callStreamGetSpecific(@Path("authId") String

@DELETE("Account/{authId}/VerifiedCallerId/{phoneNumber}")
Call<ResponseBody> deleteVerifiedCallerID(@Path("authId") String authId, @Path("phoneNumber") String phoneNumber);

// TollfreeVerification Request
// Get
@GET("Account/{authId}/TollfreeVerification/{uuid}/")
Call<TollfreeVerification> tollfreeVerificationGet(@Path("authId") String authId, @Path("uuid") String uuid);

// Create
@POST("Account/{authId}/TollfreeVerification/")
Call<TollfreeVerificationCreateResponse> tollfreeVerificationCreate(@Path("authId") String authId,
@Body TollfreeVerificationCreator tollfreeVerificationCreator);

// Update
@POST("Account/{authId}/TollfreeVerification/{uuid}/")
Call<TollfreeVerificationUpdateResponse> tollfreeVerificationUpdate(@Path("authId") String authId, @Path("uuid") String uuid,
@Body TollfreeVerificationUpdater tollfreeVerificationUpdater);

// List
@GET("Account/{authId}/TollfreeVerification/")
Call<ListResponse<TollfreeVerification>> tollfreeVerificationList(@Path("authId") String authId,
@QueryMap Map<String, Object> tollfreeVerificationLister);

// Delete
@DELETE("Account/{authId}/TollfreeVerification/{uuid}/")
Call<ResponseBody> tollfreeVerificationDelete(@Path("authId") String authId, @Path("uuid") String uuid);
}
10 changes: 10 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 tollFreeSmsVerificationOrderStatus;
private String tollFreeSmsVerificationId;

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

public String getTollFreeSmsVerificationOrderStatus() {
return tollFreeSmsVerificationOrderStatus;
}

public String getTollFreeSmsVerificationId() {
return tollFreeSmsVerificationId;
}
}
11 changes: 10 additions & 1 deletion 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 tollFreeSmsVerificationOrderStatus;

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

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

public NumberLister tollFreeSmsVerificationOrderStatus(final String tollFreeSmsVerificationOrderStatus) {
this.tollFreeSmsVerificationOrderStatus = tollFreeSmsVerificationOrderStatus;
return this;
}

public NumberLister numberStartswith(final String numberStartswith) {
this.numberStartswith = numberStartswith;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
package com.plivo.api.models.tollfree_verification;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.plivo.api.models.base.BaseResource;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class TollfreeVerification extends BaseResource {
private String uuid;
private String profileUuid;
private String number;
private String usecase;
private String usecaseSummary;
private String messageSample;
private String optinImageUrl;
private String optinType;
private String volume;
private String additionalInformation;
private String extraData;
private String callbackUrl;
private String callbackMethod;
private String status;
private String errorMessage;
private String created;
private String lastModified;

public static TollfreeVerificationCreator creator(String profileUuid, String number, String usecase, String usecaseSummary, String optinImageUrl,
String messageSample, String optinType, String volume, String additionalInformation,
String extraData, String callbackUrl, String callbackMethod) {

return new TollfreeVerificationCreator(profileUuid, number, usecase, usecaseSummary, optinImageUrl,
messageSample, optinType, volume, additionalInformation,extraData, callbackUrl, callbackMethod);
}

public static TollfreeVerificationCreator creator(String profileUuid, String number, String usecase, String usecaseSummary, String optinImageUrl,
String messageSample, String optinType, String volume, String additionalInformation) {

return new TollfreeVerificationCreator(profileUuid, number, usecase, usecaseSummary, optinImageUrl,
messageSample, optinType, volume, additionalInformation);
}

public static TollfreeVerificationCreator creator() {
return new TollfreeVerificationCreator();
}


public static TollfreeVerificationDeleter deleter(String uuid) {
return new TollfreeVerificationDeleter(uuid);
}

public static TollfreeVerificationGetter getter(String uuid) {
return new TollfreeVerificationGetter(uuid);
}

public static TollfreeVerificationLister lister() {
return new TollfreeVerificationLister();
}

public static TollfreeVerificationUpdater updater(String uuid) {
return new TollfreeVerificationUpdater(uuid);
}

public TollfreeVerificationDeleter deleter() {
return new TollfreeVerificationDeleter(uuid);
}

public TollfreeVerificationUpdater updater() {
return new TollfreeVerificationUpdater(uuid);
}


@Override
public String getId() {
return getUuid();
}

public String getUuid() {
return uuid;
}

public String getProfileUuid() {
return profileUuid;
}

public String getNumber() {
return number;
}

public String getUsecase() {
return usecase;
}

public String getUsecaseSummary() {
return usecaseSummary;
}

public String getMessageSample() {
return messageSample;
}

public String getOptinImageUrl() {
return optinImageUrl;
}

public String getOptinType() {
return optinType;
}

public String getVolume() {
return volume;
}

public String getAdditionalInformation() {
return additionalInformation;
}

public String getExtraData() {
return extraData;
}

public String getCallbackUrl() {
return callbackUrl;
}

public String getCallbackMethod() {
return callbackMethod;
}

public String getStatus() {
return status;
}

public String created() {
return created;
}

public String lastModified() {
return lastModified;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.plivo.api.models.tollfree_verification;

import com.plivo.api.models.base.BaseResponse;

public class TollfreeVerificationCreateResponse extends BaseResponse {
private String uuid;

public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}
}
Loading

0 comments on commit a85091b

Please sign in to comment.