Skip to content

Commit

Permalink
Merge branch 'master' into additional-mdr-attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
narayana-plivo authored Sep 6, 2024
2 parents 1f55169 + b7dcbbb commit 29a45c6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
## [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
- 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
- Added support for `brand_name` , `app_hash`, `code_length` param in get and list Session response

## [7.51.1](https://github.com/plivo/plivo-go/tree/v7.51.1) (2024-09-05)
**Feature - Adding new element for Audio Stream XML **
- Added `keepCallAlive` element in Audio Stream XML

## [7.51.0](https://github.com/plivo/plivo-go/tree/v7.51.0) (2024-07-11)
**Feature - Adding support for Locale param in Create, Get and List Session**
- Added new request param `locale` in create Session API
Expand Down
20 changes: 14 additions & 6 deletions verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ type AttemptDetails struct {
Channel string `json:"channel,omitempty"`
AttemptUUID string `json:"attempt_uuid,omitempty"`
Status string `json:"status,omitempty"`
BrandName string `json:"brand_name,omitempty"`
AppHash string `json:"app_hash,omitempty"`
CodeLength int `json:"code_length,omitempty"`
Time time.Time `json:"time,omitempty"`
}

Expand All @@ -61,12 +64,15 @@ type AttemptCharges struct {
type SessionCreateParams struct {
Recipient string `json:"recipient,omitempty"`
// Optional parameters.
AppUUID string `json:"app_uuid,omitempty"`
Channel string `json:"channel,omitempty"`
URL string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
Src string `json:"src,omitempty"`
Locale string `json:"locale,omitempty"`
AppUUID string `json:"app_uuid,omitempty"`
Channel string `json:"channel,omitempty"`
URL string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
Src string `json:"src,omitempty"`
Locale string `json:"locale,omitempty"`
BrandName string `json:"brand_name,omitempty"`
AppHash string `json:"app_hash,omitempty"`
CodeLength int `json:"code_length,omitempty"`
}

type SessionCreateResponseBody struct {
Expand All @@ -88,6 +94,8 @@ type SessionListParams struct {
AppUUID string `url:"app_uuid,omitempty"`
Country string `url:"country,omitempty"`
Alias string `url:"alias,omitempty"`
BrandName string `json:"brand_name,omitempty"`
AppHash string `json:"app_hash,omitempty"`
SessionTime string `url:"session_time,omitempty"`
Subaccount string `url:"subaccount,omitempty"`
SessionTimeGreaterThan string `url:"session_time__gt,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions xml/plivoxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,8 @@ type StreamElement struct {

ExtraHeaders *string `xml:"extraHeaders,attr"`

KeepCallAlive *bool `xml:"keepCallAlive,attr"`

XMLName xml.Name `xml:"Stream"`
}

Expand Down Expand Up @@ -1444,6 +1446,11 @@ func (e StreamElement) SetExtraHeaders(value string) StreamElement {
return e
}

func (e StreamElement) SetKeepCallAlive(value bool) StreamElement {
e.KeepCallAlive = &value
return e
}

func (e StreamElement) SetContents(value string) StreamElement {
e.Contents = value
return e
Expand Down
4 changes: 2 additions & 2 deletions xml/plivoxml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ func TestMPCXMLWithHold(t *testing.T) {
}

func TestStreamXML(t *testing.T) {
assert.Equal(t, "<Response><Stream bidirectional=\"true\" extraHeaders=\"a=1,b=2\">wss://test.url</Stream></Response>", ResponseElement{
assert.Equal(t, "<Response><Stream bidirectional=\"true\" extraHeaders=\"a=1,b=2\" keepCallAlive=\"true\">wss://test.url</Stream></Response>", ResponseElement{
Contents: []interface{}{
new(StreamElement).SetBidirectional(true).SetContents("wss://test.url").SetExtraHeaders("a=1,b=2"),
new(StreamElement).SetBidirectional(true).SetContents("wss://test.url").SetExtraHeaders("a=1,b=2").SetKeepCallAlive(true),
},
}.String())
}

0 comments on commit 29a45c6

Please sign in to comment.