Skip to content

Commit ee17ef9

Browse files
committed
[Librarian] Regenerated @ 01f08ee7ea770beb526f655c6e616695f7eab4e0
1 parent 2e57525 commit ee17ef9

File tree

66 files changed

+572
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+572
-78
lines changed

CHANGES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
twilio-go changelog
22
====================
3+
[2022-10-31] Version 1.1.1
4+
--------------------------
5+
**Library - Miscellaneous**
6+
- [PR #195](https://github.com/twilio/twilio-go/pull/195): move webhook cluster test. Thanks to [@claudiachua](https://github.com/claudiachua)!
7+
8+
**Api**
9+
- Added `contentSid` and `contentVariables` to Message resource with public visibility as Beta
10+
- Add `UserDefinedMessageSubscription` and `UserDefinedMessage` resource
11+
12+
**Proxy**
13+
- Remove FailOnParticipantConflict param from Proxy Session create and update and Proxy Participant create
14+
15+
**Supersim**
16+
- Update SettingsUpdates resource to remove PackageSid
17+
18+
**Taskrouter**
19+
- Add `Ordering` query parameter to Workers and TaskQueues for sorting by
20+
- Add `worker_sid` query param for list reservations endpoint
21+
22+
323
[2022-10-19] Version 1.1.0
424
--------------------------
525
**Library - Docs**

cluster_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
package twilio
55

66
import (
7+
"os"
8+
"testing"
9+
710
"github.com/stretchr/testify/assert"
811
Api "github.com/twilio/twilio-go/rest/api/v2010"
912
ChatV2 "github.com/twilio/twilio-go/rest/chat/v2"
1013
EventsV1 "github.com/twilio/twilio-go/rest/events/v1"
11-
"os"
12-
"testing"
1314
)
1415

1516
var from string

rest/accounts/v1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is the public Twilio REST API.
55
## Overview
66
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
77

8-
- API version: 1.37.0
8+
- API version: 1.37.1
99
- Package version: 1.0.0
1010
- Build package: com.twilio.oai.TwilioGoGenerator
1111
For more information, please visit [https://support.twilio.com](https://support.twilio.com)

rest/api/v2010/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is the public Twilio REST API.
55
## Overview
66
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
77

8-
- API version: 1.37.0
8+
- API version: 1.37.1
99
- Package version: 1.0.0
1010
- Build package: com.twilio.oai.TwilioGoGenerator
1111
For more information, please visit [https://support.twilio.com](https://support.twilio.com)
@@ -82,6 +82,9 @@ Class | Method | HTTP request | Description
8282
*AccountsCallsSiprecApi* | [**UpdateSiprec**](docs/AccountsCallsSiprecApi.md#updatesiprec) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Siprec/{Sid}.json |
8383
*AccountsCallsStreamsApi* | [**CreateStream**](docs/AccountsCallsStreamsApi.md#createstream) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Streams.json |
8484
*AccountsCallsStreamsApi* | [**UpdateStream**](docs/AccountsCallsStreamsApi.md#updatestream) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Streams/{Sid}.json |
85+
*AccountsCallsUserDefinedMessageSubscriptionsApi* | [**CreateUserDefinedMessageSubscription**](docs/AccountsCallsUserDefinedMessageSubscriptionsApi.md#createuserdefinedmessagesubscription) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.json |
86+
*AccountsCallsUserDefinedMessageSubscriptionsApi* | [**DeleteUserDefinedMessageSubscription**](docs/AccountsCallsUserDefinedMessageSubscriptionsApi.md#deleteuserdefinedmessagesubscription) | **Delete** /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions/{Sid}.json |
87+
*AccountsCallsUserDefinedMessagesApi* | [**CreateUserDefinedMessage**](docs/AccountsCallsUserDefinedMessagesApi.md#createuserdefinedmessage) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessages.json |
8588
*AccountsConferencesApi* | [**FetchConference**](docs/AccountsConferencesApi.md#fetchconference) | **Get** /2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json |
8689
*AccountsConferencesApi* | [**ListConference**](docs/AccountsConferencesApi.md#listconference) | **Get** /2010-04-01/Accounts/{AccountSid}/Conferences.json |
8790
*AccountsConferencesApi* | [**UpdateConference**](docs/AccountsConferencesApi.md#updateconference) | **Post** /2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json |
@@ -240,6 +243,7 @@ Class | Method | HTTP request | Description
240243
- [ListApplicationResponse](docs/ListApplicationResponse.md)
241244
- [ApiV2010UsageRecord](docs/ApiV2010UsageRecord.md)
242245
- [ListIncomingPhoneNumberLocalResponse](docs/ListIncomingPhoneNumberLocalResponse.md)
246+
- [ApiV2010UserDefinedMessage](docs/ApiV2010UserDefinedMessage.md)
243247
- [ApiV2010RecordingAddOnResultPayload](docs/ApiV2010RecordingAddOnResultPayload.md)
244248
- [ListMessageResponse](docs/ListMessageResponse.md)
245249
- [ApiV2010Transcription](docs/ApiV2010Transcription.md)
@@ -319,6 +323,7 @@ Class | Method | HTTP request | Description
319323
- [ApiV2010SipAuthCallsCredentialListMapping](docs/ApiV2010SipAuthCallsCredentialListMapping.md)
320324
- [ListSipIpAddressResponse](docs/ListSipIpAddressResponse.md)
321325
- [ApiV2010NewKey](docs/ApiV2010NewKey.md)
326+
- [ApiV2010UserDefinedMessageSubscription](docs/ApiV2010UserDefinedMessageSubscription.md)
322327
- [ApiV2010NewSigningKey](docs/ApiV2010NewSigningKey.md)
323328
- [ListAvailablePhoneNumberLocalResponse](docs/ListAvailablePhoneNumberLocalResponse.md)
324329
- [ListUsageRecordYesterdayResponse](docs/ListUsageRecordYesterdayResponse.md)
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Api
8+
* This is the public Twilio REST API.
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator.
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
package openapi
16+
17+
import (
18+
"encoding/json"
19+
"net/url"
20+
"strings"
21+
)
22+
23+
// Optional parameters for the method 'CreateUserDefinedMessageSubscription'
24+
type CreateUserDefinedMessageSubscriptionParams struct {
25+
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages.
26+
PathAccountSid *string `json:"PathAccountSid,omitempty"`
27+
// The URL we should call using the `method` to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted).
28+
Callback *string `json:"Callback,omitempty"`
29+
// The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`.
30+
Method *string `json:"Method,omitempty"`
31+
// A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
32+
IdempotencyKey *string `json:"IdempotencyKey,omitempty"`
33+
}
34+
35+
func (params *CreateUserDefinedMessageSubscriptionParams) SetPathAccountSid(PathAccountSid string) *CreateUserDefinedMessageSubscriptionParams {
36+
params.PathAccountSid = &PathAccountSid
37+
return params
38+
}
39+
func (params *CreateUserDefinedMessageSubscriptionParams) SetCallback(Callback string) *CreateUserDefinedMessageSubscriptionParams {
40+
params.Callback = &Callback
41+
return params
42+
}
43+
func (params *CreateUserDefinedMessageSubscriptionParams) SetMethod(Method string) *CreateUserDefinedMessageSubscriptionParams {
44+
params.Method = &Method
45+
return params
46+
}
47+
func (params *CreateUserDefinedMessageSubscriptionParams) SetIdempotencyKey(IdempotencyKey string) *CreateUserDefinedMessageSubscriptionParams {
48+
params.IdempotencyKey = &IdempotencyKey
49+
return params
50+
}
51+
52+
// Subscribe to User Defined Messages for a given call sid.
53+
func (c *ApiService) CreateUserDefinedMessageSubscription(CallSid string, params *CreateUserDefinedMessageSubscriptionParams) (*ApiV2010UserDefinedMessageSubscription, error) {
54+
path := "/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.json"
55+
if params != nil && params.PathAccountSid != nil {
56+
path = strings.Replace(path, "{"+"AccountSid"+"}", *params.PathAccountSid, -1)
57+
} else {
58+
path = strings.Replace(path, "{"+"AccountSid"+"}", c.requestHandler.Client.AccountSid(), -1)
59+
}
60+
path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1)
61+
62+
data := url.Values{}
63+
headers := make(map[string]interface{})
64+
65+
if params != nil && params.Callback != nil {
66+
data.Set("Callback", *params.Callback)
67+
}
68+
if params != nil && params.Method != nil {
69+
data.Set("Method", *params.Method)
70+
}
71+
if params != nil && params.IdempotencyKey != nil {
72+
data.Set("IdempotencyKey", *params.IdempotencyKey)
73+
}
74+
75+
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
76+
if err != nil {
77+
return nil, err
78+
}
79+
80+
defer resp.Body.Close()
81+
82+
ps := &ApiV2010UserDefinedMessageSubscription{}
83+
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
84+
return nil, err
85+
}
86+
87+
return ps, err
88+
}
89+
90+
// Optional parameters for the method 'DeleteUserDefinedMessageSubscription'
91+
type DeleteUserDefinedMessageSubscriptionParams struct {
92+
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages.
93+
PathAccountSid *string `json:"PathAccountSid,omitempty"`
94+
}
95+
96+
func (params *DeleteUserDefinedMessageSubscriptionParams) SetPathAccountSid(PathAccountSid string) *DeleteUserDefinedMessageSubscriptionParams {
97+
params.PathAccountSid = &PathAccountSid
98+
return params
99+
}
100+
101+
// Delete a specific User Defined Message Subscription.
102+
func (c *ApiService) DeleteUserDefinedMessageSubscription(CallSid string, Sid string, params *DeleteUserDefinedMessageSubscriptionParams) error {
103+
path := "/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions/{Sid}.json"
104+
if params != nil && params.PathAccountSid != nil {
105+
path = strings.Replace(path, "{"+"AccountSid"+"}", *params.PathAccountSid, -1)
106+
} else {
107+
path = strings.Replace(path, "{"+"AccountSid"+"}", c.requestHandler.Client.AccountSid(), -1)
108+
}
109+
path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1)
110+
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
111+
112+
data := url.Values{}
113+
headers := make(map[string]interface{})
114+
115+
resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
116+
if err != nil {
117+
return err
118+
}
119+
120+
defer resp.Body.Close()
121+
122+
return nil
123+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Api
8+
* This is the public Twilio REST API.
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator.
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
package openapi
16+
17+
import (
18+
"encoding/json"
19+
"net/url"
20+
"strings"
21+
)
22+
23+
// Optional parameters for the method 'CreateUserDefinedMessage'
24+
type CreateUserDefinedMessageParams struct {
25+
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message.
26+
PathAccountSid *string `json:"PathAccountSid,omitempty"`
27+
// A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
28+
Content *string `json:"Content,omitempty"`
29+
// A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
30+
IdempotencyKey *string `json:"IdempotencyKey,omitempty"`
31+
}
32+
33+
func (params *CreateUserDefinedMessageParams) SetPathAccountSid(PathAccountSid string) *CreateUserDefinedMessageParams {
34+
params.PathAccountSid = &PathAccountSid
35+
return params
36+
}
37+
func (params *CreateUserDefinedMessageParams) SetContent(Content string) *CreateUserDefinedMessageParams {
38+
params.Content = &Content
39+
return params
40+
}
41+
func (params *CreateUserDefinedMessageParams) SetIdempotencyKey(IdempotencyKey string) *CreateUserDefinedMessageParams {
42+
params.IdempotencyKey = &IdempotencyKey
43+
return params
44+
}
45+
46+
// Create a new User Defined Message for the given call sid.
47+
func (c *ApiService) CreateUserDefinedMessage(CallSid string, params *CreateUserDefinedMessageParams) (*ApiV2010UserDefinedMessage, error) {
48+
path := "/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessages.json"
49+
if params != nil && params.PathAccountSid != nil {
50+
path = strings.Replace(path, "{"+"AccountSid"+"}", *params.PathAccountSid, -1)
51+
} else {
52+
path = strings.Replace(path, "{"+"AccountSid"+"}", c.requestHandler.Client.AccountSid(), -1)
53+
}
54+
path = strings.Replace(path, "{"+"CallSid"+"}", CallSid, -1)
55+
56+
data := url.Values{}
57+
headers := make(map[string]interface{})
58+
59+
if params != nil && params.Content != nil {
60+
data.Set("Content", *params.Content)
61+
}
62+
if params != nil && params.IdempotencyKey != nil {
63+
data.Set("IdempotencyKey", *params.IdempotencyKey)
64+
}
65+
66+
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
67+
if err != nil {
68+
return nil, err
69+
}
70+
71+
defer resp.Body.Close()
72+
73+
ps := &ApiV2010UserDefinedMessage{}
74+
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
75+
return nil, err
76+
}
77+
78+
return ps, err
79+
}

rest/api/v2010/accounts_messages.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ type CreateMessageParams struct {
6060
SendAt *time.Time `json:"SendAt,omitempty"`
6161
// If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.
6262
SendAsMms *bool `json:"SendAsMms,omitempty"`
63+
// The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized.
64+
ContentSid *string `json:"ContentSid,omitempty"`
65+
// Key-value pairs of variable names to substitution values, used alongside a content_sid. If not specified, Content API will default to the default variables defined at create time.
66+
ContentVariables *string `json:"ContentVariables,omitempty"`
6367
// A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty.
6468
From *string `json:"From,omitempty"`
6569
// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.
@@ -138,6 +142,14 @@ func (params *CreateMessageParams) SetSendAsMms(SendAsMms bool) *CreateMessagePa
138142
params.SendAsMms = &SendAsMms
139143
return params
140144
}
145+
func (params *CreateMessageParams) SetContentSid(ContentSid string) *CreateMessageParams {
146+
params.ContentSid = &ContentSid
147+
return params
148+
}
149+
func (params *CreateMessageParams) SetContentVariables(ContentVariables string) *CreateMessageParams {
150+
params.ContentVariables = &ContentVariables
151+
return params
152+
}
141153
func (params *CreateMessageParams) SetFrom(From string) *CreateMessageParams {
142154
params.From = &From
143155
return params
@@ -217,6 +229,12 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Messag
217229
if params != nil && params.SendAsMms != nil {
218230
data.Set("SendAsMms", fmt.Sprint(*params.SendAsMms))
219231
}
232+
if params != nil && params.ContentSid != nil {
233+
data.Set("ContentSid", *params.ContentSid)
234+
}
235+
if params != nil && params.ContentVariables != nil {
236+
data.Set("ContentVariables", *params.ContentVariables)
237+
}
220238
if params != nil && params.From != nil {
221239
data.Set("From", *params.From)
222240
}

0 commit comments

Comments
 (0)