Skip to content

Commit

Permalink
Merge branch 'master' of github.com:plivo/plivo-java into VT-8193
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinaya-Shunmugavel committed Nov 5, 2024
2 parents 391df46 + 131b704 commit 51b0a6e
Show file tree
Hide file tree
Showing 20 changed files with 218 additions and 84 deletions.
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Change Log
## [5.44.4](https://github.com/plivo/plivo-java/tree/v5.44.4) (2024-09-10)
## [5.46.0](https://github.com/plivo/plivo-java/tree/v5.46.0) (2024-11-06)
**Feature - Adding few optional parameters to the existing machine detection params**
- Added six new optional machine detection params `machine_detection_maximum_speech_length`,`machine_detection_initial_silence`,`machine_detection_maximum_words`,`machine_detection_initial_greeting`,`machine_detection_silence`,`machine_detection_answer_time`

## [5.45.3](https://github.com/plivo/plivo-java/tree/v5.45.3)(2024-10-23)
**Feature - fraudCheck param in Create, Get and List Session**
- Support for the `fraud_check` parameter in sms verify session request
- Added support for `fraud_check` in GET and LIST verify session

## [5.45.2](https://github.com/plivo/plivo-java/tree/v5.45.2) (2024-10-14)
**Feature - Fix all null returning params in MMS API Responses**
- Fix MMS API parameters returning NULL and match response with Public APIs
- Change in Code Snippet for List Media using Message UUID

## [5.45.1](https://github.com/plivo/plivo-java/tree/v5.45.1) (2024-10-10)
**Feature - Dtmf param in Create, Get and List Session**
- Support for the `dtmf` parameter in voice verify session request
- Added support for `dtmf` in GET and LIST verify session

## [5.45.0](https://github.com/plivo/plivo-java/tree/v5.45.0) (2024-09-30)
**Feature - Adding new param support for Number Masking session with single party **
- Added `create_session_with_single_party`, `virtual_number_cooloff_period` and `force_pin_authentication` attributes in Masking Session

## [5.44.3](https://github.com/plivo/plivo-java/tree/v5.44.3) (2024-09-06)
**Feature - Adding more attribute on mdr object**
- Added `message_sent_time`, `message_updated_time` and `error-message` on get and list Message API
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ build:

start:
docker-compose up --build --remove-orphans --detach
docker attach $(shell docker-compose ps -q javaSDK)
# Wait for the container to be running before attaching
@while [ -z "$$(docker-compose ps -q javaSDK)" ]; do \
sleep 1; \
done
docker attach $$(docker-compose ps -q javaSDK)

test:
@[ "${CONTAINER}" ] && \
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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.44.3/plivo-java-5.44.3.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.46.0/plivo-java-5.46.0.jar).


If you are using Maven, use the following XML to include the Plivo SDK as a dependency.
Expand All @@ -19,13 +19,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe
<dependency>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.44.4</version>
<version>5.46.0</version>
</dependency>
```

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

### To Install Beta release
Expand Down Expand Up @@ -308,7 +308,7 @@ class Test
bodyComponent.setParameters(bodyParameters);
components.add(bodyComponent);

template.setComponents(components);
template.setComponents(components)
MessageCreateResponse response = Message.creator("+14156667778","+14156667777").type(MessageType.WHATSAPP).template(template).create();
ObjectMapper ow = new ObjectMapper();
String json_output = ow.writeValueAsString(response);
Expand Down Expand Up @@ -375,7 +375,7 @@ class Test
Plivo.init("<auth_id>", "<auth_token>");
String[] media = {"https://sample-videos.com/img/Sample-png-image-1mb.png"};
try {
MessageCreateResponse response = Message.creator("+14156667778","+14156667777","WA -text").log(false).type(MessageType.WHATSAPP).media_urls(media).create();
MessageCreateResponse response = Message.creator("+14156667778","+14156667777","WA -text").log(false).type(MessageType.WHATSAPP).media_urls(media).create()
System.out.println(response);
}
catch (PlivoRestException | IOException e) {
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.44.4
version=5.46.0
groupId=com.plivo
artifactId=plivo-java

3 changes: 1 addition & 2 deletions 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.44.4</version>
<version>5.46.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 Expand Up @@ -76,7 +76,6 @@
<version>2.7.5</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
4 changes: 2 additions & 2 deletions src/main/java/com/plivo/api/PlivoAPIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ Call<ListResponse<Message>> messageList(@Path("authId") String authId,
Call<Message> messageGet(@Path("authId") String authId, @Path("id") String id);

@GET("Account/{authId}/Message/{id}/Media/")
Call<ListResponse<MmsMedia>> mmsMediaList(@Path("authId") String authId, @Path("id") String id);
Call<ListResponse<MmsMedia>> mmsMediaList(@Path("authId") String authId, @Path("id") String id, @QueryMap Map<String, Object> mediaListRequest);

@GET("Account/{authId}/Message/{id}/Media/{media_id}/")
@GET("Account/{authId}/Message/{id}/Media/{media_id}/")
Call<MmsMedia> mmsMediaGet(@Path("authId") String authId, @Path("id") String id, @Path("media_id") String media_id);

@DELETE("Account/{authId}/Message/{id}/Media/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ public class MaskingSessionCreator extends VoiceCreator<MaskingSessionCreateResp
private boolean generatePin;
private boolean record;
private int ringTimeout;
private int generatePinLength;
private int pinRetry;
private int pinRetryWait;
private Integer generatePinLength;
private Integer pinRetry;
private Integer pinRetryWait;
private int sessionExpiry;
private int callTimeLimit;
private boolean createSessionWithSingleParty;
private boolean forcePinAuthentication;
private int virtualNumberCooloffPeriod;

public MaskingSessionCreator(String firstParty, String secondParty) {
this.firstParty = firstParty;
Expand Down Expand Up @@ -179,24 +182,24 @@ public MaskingSessionCreator ringTimeout(final int ringTimeout) {
this.ringTimeout = ringTimeout;
return this;
}
public int generatePinLength() {
public Integer generatePinLength() {
return this.generatePinLength;
}
public MaskingSessionCreator generatePinLength(final int generatePinLength) {
public MaskingSessionCreator generatePinLength(final Integer generatePinLength) {
this.generatePinLength = generatePinLength;
return this;
}
public int pinRetry() {
public Integer pinRetry() {
return this.pinRetry;
}
public MaskingSessionCreator pinRetry(final int pinRetry) {
public MaskingSessionCreator pinRetry(final Integer pinRetry) {
this.pinRetry = pinRetry;
return this;
}
public int pinRetryWait() {
public Integer pinRetryWait() {
return this.pinRetryWait;
}
public MaskingSessionCreator pinRetryWait(final int pinRetryWait) {
public MaskingSessionCreator pinRetryWait(final Integer pinRetryWait) {
this.pinRetryWait = pinRetryWait;
return this;
}
Expand All @@ -214,4 +217,25 @@ public MaskingSessionCreator geomatch(final boolean geomatch) {
this.geomatch = geomatch;
return this;
}
public boolean createSessionWithSingleParty() {
return this.createSessionWithSingleParty;
}
public MaskingSessionCreator createSessionWithSingleParty(final boolean createSessionWithSingleParty) {
this.createSessionWithSingleParty = createSessionWithSingleParty;
return this;
}
public boolean forcePinAuthentication() {
return this.forcePinAuthentication;
}
public MaskingSessionCreator forcePinAuthentication(final boolean forcePinAuthentication) {
this.forcePinAuthentication = forcePinAuthentication;
return this;
}
public int virtualNumberCooloffPeriod() {
return this.virtualNumberCooloffPeriod;
}
public MaskingSessionCreator virtualNumberCooloffPeriod(final int virtualNumberCooloffPeriod) {
this.virtualNumberCooloffPeriod = virtualNumberCooloffPeriod;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import retrofit2.Call;

public class MaskingSessionUpdater extends VoiceUpdater<MaskingSessionUpdateResponse> {

private String firstParty;
private String secondParty;
private int sessionExpiry;
private int callTimeLimit;
private int ringTimeout;
Expand All @@ -19,7 +20,7 @@ public class MaskingSessionUpdater extends VoiceUpdater<MaskingSessionUpdateResp
private String recordFileFormat;
private Boolean geomatch = null;
private boolean record;

private boolean createSessionWithSingleParty;
public MaskingSessionUpdater(String id) {
super(id);
}
Expand All @@ -36,6 +37,20 @@ protected Call<MaskingSessionUpdateResponse> obtainFallback2Call() throws PlivoV
return client().getVoiceFallback2Service().maskingSessionUpdate(client().getAuthId(), id, this);
}

public String firstParty() {
return this.firstParty;
}
public MaskingSessionUpdater firstParty(final String firstParty){
this.firstParty = firstParty;
return this;
}
public String secondParty() {
return this.secondParty;
}
public MaskingSessionUpdater secondParty(final String secondParty){
this.secondParty = secondParty;
return this;
}
public int callTimeLimit() {
return this.callTimeLimit;
}
Expand Down Expand Up @@ -127,5 +142,12 @@ public MaskingSessionUpdater sessionExpiry(final int sessionExpiry) {
this.sessionExpiry = sessionExpiry;
return this;
}
public boolean createSessionWithSingleParty() {
return this.createSessionWithSingleParty;
}
public MaskingSessionUpdater createSessionWithSingleParty(final boolean record){
this.createSessionWithSingleParty = createSessionWithSingleParty;
return this;
}
}

19 changes: 7 additions & 12 deletions src/main/java/com/plivo/api/models/media/Media.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,30 @@
import com.plivo.api.exceptions.ResourceNotFoundException;
import com.plivo.api.models.base.BaseResource;


public class Media extends BaseResource {

private String mediaId;
private String fileName;
private String contentType;
private int size;
private String uploadTime;
private String mediaUrl;
private String url;

private String status;
private int statusCode;

public static MediaUploader creator(
String[] fileNames) throws ResourceNotFoundException {
return new MediaUploader(fileNames);
}


public static MediaGetter getter(String id) {
return new MediaGetter(id);
}

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


public String getMediaId() {
return mediaId;
Expand All @@ -49,16 +48,12 @@ public String getUploadTime() {
return uploadTime;
}

public String getUrl() {
return url;
public String getMediaUrl() {
return mediaUrl;
}

public String getStatus() {
return status;
}

public int getStatusCode() {
return statusCode;
public String getUrl() {
return url;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/plivo/api/models/media/MediaLister.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.plivo.api.models.base.ListResponse;
import com.plivo.api.models.base.Lister;
import com.plivo.api.models.media.Media;

import retrofit2.Call;

public class MediaLister extends Lister<Media> {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/plivo/api/models/media/MediaResponse.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.plivo.api.models.media;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.plivo.api.models.base.BaseResponse;

import java.util.List;


public class MediaResponse extends BaseResponse {
private List<MediaUploadResponse> objects;


public List<MediaUploadResponse> getObjects() {
return objects;
}
Expand Down
36 changes: 27 additions & 9 deletions src/main/java/com/plivo/api/models/message/MmsMedia.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,51 @@
package com.plivo.api.models.message;

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

@JsonIgnoreProperties(value = {"id"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MmsMedia extends BaseResource {
private String content_type;
private String media_id;
private String media_url;
private String message_uuid;
private long size;
private String mediaId;
private String fileName;
private String contentType;
private long size;
private String uploadTime;
private String mediaUrl;
private String messageUuid;

public static MmsMediaLister listMedia(String message_uuid) {
return new MmsMediaLister(message_uuid);
}

public String getContentType() {
return content_type;
return contentType;
}

public String getMediaId() {
return media_id;
return mediaId;
}

public String getMediaUrl() {
return media_url;
return mediaUrl;
}

public String getMessageUuid() {
return message_uuid;
return messageUuid;
}

public long getSize() {
return size;
}

public String getFileName() {
return fileName;
}

public String getUploadTime() {
return uploadTime;
}

@Override
public String getId() {
Expand Down
Loading

0 comments on commit 51b0a6e

Please sign in to comment.