Skip to content

Commit

Permalink
add more attribute on message object (#212)
Browse files Browse the repository at this point in the history
* add more attribute on message object

* verison update
  • Loading branch information
narayana-plivo authored Sep 6, 2024
1 parent b7dcbbb commit 726868c
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Change Log
## [7.51.3](https://github.com/plivo/plivo-go/tree/v7.53.0) (2024-09-06)
**Feature - Adding support for Locale param in Create, Get and List Session**
- Enhance message object
- Added new object param on get and list mdr response: `message_sent_time`, `message_updated_time`, `error_message`

## [7.51.2](https://github.com/plivo/plivo-go/tree/v7.51.2) (2024-09-06)
**Feature - Adding support for brand_name, code_length and app_hash in Create,Get and List Session**
- Added new request param `brand_name`, `code_length` and `app_hash` in create Session API
Expand Down
2 changes: 1 addition & 1 deletion baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/google/go-querystring/query"
)

const sdkVersion = "7.51.2"
const sdkVersion = "7.51.3"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
6 changes: 4 additions & 2 deletions fixtures/messageGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"conversation_expiration_timestamp": "2023-08-03 23:02:00+05:30",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"

"carrier_fees_rate": "0.00000",
"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": ""
}
104 changes: 82 additions & 22 deletions fixtures/messageListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"conversation_expiration_timestamp": "2023-08-03 23:02:00+05:30",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -55,7 +58,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -80,7 +86,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -105,7 +114,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -130,7 +142,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -155,7 +170,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -180,13 +198,16 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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,
"error_code": "450",
"from_number": "919655100565",
"message_direction": "outbound",
"message_state": "sent",
"message_state": "failed",
"message_time": "2017-05-16 20:52:51+05:30",
"message_type": "sms",
"message_uuid": "937da994-4d07-4a85-9252-764d846cacf5",
Expand All @@ -205,7 +226,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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": "Destination Country Disabled"
},
{
"error_code": "000",
Expand All @@ -230,7 +254,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -255,7 +282,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -280,7 +310,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -305,7 +338,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -330,7 +366,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -355,7 +394,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -380,7 +422,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -405,7 +450,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -430,7 +478,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -455,7 +506,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -480,7 +534,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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 @@ -505,7 +562,10 @@
"conversation_expiration_timestamp": "",
"destination_network": "",
"carrier_fees": "0.00000",
"carrier_fees_rate": "0.00000"
"carrier_fees_rate": "0.00000",
"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": ""
}
]
}
3 changes: 3 additions & 0 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Message struct {
MessageUUID string `json:"message_uuid,omitempty" url:"message_uuid,omitempty"`
MessageTime string `json:"message_time,omitempty" url:"message_time,omitempty"`
ErrorCode string `json:"error_code,omitempty" url:"error_code,omitempty"`
ErrorMessage string `json:"error_message,omitempty" url:"error_message,omitempty"`
PowerpackID string `json:"powerpack_id,omitempty" url:"powerpack_id,omitempty"`
RequesterIP string `json:"requester_ip,omitempty" url:"requester_ip,omitempty"`
IsDomestic *bool `json:"is_domestic,omitempty" url:"is_domestic,omitempty"`
Expand All @@ -64,6 +65,8 @@ type Message struct {
CarrierFeesRate string `json:"carrier_fees_rate" url:"carrier_fees_rate,omitempty"`
CarrierFees string `json:"carrier_fees" url:"carrier_fees,omitempty"`
Log string `json:"log" url:"log,omitempty"`
MessageSentTime string `json:"message_sent_time" url:"message_sent_time,omitempty"`
MessageUpdatedTime string `json:"message_updated_time" url:"message_updated_time,omitempty"`
}

// Stores response for ending a message.
Expand Down

0 comments on commit 726868c

Please sign in to comment.