From 00915ea8660ba842bedc254921e175d58b294c65 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Mon, 27 Feb 2023 16:40:58 +0530 Subject: [PATCH 01/21] Added new params and updated UTs --- src/Plivo/Resources/Recording/Recording.php | 5 ++++- tests/Mocks/recordingGetResponse.json | 5 ++++- tests/Mocks/recordingListResponse.json | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Plivo/Resources/Recording/Recording.php b/src/Plivo/Resources/Recording/Recording.php index b9b6a77e..b4524290 100644 --- a/src/Plivo/Resources/Recording/Recording.php +++ b/src/Plivo/Resources/Recording/Recording.php @@ -48,7 +48,10 @@ function __construct(BaseClient $client, array $response, $authId) 'recordingId' => $response['recording_id'], 'resourceUri' => $response['resource_uri'], 'fromNumber' => $response['from_number'], - 'toNumber' => $response['to_number'] + 'toNumber' => $response['to_number'], + 'cost' => $response['cost'], + 'roundedDuration' => $response['rounded_duration'], + 'daysOfStorage' => $response['days_of_storage'] ]; $this->pathParams = [ diff --git a/tests/Mocks/recordingGetResponse.json b/tests/Mocks/recordingGetResponse.json index 980e4e9f..cb3898cc 100644 --- a/tests/Mocks/recordingGetResponse.json +++ b/tests/Mocks/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/tests/Mocks/recordingListResponse.json b/tests/Mocks/recordingListResponse.json index 0da01418..75033b41 100644 --- a/tests/Mocks/recordingListResponse.json +++ b/tests/Mocks/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 7ee3162d680ba0e272d4b470eaf3e52d7c20e4bb Mon Sep 17 00:00:00 2001 From: Saksham Khandelwal Date: Tue, 28 Feb 2023 01:09:27 +0530 Subject: [PATCH 02/21] added exception handling for retrive all calls --- src/Plivo/Resources/Call/CallInterface.php | 42 ++++++++++++++-------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/Plivo/Resources/Call/CallInterface.php b/src/Plivo/Resources/Call/CallInterface.php index e0ed0ae1..2b4ea130 100644 --- a/src/Plivo/Resources/Call/CallInterface.php +++ b/src/Plivo/Resources/Call/CallInterface.php @@ -202,27 +202,28 @@ public function getQueued($queuedCallUuid) * + [string] subaccount - The id of the subaccount, if call details of the subaccount are needed. * + [string] call_direction - Filter the results by call direction. The valid inputs are inbound and outbound. * + [string] from_number - Filter the results by the number from where the call originated. For example:
- To filter out those numbers that contain a particular number sequence, use from_number={sequence}
- To filter out a number that matches an exact number, use from_number={exact_number} + * To filter out those numbers that contain a particular number sequence, use from_number={sequence}
+ * To filter out a number that matches an exact number, use from_number={exact_number} * + [string] to_number - Filter the results by the number to which the call was made. Tips to use this filter are:
- To filter out those numbers that contain a particular number sequence, use to_number={sequence}
- To filter out a number that matches an exact number, use to_number={exact_number} + * To filter out those numbers that contain a particular number sequence, use to_number={sequence}
+ * To filter out a number that matches an exact number, use to_number={exact_number} * + [string] bill_duration - Filter the results according to billed duration. The value of billed duration is in seconds. The filter can be used in one of the following five forms:
- bill_duration: Input the exact value. E.g., to filter out calls that were exactly three minutes long, use bill_duration=180
- bill_duration\__gt: gt stands for greater than. E.g., to filter out calls that were more than two hours in duration bill_duration\__gt=7200
- bill_duration\__gte: gte stands for greater than or equal to. E.g., to filter out calls that were two hours or more in duration bill_duration\__gte=7200
- bill_duration\__lt: lt stands for lesser than. E.g., to filter out calls that were less than seven minutes in duration bill_duration\__lt=420
- bill_duration\__lte: lte stands for lesser than or equal to. E.g., to filter out calls that were two hours or less in duration bill_duration\__lte=7200 + * bill_duration: Input the exact value. E.g., to filter out calls that were exactly three minutes long, use bill_duration=180
+ * bill_duration\__gt: gt stands for greater than. E.g., to filter out calls that were more than two hours in duration bill_duration\__gt=7200
+ * bill_duration\__gte: gte stands for greater than or equal to. E.g., to filter out calls that were two hours or more in duration bill_duration\__gte=7200
+ * bill_duration\__lt: lt stands for lesser than. E.g., to filter out calls that were less than seven minutes in duration bill_duration\__lt=420
+ * bill_duration\__lte: lte stands for lesser than or equal to. E.g., to filter out calls that were two hours or less in duration bill_duration\__lte=7200 * + [string] end_time - Filter out calls according to the time of completion. The filter can be used in the following five forms:
- end_time: The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended at 2012-03-21 11:47[:30], use end_time=2012-03-21 11:47[:30]
- end_time\__gt: gt stands for greater than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended after 2012-03-21 11:47, use end_time\__gt=2012-03-21 11:47
- end_time\__gte: gte stands for greater than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended after or exactly at 2012-03-21 11:47[:30], use end_time\__gte=2012-03-21 11:47[:30]
- end_time\__lt: lt stands for lesser than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended before 2012-03-21 11:47, use end_time\__lt=2012-03-21 11:47
- end_time\__lte: lte stands for lesser than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended before or exactly at 2012-03-21 11:47[:30], use end_time\__lte=2012-03-21 11:47[:30] - Note: The above filters can be combined to get calls that ended in a particular time range. The timestamps need to be UTC timestamps. + * end_time: The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended at 2012-03-21 11:47[:30], use end_time=2012-03-21 11:47[:30]
+ * end_time\__gt: gt stands for greater than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended after 2012-03-21 11:47, use end_time\__gt=2012-03-21 11:47
+ * end_time\__gte: gte stands for greater than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended after or exactly at 2012-03-21 11:47[:30], use end_time\__gte=2012-03-21 11:47[:30]
+ * end_time\__lt: lt stands for lesser than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended before 2012-03-21 11:47, use end_time\__lt=2012-03-21 11:47
+ * end_time\__lte: lte stands for lesser than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. E.g., To get all calls that ended before or exactly at 2012-03-21 11:47[:30], use end_time\__lte=2012-03-21 11:47[:30] + * Note: The above filters can be combined to get calls that ended in a particular time range. The timestamps need to be UTC timestamps. * + [int] limit - Used to display the number of results per page. The maximum number of results that can be fetched is 20. * + [int] offset - Denotes the number of value items by which the results should be offset. E.g., If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results. * @return CallList + * @throws PlivoResponseException */ public function getList(array $optionalArgs = []) { @@ -234,6 +235,17 @@ public function getList(array $optionalArgs = []) $calls = []; + $responseContents = $response->getContent(); + if ($response->getStatusCode() == 400){ + throw new PlivoResponseException( + $responseContents['error'], + 0, + null, + $response->getContent(), + $response->getStatusCode() + ); + } + foreach ($response->getContent()['objects'] as $call) { $newCall = new Call($this->client, $call, $this->pathParams['authId'], $call['call_uuid']); From 42afe0556aef693102a1e7bfea7d83ab44532006 Mon Sep 17 00:00:00 2001 From: Saksham Khandelwal Date: Tue, 28 Feb 2023 09:49:31 +0530 Subject: [PATCH 03/21] changed error condition --- src/Plivo/Resources/Call/CallInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plivo/Resources/Call/CallInterface.php b/src/Plivo/Resources/Call/CallInterface.php index 2b4ea130..b897bfd2 100644 --- a/src/Plivo/Resources/Call/CallInterface.php +++ b/src/Plivo/Resources/Call/CallInterface.php @@ -236,7 +236,7 @@ public function getList(array $optionalArgs = []) $calls = []; $responseContents = $response->getContent(); - if ($response->getStatusCode() == 400){ + if(array_key_exists("error",$responseContents)){ throw new PlivoResponseException( $responseContents['error'], 0, From eec918ddc2d5ba2b5d638ed8c010fe010e5ed8ee Mon Sep 17 00:00:00 2001 From: Saksham Khandelwal Date: Tue, 28 Feb 2023 17:47:56 +0530 Subject: [PATCH 04/21] version update --- CHANGELOG.md | 3 +++ src/Plivo/Version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4394e226..28347b01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## [4.43.0](https://github.com/plivo/plivo-php/tree/v4.43.0) (2023-02-28) +-Added Exception handling for Retrieve all Calls API [Retrieve details of all calls](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls) + ## [4.42.0](https://github.com/plivo/plivo-php/tree/v4.42.0) (2023-02-27) **Feature - Enhance MDR filtering capabilities ** - Added new fields on MDR object response diff --git a/src/Plivo/Version.php b/src/Plivo/Version.php index d0552aac..6d6e996f 100644 --- a/src/Plivo/Version.php +++ b/src/Plivo/Version.php @@ -20,7 +20,7 @@ class Version /** * @const int PHP helper library minor version number */ - const MINOR = 42; + const MINOR = 43; /** * @const int PHP helper library patch number From 90d9c85881c08488e90d5de0a4a165140545535d Mon Sep 17 00:00:00 2001 From: Saksham Khandelwal Date: Tue, 28 Feb 2023 18:05:38 +0530 Subject: [PATCH 05/21] version update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28347b01..fdd9c7cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Change Log -## [4.43.0](https://github.com/plivo/plivo-php/tree/v4.43.0) (2023-02-28) +## [4.42.1](https://github.com/plivo/plivo-php/tree/v4.42.1) (2023-02-28) -Added Exception handling for Retrieve all Calls API [Retrieve details of all calls](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls) ## [4.42.0](https://github.com/plivo/plivo-php/tree/v4.42.0) (2023-02-27) From a840dba36ea42beaad38336b9ae63f27083b9042 Mon Sep 17 00:00:00 2001 From: Saksham Khandelwal Date: Tue, 28 Feb 2023 18:09:03 +0530 Subject: [PATCH 06/21] patch version update --- src/Plivo/Version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plivo/Version.php b/src/Plivo/Version.php index 6d6e996f..41629c40 100644 --- a/src/Plivo/Version.php +++ b/src/Plivo/Version.php @@ -20,12 +20,12 @@ class Version /** * @const int PHP helper library minor version number */ - const MINOR = 43; + const MINOR = 42; /** * @const int PHP helper library patch number */ - const PATCH = 0; + const PATCH = 1; /** * @return string */ From 22388b1ce19619ddb3748e6be7107a64189b283e Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Wed, 22 Feb 2023 22:41:17 +0530 Subject: [PATCH 07/21] SMS-4946/SMS-4848: Add Is Domestic to Get and List Messages --- CHANGELOG.md | 3 ++ src/Plivo/Resources/Message/Message.php | 4 ++ src/Plivo/Version.php | 2 +- tests/Mocks/messageGetResponse.json | 3 +- tests/Mocks/messageListResponse.json | 60 ++++++++++++++++--------- 5 files changed, 50 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdd9c7cd..f336f212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## [v4.43.0](https://github.com/plivo/plivo-php/tree/v4.43.0) (2023-03-03) +- 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) + ## [4.42.1](https://github.com/plivo/plivo-php/tree/v4.42.1) (2023-02-28) -Added Exception handling for Retrieve all Calls API [Retrieve details of all calls](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls) diff --git a/src/Plivo/Resources/Message/Message.php b/src/Plivo/Resources/Message/Message.php index 1618291b..4643144d 100644 --- a/src/Plivo/Resources/Message/Message.php +++ b/src/Plivo/Resources/Message/Message.php @@ -23,6 +23,7 @@ * @property ?string $errorCode * @property ?string $powerpackID * @property ?string $requesterIP + * @property ?bool $isDomestic */ class Message extends Resource { @@ -72,6 +73,9 @@ public function __construct( } if (!empty($response['tendlc_registration_status'])) { $this->properties['tendlc_registration_status'] = $response['tendlc_registration_status']; + + if (isset($response['is_domestic'])){ + $this->properties['isDomestic'] = $response['is_domestic']; } $this->pathParams = [ diff --git a/src/Plivo/Version.php b/src/Plivo/Version.php index 41629c40..68bc3c94 100644 --- a/src/Plivo/Version.php +++ b/src/Plivo/Version.php @@ -20,7 +20,7 @@ class Version /** * @const int PHP helper library minor version number */ - const MINOR = 42; + const MINOR = 43; /** * @const int PHP helper library patch number diff --git a/tests/Mocks/messageGetResponse.json b/tests/Mocks/messageGetResponse.json index 27397f75..02f3daea 100644 --- a/tests/Mocks/messageGetResponse.json +++ b/tests/Mocks/messageGetResponse.json @@ -13,5 +13,6 @@ "total_rate": "0.00250", "units": 1, "powerpack_id": "15c01cc2-4b9f-4d3b-bd15-3c4b38984cc4", - "requester_ip": "192.168.1.1" + "requester_ip": "192.168.1.1", + "is_domestic": false } \ No newline at end of file diff --git a/tests/Mocks/messageListResponse.json b/tests/Mocks/messageListResponse.json index cd0814bf..b0edf244 100644 --- a/tests/Mocks/messageListResponse.json +++ b/tests/Mocks/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 cadeb05a43270a1155f31619f977fdec15d1d297 Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Fri, 3 Mar 2023 18:06:14 +0530 Subject: [PATCH 08/21] typo fix --- src/Plivo/Resources/Message/Message.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Plivo/Resources/Message/Message.php b/src/Plivo/Resources/Message/Message.php index 4643144d..5b5a202b 100644 --- a/src/Plivo/Resources/Message/Message.php +++ b/src/Plivo/Resources/Message/Message.php @@ -71,9 +71,11 @@ public function __construct( if (!empty($response['tendlc_campaign_id'])) { $this->properties['tendlc_campaign_id'] = $response['tendlc_campaign_id']; } + if (!empty($response['tendlc_registration_status'])) { $this->properties['tendlc_registration_status'] = $response['tendlc_registration_status']; - + } + if (isset($response['is_domestic'])){ $this->properties['isDomestic'] = $response['is_domestic']; } From a3fdd33e17433e3c9290f9a41985009ffb9cc199 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Mon, 27 Feb 2023 16:40:58 +0530 Subject: [PATCH 09/21] Added new params and updated UTs --- src/Plivo/Resources/Recording/Recording.php | 5 ++++- tests/Mocks/recordingGetResponse.json | 5 ++++- tests/Mocks/recordingListResponse.json | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Plivo/Resources/Recording/Recording.php b/src/Plivo/Resources/Recording/Recording.php index b9b6a77e..b4524290 100644 --- a/src/Plivo/Resources/Recording/Recording.php +++ b/src/Plivo/Resources/Recording/Recording.php @@ -48,7 +48,10 @@ function __construct(BaseClient $client, array $response, $authId) 'recordingId' => $response['recording_id'], 'resourceUri' => $response['resource_uri'], 'fromNumber' => $response['from_number'], - 'toNumber' => $response['to_number'] + 'toNumber' => $response['to_number'], + 'cost' => $response['cost'], + 'roundedDuration' => $response['rounded_duration'], + 'daysOfStorage' => $response['days_of_storage'] ]; $this->pathParams = [ diff --git a/tests/Mocks/recordingGetResponse.json b/tests/Mocks/recordingGetResponse.json index 980e4e9f..cb3898cc 100644 --- a/tests/Mocks/recordingGetResponse.json +++ b/tests/Mocks/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/tests/Mocks/recordingListResponse.json b/tests/Mocks/recordingListResponse.json index 0da01418..75033b41 100644 --- a/tests/Mocks/recordingListResponse.json +++ b/tests/Mocks/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 e1c77a30eadabe2fb96ecae6ca5b954666dfaab4 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 8 Mar 2023 16:42:47 +0530 Subject: [PATCH 10/21] updated changelog and version --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f336f212..2201b514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [4.43.1](https://github.com/plivo/plivo-java/tree/v4.43.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) + ## [v4.43.0](https://github.com/plivo/plivo-php/tree/v4.43.0) (2023-03-03) - 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) From 58b0b7302994f11e9cf2df6bdd30ba046e613c28 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Thu, 9 Mar 2023 13:52:20 +0530 Subject: [PATCH 11/21] local docker enhancement --- Dockerfile | 2 +- Makefile | 9 ++++++++- README.md | 9 +++++++-- setup_sdk.sh | 23 +++++++++++++---------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca6aaba1..e8c02df7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM php:7.3-alpine -RUN apk update && apk add git vim bash curl +RUN apk update && apk add git vim bash curl make # Install composer RUN curl -sS https://getcomposer.org/installer | php diff --git a/Makefile b/Makefile index afa88995..bdd7ba6f 100644 --- a/Makefile +++ b/Makefile @@ -4,4 +4,11 @@ build: docker-compose up --build --remove-orphans test: - docker exec -it $$CONTAINER /bin/bash -c "/usr/src/app/vendor/bin/phpunit --verbose tests" \ No newline at end of file + @[ "${CONTAINER}" ] && \ + docker exec -it $$CONTAINER /bin/bash -c "/usr/src/app/vendor/bin/phpunit --verbose tests" || \ + /usr/src/app/vendor/bin/phpunit --verbose tests + +run: + @[ "${CONTAINER}" ] && \ + (docker exec -it $$CONTAINER /bin/bash -c 'cd /usr/src/app/php-sdk-test/ && php test.php') || \ + (cd /usr/src/app/php-sdk-test/ && php test.php) \ No newline at end of file diff --git a/README.md b/README.md index 249d60fd..545092c7 100644 --- a/README.md +++ b/README.md @@ -243,5 +243,10 @@ export PLIVO_API_PROD_HOST= > To use the local code in the test file, import the sdk in test file using: `require /usr/src/app/vendor/autoload.php` (Local sdk code will be mounted at `/usr/src/app` inside the container and `vendor` directory will be created by setup script while installing dependencies). -6. To run unit tests, run `make test CONTAINER=` in host, where `` is the docker container id created in 2. -(The docker container should be running) \ No newline at end of file +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/setup_sdk.sh b/setup_sdk.sh index 48e215aa..6a030566 100755 --- a/setup_sdk.sh +++ b/setup_sdk.sh @@ -33,14 +33,17 @@ if [ ! -f $testDir/test.php ]; then cd - fi -echo -e "\n\nSDK setup complete!" -echo "To test your changes:" -echo -e "\t1. Add your test code in /$testDir/test.php on host (or /usr/src/app/$testDir/test.php in the container)" -echo -e "\t\tNote: To use sdk in test file, import using $GREEN require '/usr/src/app/vendor/autoload.php';$NC" -echo -e "\t2. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC" -echo -e "\t3. Navigate to the test directory: $GREEN cd /usr/src/app/$testDir$NC" -echo -e "\t4. Run your test file: $GREEN php test.php$NC" -echo -e "\t5. For running unit tests, run on host: $GREEN make test CONTAINER=$HOSTNAME$NC" - -# To keep the container running post setup +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.php" +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.php" +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 6d0b4c7583663d8bf53d52a412ad0b95cb5cd781 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Thu, 16 Mar 2023 16:17:59 +0530 Subject: [PATCH 12/21] Fix make test command --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bdd7ba6f..3dc93e32 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ build: test: @[ "${CONTAINER}" ] && \ - docker exec -it $$CONTAINER /bin/bash -c "/usr/src/app/vendor/bin/phpunit --verbose tests" || \ - /usr/src/app/vendor/bin/phpunit --verbose tests + docker exec -it $$CONTAINER /bin/bash -c "/usr/src/app/vendor/bin/phpunit --verbose --bootstrap tests/bootstrap.php --testsuite resources-tests tests" || \ + /usr/src/app/vendor/bin/phpunit --verbose --bootstrap tests/bootstrap.php --testsuite resources-tests tests run: @[ "${CONTAINER}" ] && \ From 75e54964f31477b86491ae366a40f92397e148e6 Mon Sep 17 00:00:00 2001 From: narayana Date: Thu, 23 Mar 2023 18:56:24 +0530 Subject: [PATCH 13/21] deprecated null to string assignment fix --- src/Plivo/Http/PlivoResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plivo/Http/PlivoResponse.php b/src/Plivo/Http/PlivoResponse.php index 4d4d061b..613d2e41 100644 --- a/src/Plivo/Http/PlivoResponse.php +++ b/src/Plivo/Http/PlivoResponse.php @@ -74,7 +74,7 @@ public function makeException() // make exception based on the status code $this->thrownException = new PlivoResponseException( - null, null, null, + "", 0, null, $this->decodedContent, $this->statusCode); echo $this->thrownException->getMessage(); From 1d50ac8f12abc82d071d4de90cab9770cbec2ef2 Mon Sep 17 00:00:00 2001 From: narayana Date: Fri, 24 Mar 2023 11:28:26 +0530 Subject: [PATCH 14/21] typo fix --- src/Plivo/Resources/Brand/BrandInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plivo/Resources/Brand/BrandInterface.php b/src/Plivo/Resources/Brand/BrandInterface.php index e20fe145..ea24f028 100644 --- a/src/Plivo/Resources/Brand/BrandInterface.php +++ b/src/Plivo/Resources/Brand/BrandInterface.php @@ -93,7 +93,7 @@ public function create($brand_alias,$profile_uuid,$brand_type,$secondary_vetting 'brand_alias' => $brand_alias, 'profile_uuid' => $profile_uuid, 'brand_type' => $brand_type, - 'esecondary_vettingin' => $secondary_vetting + 'secondary_vetting' => $secondary_vetting ]; $response = $this->client->update( $this->uri .'10dlc/Brand/', From 5fa372a4e9c633ba7d6eceacff1aa955c027e703 Mon Sep 17 00:00:00 2001 From: narayana Date: Fri, 24 Mar 2023 11:36:40 +0530 Subject: [PATCH 15/21] fix mandatory param typo --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f336f212..3a3e758d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## [v4.43.1](https://github.com/plivo/plivo-php/tree/v4.43.1) (2023-03-24) +- Fix brand registration create api param + ## [v4.43.0](https://github.com/plivo/plivo-php/tree/v4.43.0) (2023-03-03) - 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) From e876020c09da814080222e6d664b5c911b3433cb Mon Sep 17 00:00:00 2001 From: narayana Date: Fri, 24 Mar 2023 11:42:06 +0530 Subject: [PATCH 16/21] fix UT build --- .github/workflows/unitTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index 8a034e8b..69ca5a8c 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -23,3 +23,4 @@ jobs: with: php_version: ${{ matrix.php-version }} configuration: tests/phpunit.xml + version: 9.5.28 From 9de873b22eb5c2d2103bc9379635afd10ebdb99d Mon Sep 17 00:00:00 2001 From: narayana Date: Fri, 24 Mar 2023 11:47:39 +0530 Subject: [PATCH 17/21] UT fix --- tests/Mocks/messageGetResponse.json | 3 +- tests/Mocks/messageListResponse.json | 60 ++++++++++++++++++---------- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/tests/Mocks/messageGetResponse.json b/tests/Mocks/messageGetResponse.json index 02f3daea..b477f0cc 100644 --- a/tests/Mocks/messageGetResponse.json +++ b/tests/Mocks/messageGetResponse.json @@ -14,5 +14,6 @@ "units": 1, "powerpack_id": "15c01cc2-4b9f-4d3b-bd15-3c4b38984cc4", "requester_ip": "192.168.1.1", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" } \ No newline at end of file diff --git a/tests/Mocks/messageListResponse.json b/tests/Mocks/messageListResponse.json index b0edf244..6a0b535d 100644 --- a/tests/Mocks/messageListResponse.json +++ b/tests/Mocks/messageListResponse.json @@ -21,7 +21,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.1", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -37,7 +38,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.2", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -53,7 +55,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.3", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -69,7 +72,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.4", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -85,7 +89,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.5", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -101,7 +106,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.6", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -117,7 +123,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.7", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -133,7 +140,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.8", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -149,7 +157,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.9", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -165,7 +174,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.10", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -181,7 +191,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.11", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -197,7 +208,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.12", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -213,7 +225,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.13", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -229,7 +242,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.14", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -245,7 +259,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.15", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": null, @@ -261,7 +276,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.16", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -277,7 +293,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.17", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -293,7 +310,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.18", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -309,7 +327,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.19", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" }, { "error_code": "000", @@ -325,7 +344,8 @@ "total_rate": "0.00250", "units": 1, "requester_ip": "192.168.1.20", - "is_domestic": false + "is_domestic": false, + "destination_country_iso2": "IN" } ] } \ No newline at end of file From 3c1f68d3d8902d780e5b28b8e3889575089099f7 Mon Sep 17 00:00:00 2001 From: Sajal Singhal Date: Fri, 17 Mar 2023 13:57:46 +0530 Subject: [PATCH 18/21] version update for created_at field in list, get brand, campaign, profile api response --- CHANGELOG.md | 4 ++++ src/Plivo/Version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a3e758d..8c1cf149 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log + +## [4.44.0](https://github.com/plivo/plivo-php/tree/v4.44.0) (2023-24-03) +- Added New Param `created_at` to the response of the [list all profiles API], [get profile API], [list all brands API], [get brand API], [list all campaigns API] and the [get campaign API] + ## [v4.43.1](https://github.com/plivo/plivo-php/tree/v4.43.1) (2023-03-24) - Fix brand registration create api param diff --git a/src/Plivo/Version.php b/src/Plivo/Version.php index 68bc3c94..b6a549e1 100644 --- a/src/Plivo/Version.php +++ b/src/Plivo/Version.php @@ -20,7 +20,7 @@ class Version /** * @const int PHP helper library minor version number */ - const MINOR = 43; + const MINOR = 44; /** * @const int PHP helper library patch number From 48282ed13e6d30d5e99a019b950183d4d1b32838 Mon Sep 17 00:00:00 2001 From: Sajal Singhal Date: Mon, 20 Mar 2023 11:28:54 +0530 Subject: [PATCH 19/21] Adding created_at field in mocks --- tests/Mocks/brandGetResponse.json | 3 ++- tests/Mocks/brandListResponse.json | 30 ++++++++++++++++--------- tests/Mocks/campaignGetResponse.json | 3 ++- tests/Mocks/campaignListResponse.json | 30 ++++++++++++++++--------- tests/Mocks/campaignUpdateResponse.json | 3 ++- tests/Mocks/profileGetResponse.json | 3 ++- tests/Mocks/profileListResponse.json | 6 +++-- tests/Mocks/profileUpdateResponse.json | 3 ++- 8 files changed, 54 insertions(+), 27 deletions(-) diff --git a/tests/Mocks/brandGetResponse.json b/tests/Mocks/brandGetResponse.json index c7ac5140..6cc531a6 100644 --- a/tests/Mocks/brandGetResponse.json +++ b/tests/Mocks/brandGetResponse.json @@ -22,6 +22,7 @@ "brand_type": "STARTER", "profile_uuid": "3cf3e991-2f94-4910-9712-61442987a2d0", "registration_status": "COMPLETED", - "vertical": "ENTERTAINMENT" + "vertical": "ENTERTAINMENT", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/tests/Mocks/brandListResponse.json b/tests/Mocks/brandListResponse.json index c6df9b58..2ae6cdec 100644 --- a/tests/Mocks/brandListResponse.json +++ b/tests/Mocks/brandListResponse.json @@ -21,7 +21,8 @@ "vertical": "COMMUNICATION", "vetting_score": 80, "vetting_status": "ACTIVE", - "website": "www.renold.com" + "website": "www.renold.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -43,7 +44,8 @@ "vertical": "COMMUNICATION", "vetting_score": 80, "vetting_status": "ACTIVE", - "website": "www.standard1.com" + "website": "www.standard1.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -64,7 +66,8 @@ "registration_status": "COMPLETED", "vertical": "ENERGY", "vetting_score": 80, - "vetting_status": "ACTIVE" + "vetting_status": "ACTIVE", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -80,7 +83,8 @@ "ein_issuing_country": "US", "entity_type": "INDIVIDUAL", "brand_type": "STARTER", - "registration_status": "COMPLETED" + "registration_status": "COMPLETED", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -102,7 +106,8 @@ "vertical": "ENTERTAINMENT", "vetting_score": 80, "vetting_status": "ACTIVE", - "website": "http://www.automation.com" + "website": "http://www.automation.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -131,7 +136,8 @@ "registration_status": "COMPLETED", "vertical": "ENERGY", "vetting_score": 80, - "vetting_status": "ACTIVE" + "vetting_status": "ACTIVE", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -153,7 +159,8 @@ "vertical": "RETAIL", "vetting_score": 80, "vetting_status": "ACTIVE", - "website": "http://www.abcmobile.com" + "website": "http://www.abcmobile.com", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -178,7 +185,8 @@ "brand_type": "STARTER", "profile_uuid": "55515d72-2852-4016-9ed9-c64bd1c0c055", "registration_status": "COMPLETED", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -196,7 +204,8 @@ "brand_type": "STARTER", "profile_uuid": "3db43f63-270f-4d55-a591-27f7dc19b8e7", "registration_status": "COMPLETED", - "vertical": "PROFESSIONAL" + "vertical": "PROFESSIONAL", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "address": { @@ -218,7 +227,8 @@ "registration_status": "COMPLETED", "vertical": "PROFESSIONAL", "vetting_score": 80, - "vetting_status": "ACTIVE" + "vetting_status": "ACTIVE", + "created_at": "2023-03-07T11:25:28.262701Z" } ], "meta": { diff --git a/tests/Mocks/campaignGetResponse.json b/tests/Mocks/campaignGetResponse.json index a9c799bd..3d93811b 100644 --- a/tests/Mocks/campaignGetResponse.json +++ b/tests/Mocks/campaignGetResponse.json @@ -20,6 +20,7 @@ "registration_status": "PROCESSING", "reseller_id": "RPDPPUM", "sub_usecase": "2FA,ACCOUNT_NOTIFICATION", - "usecase": "ACCOUNT_NOTIFICATION" + "usecase": "ACCOUNT_NOTIFICATION", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/tests/Mocks/campaignListResponse.json b/tests/Mocks/campaignListResponse.json index 04029802..ee6ed6e6 100644 --- a/tests/Mocks/campaignListResponse.json +++ b/tests/Mocks/campaignListResponse.json @@ -20,7 +20,8 @@ }, "registration_status": "PROCESSING", "reseller_id": "", - "usecase": "MARKETING" + "usecase": "MARKETING", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BHYYNCK", @@ -42,7 +43,8 @@ "registration_status": "PROCESSING", "reseller_id": "RPDPPUM", "sub_usecase": "2FA,ACCOUNT_NOTIFICATION", - "usecase": "ACCOUNT_NOTIFICATION" + "usecase": "ACCOUNT_NOTIFICATION", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BHYYNCK", @@ -64,7 +66,8 @@ "registration_status": "ACTIVE", "reseller_id": "RPDPPUM", "sub_usecase": "2FA,ACCOUNT_NOTIFICATION", - "usecase": "ACCOUNT_NOTIFICATION" + "usecase": "ACCOUNT_NOTIFICATION", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BHYYNCK", @@ -86,7 +89,8 @@ "registration_status": "PROCESSING", "reseller_id": "RPDPPUM", "sub_usecase": "2FA,ACCOUNT_NOTIFICATION", - "usecase": "ACCOUNT_NOTIFICATION" + "usecase": "ACCOUNT_NOTIFICATION", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BJ6EHHH", @@ -108,7 +112,8 @@ "registration_status": "PROCESSING", "reseller_id": "", "sub_usecase": "2FA,CUSTOMER_CARE,ACCOUNT_NOTIFICATION,DELIVERY_NOTIFICATION,MARKETING", - "usecase": "SOLE_PROPRIETOR" + "usecase": "SOLE_PROPRIETOR", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BMIORKY", @@ -129,7 +134,8 @@ }, "registration_status": "PROCESSING", "reseller_id": "", - "usecase": "2FA" + "usecase": "2FA", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BFJRJUN", @@ -151,7 +157,8 @@ "registration_status": "PROCESSING", "reseller_id": "", "sub_usecase": "CUSTOMER_CARE,2FA", - "usecase": "MIXED" + "usecase": "MIXED", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BHYYNCK", @@ -174,7 +181,8 @@ "registration_status": "ACTIVE", "reseller_id": "", "sub_usecase": "2FA,DELIVERY_NOTIFICATION", - "usecase": "MIXED" + "usecase": "MIXED", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BHYYNCK", @@ -196,7 +204,8 @@ "registration_status": "PROCESSING", "reseller_id": "", "sub_usecase": "2FA", - "usecase": "2FA" + "usecase": "2FA", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "brand_id": "BHYYNCK", @@ -217,7 +226,8 @@ }, "registration_status": "PROCESSING", "reseller_id": "", - "usecase": "MARKETING" + "usecase": "MARKETING", + "created_at": "2023-03-07T11:25:28.262701Z" } ], "meta": { diff --git a/tests/Mocks/campaignUpdateResponse.json b/tests/Mocks/campaignUpdateResponse.json index 0cce0d3a..216a1766 100644 --- a/tests/Mocks/campaignUpdateResponse.json +++ b/tests/Mocks/campaignUpdateResponse.json @@ -35,6 +35,7 @@ }, "message_flow": "message flow", "help_message": "help message", - "help_keywords": "HELP UPDATE" + "help_keywords": "HELP UPDATE", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/tests/Mocks/profileGetResponse.json b/tests/Mocks/profileGetResponse.json index 0b43893d..0b9c9108 100644 --- a/tests/Mocks/profileGetResponse.json +++ b/tests/Mocks/profileGetResponse.json @@ -14,6 +14,7 @@ "profile_type": "SECONDARY", "profile_uuid": "06ecae31-4bf8-40b9-ac62-e902418e9935", "stock_symbol": "ABC", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file diff --git a/tests/Mocks/profileListResponse.json b/tests/Mocks/profileListResponse.json index a7dac53b..9308efce 100644 --- a/tests/Mocks/profileListResponse.json +++ b/tests/Mocks/profileListResponse.json @@ -20,7 +20,8 @@ "profile_type": "SECONDARY", "profile_uuid": "1c41faed-a38e-42a3-a966-fe7df34b51b9", "stock_symbol": "ABC", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" }, { "alt_business_id_type": "NONE", @@ -38,7 +39,8 @@ "profile_type": "SECONDARY", "profile_uuid": "1d77a5fe-bca4-4a6d-a7c4-58b70e8cd7a2", "stock_symbol": "ABC", - "vertical": "ENERGY" + "vertical": "ENERGY", + "created_at": "2023-03-07T11:25:28.262701Z" } ] } \ No newline at end of file diff --git a/tests/Mocks/profileUpdateResponse.json b/tests/Mocks/profileUpdateResponse.json index 9eddae30..7222f4c6 100644 --- a/tests/Mocks/profileUpdateResponse.json +++ b/tests/Mocks/profileUpdateResponse.json @@ -19,6 +19,7 @@ "profile_uuid": "1c41faed-a38e-42a3-a966-fe7df34b51b9", "stock_symbol": "ABC", "vertical": "PROFESSIONAL", - "website": "google.com" + "website": "google.com", + "created_at": "2023-03-07T11:25:28.262701Z" } } \ No newline at end of file From 180545ad335fea2541589c09cb496144eadbbc5c Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Mon, 27 Feb 2023 16:40:58 +0530 Subject: [PATCH 20/21] Added new params and updated UTs --- src/Plivo/Resources/Recording/Recording.php | 5 ++++- tests/Mocks/recordingGetResponse.json | 5 ++++- tests/Mocks/recordingListResponse.json | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Plivo/Resources/Recording/Recording.php b/src/Plivo/Resources/Recording/Recording.php index b9b6a77e..b4524290 100644 --- a/src/Plivo/Resources/Recording/Recording.php +++ b/src/Plivo/Resources/Recording/Recording.php @@ -48,7 +48,10 @@ function __construct(BaseClient $client, array $response, $authId) 'recordingId' => $response['recording_id'], 'resourceUri' => $response['resource_uri'], 'fromNumber' => $response['from_number'], - 'toNumber' => $response['to_number'] + 'toNumber' => $response['to_number'], + 'cost' => $response['cost'], + 'roundedDuration' => $response['rounded_duration'], + 'daysOfStorage' => $response['days_of_storage'] ]; $this->pathParams = [ diff --git a/tests/Mocks/recordingGetResponse.json b/tests/Mocks/recordingGetResponse.json index 980e4e9f..cb3898cc 100644 --- a/tests/Mocks/recordingGetResponse.json +++ b/tests/Mocks/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/tests/Mocks/recordingListResponse.json b/tests/Mocks/recordingListResponse.json index 0da01418..75033b41 100644 --- a/tests/Mocks/recordingListResponse.json +++ b/tests/Mocks/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 cd12942007081ca0120b1648207eca84b9de2f6e Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 8 Mar 2023 16:42:47 +0530 Subject: [PATCH 21/21] updated changelog and version merged from master --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c1cf149..1f649f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## [4.44.1](https://github.com/plivo/plivo-php/tree/v4.44.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 `recording_storage_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) ## [4.44.0](https://github.com/plivo/plivo-php/tree/v4.44.0) (2023-24-03) - Added New Param `created_at` to the response of the [list all profiles API], [get profile API], [list all brands API], [get brand API], [list all campaigns API] and the [get campaign API]