diff --git a/src/Plivo/Resources/Message/Message.php b/src/Plivo/Resources/Message/Message.php index bd8d6b5a..2c35a51b 100644 --- a/src/Plivo/Resources/Message/Message.php +++ b/src/Plivo/Resources/Message/Message.php @@ -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 { @@ -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, diff --git a/tests/Mocks/messageGetResponse.json b/tests/Mocks/messageGetResponse.json index b6e31eaa..a3c14023 100644 --- a/tests/Mocks/messageGetResponse.json +++ b/tests/Mocks/messageGetResponse.json @@ -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": "" } \ No newline at end of file diff --git a/tests/Mocks/messageListResponse.json b/tests/Mocks/messageListResponse.json index a79e8e22..70e588d2 100644 --- a/tests/Mocks/messageListResponse.json +++ b/tests/Mocks/messageListResponse.json @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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", @@ -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, @@ -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", @@ -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, @@ -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", @@ -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, @@ -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", @@ -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, @@ -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", @@ -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", @@ -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", @@ -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", @@ -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": "" } ] } \ No newline at end of file