From 107c9a3513029ab13bb299ac96d544b9b80efa06 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Fri, 24 Feb 2023 10:40:39 +0530 Subject: [PATCH 01/17] added new params --- .../com/plivo/api/models/recording/Recording.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/plivo/api/models/recording/Recording.java b/src/main/java/com/plivo/api/models/recording/Recording.java index 30dd7375..0c6466b4 100644 --- a/src/main/java/com/plivo/api/models/recording/Recording.java +++ b/src/main/java/com/plivo/api/models/recording/Recording.java @@ -7,6 +7,8 @@ public class Recording extends BaseResource { private String addTime; private String callUuid; private String conferenceName; + private String cost; + private String daysOfStorage; private String recordingDurationMs; private String recordingEndMs; private String recordingFormat; @@ -15,6 +17,7 @@ public class Recording extends BaseResource { private String recordingUrl; private String resourceUri; private String recordingId; + private String roundedDuration; private String fromNumber; private String toNumber; @@ -112,6 +115,18 @@ public String getRecordingUrl() { return recordingUrl; } + public String getCost() { + return cost; + } + + public String getDaysOfStorage() { + return daysOfStorage; + } + + public String getRoundedDuration() { + return roundedDuration; + } + public String getResourceUri() { return resourceUri; } From 3fbf9f1690280a21147ea82735b3fe7ee7dc432e Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Mon, 27 Feb 2023 16:17:46 +0530 Subject: [PATCH 02/17] changed UTs --- .../com/plivo/api/recordingGetResponse.json | 5 ++++- .../com/plivo/api/recordingListResponse.json | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/test/resources/com/plivo/api/recordingGetResponse.json b/src/test/resources/com/plivo/api/recordingGetResponse.json index 980e4e9f..cb3898cc 100644 --- a/src/test/resources/com/plivo/api/recordingGetResponse.json +++ b/src/test/resources/com/plivo/api/recordingGetResponse.json @@ -12,5 +12,8 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/recordingListResponse.json b/src/test/resources/com/plivo/api/recordingListResponse.json index 0da01418..75033b41 100644 --- a/src/test/resources/com/plivo/api/recordingListResponse.json +++ b/src/test/resources/com/plivo/api/recordingListResponse.json @@ -21,7 +21,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 16:05:21.993853+05:30", @@ -36,7 +39,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 15:51:56.582492+05:30", @@ -51,7 +57,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } ] } \ No newline at end of file From b608d4ac4ccd55c642708124e03af9c3d0794265 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Tue, 28 Feb 2023 01:27:06 +0530 Subject: [PATCH 03/17] Added filter --- .../plivo/api/models/recording/RecordingLister.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/plivo/api/models/recording/RecordingLister.java b/src/main/java/com/plivo/api/models/recording/RecordingLister.java index 399b694d..e0499d87 100644 --- a/src/main/java/com/plivo/api/models/recording/RecordingLister.java +++ b/src/main/java/com/plivo/api/models/recording/RecordingLister.java @@ -16,6 +16,7 @@ public class RecordingLister extends VoiceLister { private String mpcName; private String conferenceUuid; private String mpcUuid; + private String roundedDuration; private PropertyFilter addTime; public String subaccount() { @@ -54,6 +55,10 @@ public PropertyFilter addTime() { return this.addTime; } + public String roundedDuration() { + return roundedDuration; + } + /** * @param subaccount auth_id of the subaccount. Lists only those recordings of the main accounts * which are tied to the specified subaccount. @@ -127,6 +132,14 @@ public RecordingLister addTime(final PropertyFilter addTime) { return this; } + /** + * @param roundedDuration Used to filter out recordings according to their rounded duration as multiples of 60 seconds. + */ + public RecordingLister roundedDuration(final String roundedDuration) { + this.roundedDuration = roundedDuration; + return this; + } + @Override protected Call> obtainCall() { return client().getVoiceApiService().recordingList(client().getAuthId(), toMap()); From 0add6dba35e7fc32b7a90a786a4a9f26de0e186e Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Thu, 23 Feb 2023 14:20:54 +0530 Subject: [PATCH 04/17] SMS-4946/SMS-4848 adding is domestic in get and list mdr api --- CHANGELOG.md | 3 + README.md | 6 +- pom.properties | 2 +- pom.xml | 2 +- .../com/plivo/api/models/message/Message.java | 5 ++ src/main/resources/com/plivo/api/version.txt | 2 +- .../com/plivo/api/messageGetResponse.json | 3 +- .../com/plivo/api/messageListResponse.json | 60 ++++++++++++------- 8 files changed, 56 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e96dab..1b3a22e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ **Feature - Enhance MDR filtering capabilities ** - Added new fields on MDR object response +## [5.20.0](https://github.com/plivo/plivo-java/tree/v5.20.0) (2023-02-23) +- Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) + ## [5.19.1](https://github.com/plivo/plivo-java/tree/v5.19.1) (2022-01-31) - Add `requesterIP` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) diff --git a/README.md b/README.md index 2efb9fad..ba7f971f 100644 --- a/README.md +++ b/README.md @@ -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.19.1/plivo-java-5.19.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.20.0/plivo-java-5.20.0.jar). If you are using Maven, use the following XML to include the Plivo SDK as a dependency. @@ -18,13 +18,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.19.2 + 5.20.0 ``` If you are using Gradle, use the following line in your dependencies. ``` -compile 'com.plivo:plivo-java:5.19.2' +compile 'com.plivo:plivo-java:5.20.0' ``` ### To Install Beta release diff --git a/pom.properties b/pom.properties index d647ad89..dff0fce4 100644 --- a/pom.properties +++ b/pom.properties @@ -1,5 +1,5 @@ # Written manually. -version=5.19.2 +version=5.20.0 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index a7b4a23d..d30e8ce3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.19.2 + 5.20.0 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/java/com/plivo/api/models/message/Message.java b/src/main/java/com/plivo/api/models/message/Message.java index 567e67f4..988374df 100644 --- a/src/main/java/com/plivo/api/models/message/Message.java +++ b/src/main/java/com/plivo/api/models/message/Message.java @@ -22,6 +22,7 @@ public class Message extends BaseResource { private String tendlcRegistrationStatus; private String destinationCountryIso2; private String requesterIP; + private Boolean isDomestic; public static MessageCreator creator(String source, List destination, String text) { return new MessageCreator(source, destination, text); @@ -116,6 +117,10 @@ public Long getUnits() { return units; } + public Boolean getIsDomestic() { + return isDomestic; + } + @Override public String getId() { return getMessageUuid(); diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index 8093dce1..0af471c5 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.19.2 +5.20.0 diff --git a/src/test/resources/com/plivo/api/messageGetResponse.json b/src/test/resources/com/plivo/api/messageGetResponse.json index ba8c2414..a1a83461 100644 --- a/src/test/resources/com/plivo/api/messageGetResponse.json +++ b/src/test/resources/com/plivo/api/messageGetResponse.json @@ -12,5 +12,6 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.1" + "requester_ip": "192.168.1.1", + "is_domestic": false } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/messageListResponse.json b/src/test/resources/com/plivo/api/messageListResponse.json index cd0814bf..b0edf244 100644 --- a/src/test/resources/com/plivo/api/messageListResponse.json +++ b/src/test/resources/com/plivo/api/messageListResponse.json @@ -20,7 +20,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.1" + "requester_ip": "192.168.1.1", + "is_domestic": false }, { "error_code": null, @@ -35,7 +36,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.2" + "requester_ip": "192.168.1.2", + "is_domestic": false }, { "error_code": null, @@ -50,7 +52,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.3" + "requester_ip": "192.168.1.3", + "is_domestic": false }, { "error_code": null, @@ -65,7 +68,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.4" + "requester_ip": "192.168.1.4", + "is_domestic": false }, { "error_code": null, @@ -80,7 +84,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.5" + "requester_ip": "192.168.1.5", + "is_domestic": false }, { "error_code": null, @@ -95,7 +100,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.6" + "requester_ip": "192.168.1.6", + "is_domestic": false }, { "error_code": null, @@ -110,7 +116,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.7" + "requester_ip": "192.168.1.7", + "is_domestic": false }, { "error_code": null, @@ -125,7 +132,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.8" + "requester_ip": "192.168.1.8", + "is_domestic": false }, { "error_code": "000", @@ -140,7 +148,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.9" + "requester_ip": "192.168.1.9", + "is_domestic": false }, { "error_code": null, @@ -155,7 +164,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.10" + "requester_ip": "192.168.1.10", + "is_domestic": false }, { "error_code": "000", @@ -170,7 +180,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.11" + "requester_ip": "192.168.1.11", + "is_domestic": false }, { "error_code": null, @@ -185,7 +196,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.12" + "requester_ip": "192.168.1.12", + "is_domestic": false }, { "error_code": "000", @@ -200,7 +212,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.13" + "requester_ip": "192.168.1.13", + "is_domestic": false }, { "error_code": null, @@ -215,7 +228,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.14" + "requester_ip": "192.168.1.14", + "is_domestic": false }, { "error_code": "000", @@ -230,7 +244,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.15" + "requester_ip": "192.168.1.15", + "is_domestic": false }, { "error_code": null, @@ -245,7 +260,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.16" + "requester_ip": "192.168.1.16", + "is_domestic": false }, { "error_code": "000", @@ -260,7 +276,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.17" + "requester_ip": "192.168.1.17", + "is_domestic": false }, { "error_code": "000", @@ -275,7 +292,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.18" + "requester_ip": "192.168.1.18", + "is_domestic": false }, { "error_code": "000", @@ -290,7 +308,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.19" + "requester_ip": "192.168.1.19", + "is_domestic": false }, { "error_code": "000", @@ -305,7 +324,8 @@ "total_amount": "0.00250", "total_rate": "0.00250", "units": 1, - "requester_ip": "192.168.1.20" + "requester_ip": "192.168.1.20", + "is_domestic": false } ] } \ No newline at end of file From 9a4b8b3e1714d8350a4828d07adfb50c8c975355 Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Fri, 3 Mar 2023 15:39:28 +0530 Subject: [PATCH 05/17] updating order of changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3a22e2..53ef2e48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Change Log +## [5.20.0](https://github.com/plivo/plivo-java/tree/v5.20.0) (2023-02-23) +- Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) + ## [5.19.2](https://github.com/plivo/plivo-java/tree/v5.19.2) (2023-02-23) **Feature - Enhance MDR filtering capabilities ** - Added new fields on MDR object response -## [5.20.0](https://github.com/plivo/plivo-java/tree/v5.20.0) (2023-02-23) -- Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) - ## [5.19.1](https://github.com/plivo/plivo-java/tree/v5.19.1) (2022-01-31) - Add `requesterIP` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) From 9d4d1c1e5f15aa0ddc298f72d266338a68ef72ba Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Fri, 24 Feb 2023 10:40:39 +0530 Subject: [PATCH 06/17] added new params --- .../com/plivo/api/models/recording/Recording.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/plivo/api/models/recording/Recording.java b/src/main/java/com/plivo/api/models/recording/Recording.java index 30dd7375..0c6466b4 100644 --- a/src/main/java/com/plivo/api/models/recording/Recording.java +++ b/src/main/java/com/plivo/api/models/recording/Recording.java @@ -7,6 +7,8 @@ public class Recording extends BaseResource { private String addTime; private String callUuid; private String conferenceName; + private String cost; + private String daysOfStorage; private String recordingDurationMs; private String recordingEndMs; private String recordingFormat; @@ -15,6 +17,7 @@ public class Recording extends BaseResource { private String recordingUrl; private String resourceUri; private String recordingId; + private String roundedDuration; private String fromNumber; private String toNumber; @@ -112,6 +115,18 @@ public String getRecordingUrl() { return recordingUrl; } + public String getCost() { + return cost; + } + + public String getDaysOfStorage() { + return daysOfStorage; + } + + public String getRoundedDuration() { + return roundedDuration; + } + public String getResourceUri() { return resourceUri; } From 55371f69c086df175e89d7e5fd139d049a279094 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Mon, 27 Feb 2023 16:17:46 +0530 Subject: [PATCH 07/17] changed UTs --- .../com/plivo/api/recordingGetResponse.json | 5 ++++- .../com/plivo/api/recordingListResponse.json | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/test/resources/com/plivo/api/recordingGetResponse.json b/src/test/resources/com/plivo/api/recordingGetResponse.json index 980e4e9f..cb3898cc 100644 --- a/src/test/resources/com/plivo/api/recordingGetResponse.json +++ b/src/test/resources/com/plivo/api/recordingGetResponse.json @@ -12,5 +12,8 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/recordingListResponse.json b/src/test/resources/com/plivo/api/recordingListResponse.json index 0da01418..75033b41 100644 --- a/src/test/resources/com/plivo/api/recordingListResponse.json +++ b/src/test/resources/com/plivo/api/recordingListResponse.json @@ -21,7 +21,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 16:05:21.993853+05:30", @@ -36,7 +39,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 15:51:56.582492+05:30", @@ -51,7 +57,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } ] } \ No newline at end of file From 08c4348d952f2dc3b8ba3063c799ba802e90e8ab Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Tue, 28 Feb 2023 01:27:06 +0530 Subject: [PATCH 08/17] Added filter --- .../plivo/api/models/recording/RecordingLister.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/plivo/api/models/recording/RecordingLister.java b/src/main/java/com/plivo/api/models/recording/RecordingLister.java index 399b694d..e0499d87 100644 --- a/src/main/java/com/plivo/api/models/recording/RecordingLister.java +++ b/src/main/java/com/plivo/api/models/recording/RecordingLister.java @@ -16,6 +16,7 @@ public class RecordingLister extends VoiceLister { private String mpcName; private String conferenceUuid; private String mpcUuid; + private String roundedDuration; private PropertyFilter addTime; public String subaccount() { @@ -54,6 +55,10 @@ public PropertyFilter addTime() { return this.addTime; } + public String roundedDuration() { + return roundedDuration; + } + /** * @param subaccount auth_id of the subaccount. Lists only those recordings of the main accounts * which are tied to the specified subaccount. @@ -127,6 +132,14 @@ public RecordingLister addTime(final PropertyFilter addTime) { return this; } + /** + * @param roundedDuration Used to filter out recordings according to their rounded duration as multiples of 60 seconds. + */ + public RecordingLister roundedDuration(final String roundedDuration) { + this.roundedDuration = roundedDuration; + return this; + } + @Override protected Call> obtainCall() { return client().getVoiceApiService().recordingList(client().getAuthId(), toMap()); From 091109cbace056026a5dbc34307cb0d443756330 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 8 Mar 2023 14:41:30 +0530 Subject: [PATCH 09/17] Changed version --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- pom.properties | 2 +- pom.xml | 2 +- src/main/resources/com/plivo/api/version.txt | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ef2e48..e47d4ebf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [5.20.1](https://github.com/plivo/plivo-java/tree/v5.20.1) (2023-03-08) +- Added `cost`, `rounded_duration`, and `days_of_storage` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) +- Added `rounded_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) + ## [5.20.0](https://github.com/plivo/plivo-java/tree/v5.20.0) (2023-02-23) - Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) diff --git a/README.md b/README.md index ba7f971f..6610896d 100644 --- a/README.md +++ b/README.md @@ -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.20.0/plivo-java-5.20.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.20.1/plivo-java-5.20.1.jar). If you are using Maven, use the following XML to include the Plivo SDK as a dependency. @@ -18,7 +18,7 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.20.0 + 5.20.1 ``` diff --git a/pom.properties b/pom.properties index dff0fce4..3c5c1ab4 100644 --- a/pom.properties +++ b/pom.properties @@ -1,5 +1,5 @@ # Written manually. -version=5.20.0 +version=5.20.1 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index d30e8ce3..8b087e8d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.20.0 + 5.20.1 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index 0af471c5..e38d6297 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.20.0 +5.20.1 From a39f3a04e2ff2d0f083947c95d822eabe0be05aa Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Mon, 27 Feb 2023 20:25:38 +0530 Subject: [PATCH 10/17] local docker setup --- .gitignore | 5 ++++- Dockerfile | 12 +++++++++++ Makefile | 14 +++++++++++++ README.md | 25 +++++++++++++++++++++++ docker-compose.yml | 18 ++++++++++++++++ setup_sdk.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 docker-compose.yml create mode 100755 setup_sdk.sh diff --git a/.gitignore b/.gitignore index 4bba13f7..5e56d1fa 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,7 @@ hs_err_pid* *.iml /target/ -.DS_Store \ No newline at end of file +.DS_Store + +# Local test files +java-sdk-test/* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2879f37c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM openjdk:8-alpine + +RUN apk update && apk add git vim bash wget make + +WORKDIR /usr/src/app +ENV CLASSPATH ${CLASSPATH}:/etc/jars/* + +# Copy setup script +COPY setup_sdk.sh /usr/src/app/ +RUN chmod a+x /usr/src/app/setup_sdk.sh + +ENTRYPOINT [ "/usr/src/app/setup_sdk.sh" ] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..1fb21689 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +.PHONY: build test run + +build: + docker-compose up --build --remove-orphans + +test: + @[ "${CONTAINER}" ] && \ + docker exec -it $$CONTAINER /bin/bash -c "/usr/src/app/gradlew test" || \ + /usr/src/app/gradlew test + +run: + @[ "${CONTAINER}" ] && \ + (docker exec -it $$CONTAINER /bin/bash -c 'cd /usr/src/app/java-sdk-test/ && javac Test.java && java Test') || \ + (cd /usr/src/app/java-sdk-test/ && javac Test.java && java Test) \ No newline at end of file diff --git a/README.md b/README.md index 2efb9fad..1276953a 100644 --- a/README.md +++ b/README.md @@ -210,3 +210,28 @@ More examples are available [here](https://github.com/plivo/plivo-examples-java) ## Reporting issues Report any feedback or problems with this version by [opening an issue on Github](https://github.com/plivo/plivo-java/issues). + +## Local Development +> Note: Requires latest versions of Docker & Docker-Compose. If you're on MacOS, ensure Docker Desktop is running. +1. Export the following environment variables in your host machine: +```bash +export PLIVO_AUTH_ID= +export PLIVO_AUTH_TOKEN= +export PLIVO_API_DEV_HOST= +export PLIVO_API_PROD_HOST= +``` +2. Run `make build`. This will create a docker container in which the sdk will be setup and dependencies will be installed. +> The entrypoint of the docker container will be the `setup_sdk.sh` script. The script will handle all the necessary changes required for local development. It will also package the sdk and reinstall it as a dependecy for the test program. +3. The above command will print the docker container id (and instructions to connect to it) to stdout. +4. The test code can be added to `/java-sdk-test/Test.java` in host + (or `/usr/src/app/java-sdk-test/Test.java` in container) +5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container. However, when any change is made, the dependencies for the test program need to be re-installed. To do that: + * Either restart the docker container + * Or Run the `setup_sdk.sh` script +6. To run test code, run `make run CONTAINER=` in host. +7. To run unit tests, run `make test CONTAINER=` in host. +> `` is the docker container id created in 2. +(The docker container should be running) + +> Test code and unit tests can also be run within the container using +`make run` and `make test` respectively. (`CONTAINER` argument should be omitted when running from the container) \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..32f7fe9d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' + +services: + + javaSDK: + build: + context: . + image: javasdk + container_name: javaSDK + environment: + - PLIVO_AUTH_ID=${PLIVO_AUTH_ID} + - PLIVO_AUTH_TOKEN=${PLIVO_AUTH_TOKEN} + - PLIVO_API_DEV_HOST=${PLIVO_API_DEV_HOST} + - PLIVO_API_PROD_HOST=${PLIVO_API_PROD_HOST} + volumes: + - .:/usr/src/app + stdin_open: true + tty: true \ No newline at end of file diff --git a/setup_sdk.sh b/setup_sdk.sh new file mode 100755 index 00000000..9a1cc04e --- /dev/null +++ b/setup_sdk.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +set -e +testDir="java-sdk-test" +GREEN="\033[0;32m" +NC="\033[0m" + +if [ ! $PLIVO_API_PROD_HOST ] || [ ! $PLIVO_API_DEV_HOST ] || [ ! $PLIVO_AUTH_ID ] || [ ! $PLIVO_AUTH_TOKEN ]; then + echo "Environment variables not properly set! Please refer to Local Development section in README!" + exit 126 +fi + +cd /usr/src/app + +echo "Setting plivo-api endpoint to dev..." +find /usr/src/app/src/ -type f -exec sed -i "s/$PLIVO_API_PROD_HOST/$PLIVO_API_DEV_HOST/g" {} \; + +if [[ $( grep uploadArchives build.gradle ) ]]; then + echo "Modifying build.gradle..." + sed -i '/uploadArchives/,/artifacts/{//!d}' build.gradle + sed -i '/signing {/,/}/d' build.gradle + echo "dependencies{ + compile 'com.fasterxml.jackson.core:jackson-core:2.10.1' + compile 'com.fasterxml.jackson.core:jackson-annotations:2.10.1' + compile 'com.fasterxml.jackson.core:jackson-databind:2.10.1' + }" >> build.gradle +fi +./gradlew fatJar + +mkdir -p /etc/jars +mv /usr/src/app/build/libs/*.jar /etc/jars/ + +if [ ! -d $testDir ]; then + echo "Creating test dir..." + mkdir -p $testDir +fi + +echo -e "\n\nSDK setup complete! You can test changes either on host or inside the docker container:" +echo -e "\ta. To test your changes ON HOST:" +echo -e "\t\t1. Add your test code in /$testDir/Test.java" +echo -e "\t\t2. Run your test file using: $GREEN make run CONTAINER=$HOSTNAME$NC" +echo -e "\t\t3. Run unit tests using: $GREEN make test CONTAINER=$HOSTNAME$NC" +echo +echo -e "\tb. To test your changes INSIDE CONTAINER:" +echo -e "\t\t1. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC" +echo -e "\t\t2. Add your test code in /usr/src/app/$testDir/Test.java" +echo -e "\t\t3. Run your test file using: $GREEN make run$NC" +echo -e "\t\t4. Run unit tests using: $GREEN make test$NC" + +# To keep the container running post setup +/bin/bash \ No newline at end of file From 8c7f3971b0ba341d6204a68d727db7466ba76f47 Mon Sep 17 00:00:00 2001 From: Sajal Singhal Date: Tue, 14 Mar 2023 17:42:24 +0530 Subject: [PATCH 11/17] Adding CreatedAt field in get and list brand/profile api --- .../com/plivo/api/models/brand/Brand.java | 8 +++++ .../plivo/api/models/brand/BrandResponse.java | 8 +++++ .../com/plivo/api/models/profile/Profile.java | 5 ++++ .../api/models/profile/ProfileResponse.java | 5 ++++ .../com/plivo/api/brandGetResponse.json | 3 +- .../com/plivo/api/brandListResponse.json | 30 ++++++++++++------- .../com/plivo/api/profileGetResponse.json | 3 +- .../com/plivo/api/profileListResponse.json | 30 ++++++++++++------- .../com/plivo/api/profileUpdateResponse.json | 3 +- 9 files changed, 72 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/plivo/api/models/brand/Brand.java b/src/main/java/com/plivo/api/models/brand/Brand.java index 89ef3c1e..7042cac8 100644 --- a/src/main/java/com/plivo/api/models/brand/Brand.java +++ b/src/main/java/com/plivo/api/models/brand/Brand.java @@ -17,6 +17,7 @@ public class Brand extends BaseResource { private Address address; private AuthorizedContact authorizedContact; private BrandResponse brand; + private String createdAt; public static BrandCreator creator(String brandAlias,String profileUUID,String brandType,Boolean secondaryVetting,String url,String method) { return new BrandCreator(brandAlias,profileUUID,brandType,secondaryVetting,url,method); @@ -111,6 +112,13 @@ public AuthorizedContact getAuthorizedContact() { return authorizedContact; } + /** + * @return String return the getCreatedAt + */ + public String getCreatedAt() { + return createdAt; + } + public BrandResponse getBrand() { return brand; } diff --git a/src/main/java/com/plivo/api/models/brand/BrandResponse.java b/src/main/java/com/plivo/api/models/brand/BrandResponse.java index c5057e4a..6c716ae9 100644 --- a/src/main/java/com/plivo/api/models/brand/BrandResponse.java +++ b/src/main/java/com/plivo/api/models/brand/BrandResponse.java @@ -15,6 +15,7 @@ public class BrandResponse extends BaseResource { private String registrationStatus; private String vertical; private Address address; + private String createdAt; private AuthorizedContact authorizedContact; /** @@ -76,6 +77,13 @@ public Address getAddress() { return address; } + /** + * @return String return the getCreatedAt + */ + public String getCreatedAt() { + return createdAt; + } + /** * @return String return the getAuthorizedContact */ diff --git a/src/main/java/com/plivo/api/models/profile/Profile.java b/src/main/java/com/plivo/api/models/profile/Profile.java index d5450481..44310f8c 100644 --- a/src/main/java/com/plivo/api/models/profile/Profile.java +++ b/src/main/java/com/plivo/api/models/profile/Profile.java @@ -24,6 +24,7 @@ public class Profile extends BaseResource { private String profileType; private String profileUUID; private String message; + private String createdAt; private ProfileResponse profile; @@ -119,6 +120,10 @@ public String getMessage(){ return message; } +public String getCreatedAt(){ + return createdAt; +} + public ProfileResponse getProfile() { return profile; } diff --git a/src/main/java/com/plivo/api/models/profile/ProfileResponse.java b/src/main/java/com/plivo/api/models/profile/ProfileResponse.java index 7cc95d5f..ea1c2ff3 100644 --- a/src/main/java/com/plivo/api/models/profile/ProfileResponse.java +++ b/src/main/java/com/plivo/api/models/profile/ProfileResponse.java @@ -22,6 +22,7 @@ public class ProfileResponse extends BaseResource{ private String primaryProfile; private String profileType; private String profileUUID; + private String createdAt; public String getProfileAlias(){ return profileAlias; @@ -91,6 +92,10 @@ public String getProfileUUID(){ return profileUUID; } + public String getCreatedAt(){ + return createdAt; + } + @Override public String getId() { return this.profileUUID; diff --git a/src/test/resources/com/plivo/api/brandGetResponse.json b/src/test/resources/com/plivo/api/brandGetResponse.json index 62a3ac38..216349b1 100644 --- a/src/test/resources/com/plivo/api/brandGetResponse.json +++ b/src/test/resources/com/plivo/api/brandGetResponse.json @@ -22,6 +22,7 @@ "entity_type": "INDIVIDUAL", "profile_uuid": "6e9a16c7-27ae-44b4-8b1f-e6b9b007426b", "registration_status": "COMPLETED", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/brandListResponse.json b/src/test/resources/com/plivo/api/brandListResponse.json index 46ce0e8e..31509807 100644 --- a/src/test/resources/com/plivo/api/brandListResponse.json +++ b/src/test/resources/com/plivo/api/brandListResponse.json @@ -14,7 +14,8 @@ "brand_id": "BPL3KN9", "brand_type": "STARTER", "ein_issuing_country": "US", - "registration_status": "COMPLETED" + "registration_status": "COMPLETED", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -39,7 +40,8 @@ "entity_type": "INDIVIDUAL", "profile_uuid": "55515d72-2852-4016-9ed9-c64bd1c0c055", "registration_status": "COMPLETED", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -64,7 +66,8 @@ "entity_type": "INDIVIDUAL", "profile_uuid": "71a18795-77fa-4623-9735-44bbd08d86c4", "registration_status": "COMPLETED", - "vertical": "ENTERTAINMENT" + "vertical": "ENTERTAINMENT", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -81,7 +84,8 @@ "ein_issuing_country": "IN", "profile_uuid": "d3d85b2d-a4c2-4f7b-a66f-83002a5fd5e8", "registration_status": "COMPLETED", - "vertical": "ENTERTAINMENT" + "vertical": "ENTERTAINMENT", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -100,7 +104,8 @@ "ein_issuing_country": "US", "profile_uuid": "709a4b1c-bbde-40e6-be36-164b1dc8f718", "registration_status": "COMPLETED", - "vertical": "ENTERTAINMENT" + "vertical": "ENTERTAINMENT", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -127,7 +132,8 @@ "entity_type": "PRIVATE", "profile_uuid": "a28b5892-4d8b-4098-9fe7-6f786fb0be1f", "registration_status": "COMPLETED", - "vertical": "ENTERTAINMENT" + "vertical": "ENTERTAINMENT", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -152,7 +158,8 @@ "entity_type": "GOVERNMENT", "profile_uuid": "ca01734d-a86a-4ed4-aa5a-8723cbb595b3", "registration_status": "COMPLETED", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -178,7 +185,8 @@ "profile_uuid": "c1a1c66a-2bc4-4150-a3f3-033ec41efc5d", "registration_status": "COMPLETED", "vertical": "ENTERTAINMENT", - "website": "hibye.com" + "website": "hibye.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -207,7 +215,8 @@ "registration_status": "COMPLETED", "vertical": "PROFESSIONAL", "vetting_score": 80, - "vetting_status": "ACTIVE" + "vetting_status": "ACTIVE", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -226,7 +235,8 @@ "ein_issuing_country": "nil", "profile_uuid": "f9ee4193-a8b7-49e6-aed1-2a286c7f5c4b", "registration_status": "COMPLETED", - "vertical": "nil" + "vertical": "nil", + "created_at": "2023-03-07T11:25:28.262701Z" } ], "meta": { diff --git a/src/test/resources/com/plivo/api/profileGetResponse.json b/src/test/resources/com/plivo/api/profileGetResponse.json index 66c84d02..f54aab29 100644 --- a/src/test/resources/com/plivo/api/profileGetResponse.json +++ b/src/test/resources/com/plivo/api/profileGetResponse.json @@ -14,6 +14,7 @@ "profile_type": "SECONDARY", "profile_uuid": "201faedc-7df9-4840-9ab1-3997ce3f7cf4", "stock_symbol": "ABC", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/profileListResponse.json b/src/test/resources/com/plivo/api/profileListResponse.json index bcc98c7e..376f4257 100644 --- a/src/test/resources/com/plivo/api/profileListResponse.json +++ b/src/test/resources/com/plivo/api/profileListResponse.json @@ -36,7 +36,8 @@ "stock_exchange": "NYSE", "stock_symbol": "TESLA", "vertical": "ENTERTAINMENT", - "website": "hibye.com" + "website": "hibye.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -67,7 +68,8 @@ "stock_exchange": "NYSE", "stock_symbol": "TESLA", "vertical": "ENTERTAINMENT", - "website": "hibye.com" + "website": "hibye.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -90,7 +92,8 @@ "profile_type": "SECONDARY", "profile_uuid": "21ac739e-57fa-4945-a465-0ace7d43d9f1", "vertical": "HEALTHCARE", - "website": "http://www.barkersleep.com/" + "website": "http://www.barkersleep.com/", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -120,7 +123,8 @@ "profile_uuid": "56711bac-af40-450a-b713-60cbd23ac28b", "stock_exchange": "NSE", "stock_symbol": "ABC", - "vertical": "PROFESSIONAL" + "vertical": "PROFESSIONAL", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -150,7 +154,8 @@ "profile_uuid": "287bc61b-10c2-452a-9137-4c1772292d6a", "stock_exchange": "NSE", "stock_symbol": "ABC", - "vertical": "PROFESSIONAL" + "vertical": "PROFESSIONAL", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -180,7 +185,8 @@ "stock_exchange": "NYSE", "stock_symbol": "NSE", "vertical": "TECHNOLOGY", - "website": "www.facebook.com" + "website": "www.facebook.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -210,7 +216,8 @@ "profile_uuid": "55cce8f9-2a0c-4b29-9ed5-a5f4c684e883", "stock_exchange": "NSE", "stock_symbol": "ABC", - "vertical": "PROFESSIONAL" + "vertical": "PROFESSIONAL", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -241,7 +248,8 @@ "stock_exchange": "NSE", "stock_symbol": "ABC", "vertical": "ENERGY", - "website": "www.google.com" + "website": "www.google.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -273,7 +281,8 @@ "stock_exchange": "NSE", "stock_symbol": "ABC", "vertical": "ENERGY", - "website": "www.google.com" + "website": "www.google.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -305,7 +314,8 @@ "stock_exchange": "NSE", "stock_symbol": "ABC", "vertical": "ENERGY", - "website": "www.google.com" + "website": "www.google.com", + "created_at": "2023-03-07T11:25:28.262701Z" } ] } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/profileUpdateResponse.json b/src/test/resources/com/plivo/api/profileUpdateResponse.json index 0fff2ca4..c70cfcab 100644 --- a/src/test/resources/com/plivo/api/profileUpdateResponse.json +++ b/src/test/resources/com/plivo/api/profileUpdateResponse.json @@ -27,6 +27,7 @@ "profile_type": "SECONDARY", "profile_uuid": "09322f43-fe16-4525-b8e4-4229c867795d", "vertical": "ENERGY", - "website": "www.google.com" + "website": "www.google.com", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file From ed70c3254b0f0662048f6af8b803d06ba2cd8d64 Mon Sep 17 00:00:00 2001 From: Sajal Singhal Date: Thu, 16 Mar 2023 15:51:14 +0530 Subject: [PATCH 12/17] Adding created_at field in list and get campaign details api response --- .../plivo/api/models/campaign/Campaign.java | 5 ++++ .../api/models/campaign/CampaignResponse.java | 9 ++++++ .../com/plivo/api/campaignGetResponse.json | 3 +- .../com/plivo/api/campaignListResponse.json | 30 ++++++++++++------- .../com/plivo/api/campaignUpdateResponse.json | 3 +- 5 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/plivo/api/models/campaign/Campaign.java b/src/main/java/com/plivo/api/models/campaign/Campaign.java index f8403aa8..da8608e7 100644 --- a/src/main/java/com/plivo/api/models/campaign/Campaign.java +++ b/src/main/java/com/plivo/api/models/campaign/Campaign.java @@ -25,6 +25,7 @@ public class Campaign extends BaseResource { private String sample2; private String description; private CampaignAttributes campaignAttributes; + private String createdAt; public static CampaignCreator creator(String brandID,String campaignAlias,String vertical,String usecase,String[] subUsecases,String description,Boolean embeddedLink,Boolean embeddedPhone,Boolean ageGated,Boolean directLending,Boolean affiliateMarketing,Boolean subscriberOptin,Boolean subscriberOptout,Boolean subscriberHelp,String sample1,String sample2,String url, String method, String messageFlow, String helpMessage, String optoutMessage, String optinKeywords, String optinMessage, String optoutKeywords, String helpKeywords) { @@ -150,6 +151,10 @@ public String getDescription() { return description; } + public String getCreatedAt() { + return createdAt; + } + @Override public String getId() { return this.campaignID; diff --git a/src/main/java/com/plivo/api/models/campaign/CampaignResponse.java b/src/main/java/com/plivo/api/models/campaign/CampaignResponse.java index a27696f0..c835b40a 100644 --- a/src/main/java/com/plivo/api/models/campaign/CampaignResponse.java +++ b/src/main/java/com/plivo/api/models/campaign/CampaignResponse.java @@ -22,6 +22,7 @@ public class CampaignResponse extends BaseResource{ private String sample1; private String sample2; private String description; + private String createdAt; private CampaignAttributes campaignAttributes; @@ -128,6 +129,14 @@ public CampaignAttributes getCampaignAttributes() { public String getDescription() { return description; } + + /** + * @return createdAt return the CreatedAt + */ + public String getCreatedAt() { + return createdAt; + } + @Override diff --git a/src/test/resources/com/plivo/api/campaignGetResponse.json b/src/test/resources/com/plivo/api/campaignGetResponse.json index 8c826803..6dc1fc63 100644 --- a/src/test/resources/com/plivo/api/campaignGetResponse.json +++ b/src/test/resources/com/plivo/api/campaignGetResponse.json @@ -32,6 +32,7 @@ "subscriber_optin":false, "subscriber_optout":false, "subscriber_help":false - } + }, + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/campaignListResponse.json b/src/test/resources/com/plivo/api/campaignListResponse.json index f69ef46f..4f9012a1 100644 --- a/src/test/resources/com/plivo/api/campaignListResponse.json +++ b/src/test/resources/com/plivo/api/campaignListResponse.json @@ -21,7 +21,8 @@ "registration_status": "ACTIVE", "reseller_id": "RFWG6CB", "sub_usecase": "CUSTOMER_CARE", - "usecase": "STARTER" + "usecase": "STARTER", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BNOOLMO", @@ -43,7 +44,8 @@ "registration_status": "FAILED", "reseller_id": "", "sub_usecase": "2FA,MARKETING", - "usecase": "STARTER" + "usecase": "STARTER", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BWDWMAC", @@ -65,7 +67,8 @@ "registration_status": "ACTIVE", "reseller_id": "", "sub_usecase": "2FA,MARKETING", - "usecase": "STARTER" + "usecase": "STARTER", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BCKWPKX", @@ -87,7 +90,8 @@ "registration_status": "PROCESSING", "reseller_id": "", "sub_usecase": "2FA,MARKETING", - "usecase": "MIXED" + "usecase": "MIXED", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "B2IYFNC", @@ -109,7 +113,8 @@ "registration_status": "PROCESSING", "reseller_id": "", "sub_usecase": "2FA", - "usecase": "STARTER" + "usecase": "STARTER", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BK98MJL", @@ -129,7 +134,8 @@ } }, "registration_status": "ACTIVE", - "reseller_id": "" + "reseller_id": "", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "B3WKVGC", @@ -151,7 +157,8 @@ "registration_status": "PROCESSING", "reseller_id": "RFWG6CB", "sub_usecase": "CUSTOMER_CARE", - "usecase": "STARTER" + "usecase": "STARTER", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BBYQU0Z", @@ -172,7 +179,8 @@ }, "registration_status": "PROCESSING", "reseller_id": "", - "usecase": "2FA" + "usecase": "2FA", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BBYQU0Z", @@ -193,7 +201,8 @@ }, "registration_status": "ACTIVE", "reseller_id": "", - "usecase": "2FA" + "usecase": "2FA", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BBYQU0Z", @@ -214,7 +223,8 @@ }, "registration_status": "ACTIVE", "reseller_id": "", - "usecase": "2FA" + "usecase": "2FA", + "created_at": "2023-03-07T11:25:28.262701Z" } ], "meta": { diff --git a/src/test/resources/com/plivo/api/campaignUpdateResponse.json b/src/test/resources/com/plivo/api/campaignUpdateResponse.json index 8c826803..6dc1fc63 100644 --- a/src/test/resources/com/plivo/api/campaignUpdateResponse.json +++ b/src/test/resources/com/plivo/api/campaignUpdateResponse.json @@ -32,6 +32,7 @@ "subscriber_optin":false, "subscriber_optout":false, "subscriber_help":false - } + }, + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file From a9ed26a3d3f1d2ee10f746e8ba0565d162969612 Mon Sep 17 00:00:00 2001 From: Sajal Singhal Date: Fri, 17 Mar 2023 13:07:50 +0530 Subject: [PATCH 13/17] version update --- CHANGELOG.md | 5 +++++ README.md | 2 +- pom.properties | 2 +- pom.xml | 2 +- src/main/resources/com/plivo/api/version.txt | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ef2e48..1bedaef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Change Log + +## [5.21.0](https://github.com/plivo/plivo-java/tree/v5.21.0) (2023-17-03) +- Added New Param `created_at` to the response for the [list all profiles API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-all-profiles) and the [get profile API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-a-specific-profile) and the [list all brands API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-all-brands) and the [get brand API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-a-specific-brand) +and the [list all campaigns API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-all-campaigns) and the [get campaign API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-a-specific-campaign) + ## [5.20.0](https://github.com/plivo/plivo-java/tree/v5.20.0) (2023-02-23) - Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) diff --git a/README.md b/README.md index ba7f971f..abc14df2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.20.0 + 5.21.0 ``` diff --git a/pom.properties b/pom.properties index dff0fce4..64f275fc 100644 --- a/pom.properties +++ b/pom.properties @@ -1,5 +1,5 @@ # Written manually. -version=5.20.0 +version=5.21.0 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index d30e8ce3..f98b4aca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.20.0 + 5.21.0 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index 0af471c5..b5e0460c 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.20.0 +5.21.0 From 5a7e58ebaeceadb159a234599e366d427a702ef8 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Fri, 24 Feb 2023 10:40:39 +0530 Subject: [PATCH 14/17] added new params --- .../com/plivo/api/models/recording/Recording.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/plivo/api/models/recording/Recording.java b/src/main/java/com/plivo/api/models/recording/Recording.java index 30dd7375..0c6466b4 100644 --- a/src/main/java/com/plivo/api/models/recording/Recording.java +++ b/src/main/java/com/plivo/api/models/recording/Recording.java @@ -7,6 +7,8 @@ public class Recording extends BaseResource { private String addTime; private String callUuid; private String conferenceName; + private String cost; + private String daysOfStorage; private String recordingDurationMs; private String recordingEndMs; private String recordingFormat; @@ -15,6 +17,7 @@ public class Recording extends BaseResource { private String recordingUrl; private String resourceUri; private String recordingId; + private String roundedDuration; private String fromNumber; private String toNumber; @@ -112,6 +115,18 @@ public String getRecordingUrl() { return recordingUrl; } + public String getCost() { + return cost; + } + + public String getDaysOfStorage() { + return daysOfStorage; + } + + public String getRoundedDuration() { + return roundedDuration; + } + public String getResourceUri() { return resourceUri; } From d13e26ccc2cb20ed04afbbe825a6570cf38691a9 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Mon, 27 Feb 2023 16:17:46 +0530 Subject: [PATCH 15/17] changed UTs --- .../com/plivo/api/recordingGetResponse.json | 5 ++++- .../com/plivo/api/recordingListResponse.json | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/test/resources/com/plivo/api/recordingGetResponse.json b/src/test/resources/com/plivo/api/recordingGetResponse.json index 980e4e9f..cb3898cc 100644 --- a/src/test/resources/com/plivo/api/recordingGetResponse.json +++ b/src/test/resources/com/plivo/api/recordingGetResponse.json @@ -12,5 +12,8 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } \ No newline at end of file diff --git a/src/test/resources/com/plivo/api/recordingListResponse.json b/src/test/resources/com/plivo/api/recordingListResponse.json index 0da01418..75033b41 100644 --- a/src/test/resources/com/plivo/api/recordingListResponse.json +++ b/src/test/resources/com/plivo/api/recordingListResponse.json @@ -21,7 +21,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 16:05:21.993853+05:30", @@ -36,7 +39,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 15:51:56.582492+05:30", @@ -51,7 +57,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } ] } \ No newline at end of file From 5da96b78188a05345c80cf41eca15832388c5c96 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Tue, 28 Feb 2023 01:27:06 +0530 Subject: [PATCH 16/17] Added filter --- .../plivo/api/models/recording/RecordingLister.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/plivo/api/models/recording/RecordingLister.java b/src/main/java/com/plivo/api/models/recording/RecordingLister.java index 399b694d..e0499d87 100644 --- a/src/main/java/com/plivo/api/models/recording/RecordingLister.java +++ b/src/main/java/com/plivo/api/models/recording/RecordingLister.java @@ -16,6 +16,7 @@ public class RecordingLister extends VoiceLister { private String mpcName; private String conferenceUuid; private String mpcUuid; + private String roundedDuration; private PropertyFilter addTime; public String subaccount() { @@ -54,6 +55,10 @@ public PropertyFilter addTime() { return this.addTime; } + public String roundedDuration() { + return roundedDuration; + } + /** * @param subaccount auth_id of the subaccount. Lists only those recordings of the main accounts * which are tied to the specified subaccount. @@ -127,6 +132,14 @@ public RecordingLister addTime(final PropertyFilter addTime) { return this; } + /** + * @param roundedDuration Used to filter out recordings according to their rounded duration as multiples of 60 seconds. + */ + public RecordingLister roundedDuration(final String roundedDuration) { + this.roundedDuration = roundedDuration; + return this; + } + @Override protected Call> obtainCall() { return client().getVoiceApiService().recordingList(client().getAuthId(), toMap()); From f55fcf68aa390a4c5b221fa24d573370e3b33c94 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 8 Mar 2023 14:41:30 +0530 Subject: [PATCH 17/17] Changed version updated from master --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- pom.properties | 2 +- pom.xml | 2 +- src/main/resources/com/plivo/api/version.txt | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bedaef4..c52d98bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [5.21.1](https://github.com/plivo/plivo-java/tree/v5.21.1) (2023-04-04) +- Added `monthly_recording_storage_amount`, `recording_storage_rate`, `rounded_recording_duration`, and `recording_storage_duration` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) +- Added `rounded_recording_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) + ## [5.21.0](https://github.com/plivo/plivo-java/tree/v5.21.0) (2023-17-03) - Added New Param `created_at` to the response for the [list all profiles API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-all-profiles) and the [get profile API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-a-specific-profile) and the [list all brands API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-all-brands) and the [get brand API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-a-specific-brand) and the [list all campaigns API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-all-campaigns) and the [get campaign API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-a-specific-campaign) diff --git a/README.md b/README.md index 13032f99..9b4b6b78 100644 --- a/README.md +++ b/README.md @@ -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.20.0/plivo-java-5.20.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.21.1/plivo-java-5.21.1.jar). If you are using Maven, use the following XML to include the Plivo SDK as a dependency. @@ -18,7 +18,7 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.21.0 + 5.21.1 ``` diff --git a/pom.properties b/pom.properties index 64f275fc..2a612b89 100644 --- a/pom.properties +++ b/pom.properties @@ -1,5 +1,5 @@ # Written manually. -version=5.21.0 +version=5.21.1 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index f98b4aca..7dfe3d9a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.21.0 + 5.21.1 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index b5e0460c..0d710d81 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.21.0 +5.21.1