Skip to content

Commit

Permalink
adding more attribute to message object (#347)
Browse files Browse the repository at this point in the history
* adding more attribute to message object

* version upgrade
  • Loading branch information
narayana-plivo authored Sep 6, 2024
1 parent dd07647 commit 0c13447
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change Log
## [4.65.3](https://github.com/plivo/plivo-php/tree/v4.65.3)(2024-09-06)
**Feature - Adding more attribute on mdr object**
- Added `message_sent_time`, `message_updated_time` and `error-message` on get and list Message API

## [4.65.2](https://github.com/plivo/plivo-php/tree/v4.65.2)(2024-09-06)
**Feature - Adding support for brand_name,app_hash ,code_length in Create,Get and List Session**
- Added new request param `brand_name`, `code_length` and `app_hash` in create Session API
Expand Down
12 changes: 12 additions & 0 deletions src/Plivo/Resources/Message/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
* @property ?string $conversationExpirationTimestamp
* @property ?bool $isDomestic
* @property ?string $log
* @property ?string $message_sent_time
* @property ?string $message_updated_time
* @property ?string $error_message
*/
class Message extends Resource
{
Expand Down Expand Up @@ -121,6 +124,15 @@ public function __construct(
if (!empty($response['log'])) {
$this->properties['log'] = $response['log'];
}
if (!empty($response['message_sent_time'])) {
$this->properties['message_sent_time'] = $response['message_sent_time'];
}
if (!empty($response['message_updated_time'])) {
$this->properties['message_updated_time'] = $response['message_updated_time'];
}
if (!empty($response['error_message'])) {
$this->properties['error_message'] = $response['error_message'];
}

$this->pathParams = [
'authId' => $authId,
Expand Down
3 changes: 2 additions & 1 deletion src/Plivo/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class Version
* @const int PHP helper library patch number
*/

const PATCH = 2;
const PATCH = 3;

/**
* @return string
*/
Expand Down
5 changes: 4 additions & 1 deletion tests/Mocks/messageGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"conversation_expiration_timestamp": "2023-08-03 23:02:00+05:30",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
}
100 changes: 80 additions & 20 deletions tests/Mocks/messageListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
"conversation_expiration_timestamp": "2023-08-03 23:02:00+05:30",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -59,7 +62,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -86,7 +92,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -113,7 +122,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -140,7 +152,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -167,7 +182,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -194,7 +212,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -221,7 +242,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -248,7 +272,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -275,7 +302,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -302,7 +332,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -329,7 +362,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -356,7 +392,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -383,7 +422,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -410,7 +452,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": null,
Expand All @@ -437,7 +482,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -464,7 +512,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -491,7 +542,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -518,7 +572,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
},
{
"error_code": "000",
Expand All @@ -545,7 +602,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "Verizon",
"carrier_fees_rate": "0.420",
"carrier_fees": "0.001"
"carrier_fees": "0.001",
"message_sent_time": "2024-08-21 18:28:49.244057+05:30",
"message_updated_time": "2024-08-21 18:28:51.94772+05:30",
"error_message": ""
}
]
}

0 comments on commit 0c13447

Please sign in to comment.