Skip to content

Commit

Permalink
Merge pull request #106 from plivo/list-mdr-ppk-filter
Browse files Browse the repository at this point in the history
support powerpack id filter for list mdr
  • Loading branch information
huzaif-plivo authored Jul 13, 2021
2 parents 181e253 + 4aa25b1 commit 61d0cd4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [7.1.0](https://github.com/plivo/plivo-go/tree/v7.1.0) (2021-07-13)
- Power pack ID has been included 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).
- Support for filtering messages by Power pack ID has been added to the [list all messages API](https://www.plivo.com/docs/sms/api/message#list-all-messages).


## [7.0.0](https://github.com/plivo/plivo-go/tree/v7.0.0) (2021-07-05)
- **BREAKING**: Remove the total_count parameter in meta data for list MDR response

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.0.0"
const sdkVersion = "7.1.0"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
16 changes: 14 additions & 2 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type Message struct {
TotalAmount string `json:"total_amount,omitempty" url:"total_amount,omitempty"`
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"`
PowerpackID string `json:"powerpack_id,omitempty" url:"powerpack_id,omitempty"`
}

// Stores response for ending a message.
Expand Down Expand Up @@ -76,8 +78,18 @@ type MediaListResponseBody struct {
}

type MessageListParams struct {
Limit int `url:"limit,omitempty"`
Offset int `url:"offset,omitempty"`
Limit int `url:"limit,omitempty"`
Offset int `url:"offset,omitempty"`
PowerpackID string `url:"powerpack_id,omitempty"`
Subaccount string `url:"subaccount,omitempty"`
MessageDirection string `url:"message_direction,omitempty"`
MessageState string `url:"message_state,omitempty"`
ErrorCode int `url:"error_code,omitempty"`
MessageTime string `url:"message_time,omitempty"`
MessageTimeGreaterThan string `url:"message_time__gt,omitempty"`
MessageTimeGreaterOrEqual string `url:"message_time__gte,omitempty"`
MessageTimeLessThan string `url:"message_time__lt,omitempty"`
MessageTimeLessOrEqual string `url:"message_time__lte,omitempty"`
}

func (service *MessageService) List(params MessageListParams) (response *MessageList, err error) {
Expand Down

0 comments on commit 61d0cd4

Please sign in to comment.