Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Vt 6710"" #262

Merged
merged 2 commits into from
Oct 18, 2023
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [5.32.0](https://github.com/plivo/plivo-java/tree/v5.32.0) (2023-10-18)
**Feature - Verify Caller Id API support**
- API support for verifying, updating, getting and deleting caller IDs.

## [5.31.1](https://github.com/plivo/plivo-java/tree/v5.31.1) (2023-10-05)
**Feature - WhatsApp message support**
- Version bump
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.31.1/plivo-java-5.31.1.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.32.1/plivo-java-5.32.1.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.31.1</version>
<version>5.32.0</version>
</dependency>
```

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

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

version=5.31.1
version=5.32.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.31.1</version>
<version>5.32.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
20 changes: 20 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.verify.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
Expand Down Expand Up @@ -738,4 +739,23 @@ Call<ResponseBody> callStreamDeleteSpecific(@Path("authId") String authId, @Path
@GET("Account/{authId}/Call/{callId}/Stream/{streamId}")
Call<CallStreamGetSpecificResponse> callStreamGetSpecific(@Path("authId") String authId, @Path("callId") String callId,
@Path("streamId") String streamId);

//Verify
@POST("Account/{authId}/VerifiedCallerId/")
Call<InitiateVerifyResponse> initiateVerify(@Path("authId") String authId, @Body InitiateVerify initiateVerify);

@POST("Account/{authId}/VerifiedCallerId/Verification/{verificationUuid}/")
Call<VerifyCallerIdResponse> verifyCallerID(@Path("authId") String authId, @Path("verificationUuid") String verificationUuid, @Body VerifyCallerId verifyCallerId);

@POST("Account/{authId}/VerifiedCallerId/{phoneNumber}")
Call<UpdateVerifiedCallerIdResponse> updateVerifiedCallerID(@Path("authId") String authId, @Path("phoneNumber") String phoneNumber, @Body UpdateVerifiedCallerID updateVerifiedCallerID);

@GET("Account/{authId}/VerifiedCallerId/{phoneNumber}")
Call<GetVerifiedCallerIdResponse> getVerifiedCallerID(@Path("authId") String authId, @Path("phoneNumber") String phoneNumber);

@GET("Account/{authId}/VerifiedCallerId/")
Call<ListVerifiedCallerIdResponse> listVerifiedCallerID(@Path("authId") String authId, @QueryMap Map<String, Object> listVerifiedCallerId);

@DELETE("Account/{authId}/VerifiedCallerId/{phoneNumber}")
Call<ResponseBody> deleteVerifiedCallerID(@Path("authId") String authId, @Path("phoneNumber") String phoneNumber);
}
26 changes: 26 additions & 0 deletions src/main/java/com/plivo/api/models/verify/GetVerifiedCallerId.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.plivo.api.models.verify;

import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.models.base.VoiceGetter;
import retrofit2.Call;

public class GetVerifiedCallerId extends VoiceGetter<GetVerifiedCallerIdResponse> {
public GetVerifiedCallerId(String id) {
super(id);
}

@Override
protected Call<GetVerifiedCallerIdResponse> obtainCall() throws PlivoValidationException {
return client().getVoiceApiService().getVerifiedCallerID(client().getAuthId(), id);
}

@Override
protected Call<GetVerifiedCallerIdResponse> obtainFallback1Call() throws PlivoValidationException {
return client().getVoiceFallback1Service().getVerifiedCallerID(client().getAuthId(), id);
}

@Override
protected Call<GetVerifiedCallerIdResponse> obtainFallback2Call() throws PlivoValidationException {
return client().getVoiceFallback2Service().getVerifiedCallerID(client().getAuthId(), id);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.plivo.api.models.verify;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.models.base.BaseResource;

@JsonIgnoreProperties("id")
public class GetVerifiedCallerIdResponse extends BaseResource {

private String alias;
private String apiId;
private String country;
private String createdAt;
private String modifiedAt;
private String phoneNumber;
private String subaccount;
private String verificationUuid;

public String getAlias() {
return alias;
}

public String getCountry() {
return country;
}

public String getCreatedAt() {
return createdAt;
}

public String getModifiedAt() {
return modifiedAt;
}

public String getPhoneNumber() {
return phoneNumber;
}

public String getSubaccount() {
return subaccount;
}

public String getVerificationUuid() {
return verificationUuid;
}

@Override
public String getApiId() {
return apiId;
}

@Override
public String getId() throws PlivoValidationException {
return null;
}
}
58 changes: 58 additions & 0 deletions src/main/java/com/plivo/api/models/verify/InitiateVerify.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.plivo.api.models.verify;

import com.plivo.api.models.base.VoiceCreator;
import retrofit2.Call;

public class InitiateVerify extends VoiceCreator<InitiateVerifyResponse> {

private String phoneNumber;
private String alias;
private String channel;
private String subaccount;

public String getPhoneNumber() {
return phoneNumber;
}
public String getAlias() {
return alias;
}
public String getChannel() {
return channel;
}
public String getSubaccount() {
return subaccount;
}

public InitiateVerify phoneNumber(final String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
public InitiateVerify alias(final String alias) {
this.alias = alias;
return this;
}
public InitiateVerify channel(final String channel) {
this.channel = channel;
return this;
}
public InitiateVerify subaccount(final String subaccount) {
this.subaccount = subaccount;
return this;
}

@Override
protected Call<InitiateVerifyResponse> obtainCall() {
return client().getVoiceApiService().initiateVerify(client().getAuthId(),this);
}

@Override
protected Call<InitiateVerifyResponse> obtainFallback1Call() {
return client().getVoiceFallback1Service().initiateVerify(client().getAuthId(), this);
}

@Override
protected Call<InitiateVerifyResponse> obtainFallback2Call() {
return client().getVoiceFallback2Service().initiateVerify(client().getAuthId(), this);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.plivo.api.models.verify;

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

public class InitiateVerifyResponse extends BaseResponse {
private String apiId;

private String message;

private String verificationUuid;

public String getVerificationUuid() {
return verificationUuid;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.plivo.api.models.verify;

import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.models.base.VoiceGetter;
import retrofit2.Call;

public class ListVerifiedCallerId extends VoiceGetter<ListVerifiedCallerIdResponse> {

private String country;
private String subaccount;
private String alias;
private Integer limit;
private Integer offset;

public String getCountry() {
return country;
}

public String getSubaccount() {
return subaccount;
}

public String getAlias() {
return alias;
}

public Integer getLimit() {
return limit;
}

public Integer getOffset() {
return offset;
}

public ListVerifiedCallerId country(final String country) {
this.country = country;
return this;
}
public ListVerifiedCallerId subaccount(final String subaccount) {
this.subaccount = subaccount;
return this;
}
public ListVerifiedCallerId alias(final String alias) {
this.alias = alias;
return this;
}
public ListVerifiedCallerId limit(final Integer limit) {
this.limit = limit;
return this;
}
public ListVerifiedCallerId offset(final Integer offset) {
this.offset = offset;
return this;
}

public ListVerifiedCallerId() {
super("");
}

@Override
protected Call<ListVerifiedCallerIdResponse> obtainCall() throws PlivoValidationException {
return client().getVoiceApiService().listVerifiedCallerID(client().getAuthId(), toMap());
}

@Override
protected Call<ListVerifiedCallerIdResponse> obtainFallback1Call() throws PlivoValidationException {
return client().getVoiceFallback1Service().listVerifiedCallerID(client().getAuthId(), toMap());
}

@Override
protected Call<ListVerifiedCallerIdResponse> obtainFallback2Call() throws PlivoValidationException {
return client().getVoiceFallback2Service().listVerifiedCallerID(client().getAuthId(), toMap());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.plivo.api.models.verify;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.models.base.BaseResource;

import java.util.List;

@JsonIgnoreProperties("id")
public class ListVerifiedCallerIdResponse extends BaseResource {

private String apiId;

private VerifyMeta meta;

private List<ListVerifiedCallerIdStructure> objects;

public VerifyMeta getMeta() {
return meta;
}

public List<ListVerifiedCallerIdStructure> getObjects() {
return objects;
}

@Override
public String getId() throws PlivoValidationException {
return null;
}

@Override
public String getApiId() {
return apiId;
}
}
Loading
Loading