Skip to content

Commit

Permalink
SMS-6099: Added meta data for List Brand, Campaign, Profile (#186)
Browse files Browse the repository at this point in the history
* Added meta data for List Brand, Campaign, Profile

* Test commit

* Test commit removed

* Added total_count field to meta data for campaign and brand list response

* Updating version

* version update

---------

Co-authored-by: renoldthomas-plivo <[email protected]>
  • Loading branch information
rajneeshkatkam-plivo and renoldthomas-plivo authored Oct 18, 2023
1 parent d6cff0d commit 223e3de
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [7.40.0](https://github.com/plivo/plivo-go/tree/v7.40.0) (2023-10-18)
**Feature - Fixes for Campaign services list API meta data**
- Fixed Meta data response for campaign, brand and profile list

## [7.39.0](https://github.com/plivo/plivo-go/tree/v7.39.0) (2023-10-18)
**Feature - Verify CallerID**
- Added Initiate and Verify VerifyCallerID 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.39.0"
const sdkVersion = "7.40.0"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
9 changes: 8 additions & 1 deletion brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ type Usecase struct {
}

type BrandListResponse struct {
ApiID string `json:"api_id,omitempty"`
ApiID string `json:"api_id,omitempty"`
Meta struct {
Previous *string
Next *string
Offset int64
Limit int64
TotalCount int64 `json:"total_count"`
} `json:"meta"`
BrandResponse []Brand `json:"brands,omitempty"`
}

Expand Down
9 changes: 8 additions & 1 deletion campaign.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ type CampaignUpdateParams struct {
}

type CampaignListResponse struct {
ApiID string `json:"api_id,omitempty"`
ApiID string `json:"api_id,omitempty"`
Meta struct {
Previous *string
Next *string
Offset int64
Limit int64
TotalCount int64 `json:"total_count"`
} `json:"meta"`
CampaignResponse []Campaign `json:"campaigns,omitempty"`
}

Expand Down
18 changes: 9 additions & 9 deletions messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ func TestMessageService_List(t *testing.T) {
assert.Equal(resp.Objects[19].DLTTemplateID, "")
assert.Equal(resp.Objects[19].DLTTemplateCategory, "")

assert.Equal(resp.Objects[0].ConversationID, "0079");
assert.Equal(resp.Objects[0].ConversationOrigin, "marketing");
assert.Equal(resp.Objects[0].ConversationExpirationTimestamp, "2023-08-03 23:02:00+05:30");
assert.Equal(resp.Objects[0].ConversationID, "0079")
assert.Equal(resp.Objects[0].ConversationOrigin, "marketing")
assert.Equal(resp.Objects[0].ConversationExpirationTimestamp, "2023-08-03 23:02:00+05:30")

assert.Equal(resp.Objects[19].ConversationID, "");
assert.Equal(resp.Objects[19].ConversationOrigin, "");
assert.Equal(resp.Objects[19].ConversationExpirationTimestamp, "");
assert.Equal(resp.Objects[19].ConversationID, "")
assert.Equal(resp.Objects[19].ConversationOrigin, "")
assert.Equal(resp.Objects[19].ConversationExpirationTimestamp, "")

assert.NotNil(resp.Meta)
cl := client.httpClient
Expand All @@ -58,9 +58,9 @@ func TestMessageService_Get(t *testing.T) {
assert.Equal(resp.DLTTemplateID, "5678")
assert.Equal(resp.DLTTemplateCategory, "service_implicit")

assert.Equal(resp.ConversationID, "9876");
assert.Equal(resp.ConversationOrigin, "utility");
assert.Equal(resp.ConversationExpirationTimestamp, "2023-08-03 23:02:00+05:30");
assert.Equal(resp.ConversationID, "9876")
assert.Equal(resp.ConversationOrigin, "utility")
assert.Equal(resp.ConversationExpirationTimestamp, "2023-08-03 23:02:00+05:30")

cl := client.httpClient
client.httpClient = nil
Expand Down
8 changes: 7 additions & 1 deletion profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ type ProfileListParams struct {
}

type ProfileListResponse struct {
ApiID string `json:"api_id"`
ApiID string `json:"api_id"`
Meta struct {
Previous *string
Next *string
Offset int64
Limit int64
} `json:"meta"`
ProfileResponse []Profile `json:"profiles"`
}

Expand Down

0 comments on commit 223e3de

Please sign in to comment.