Skip to content

Commit cfba7a4

Browse files
committed
[Librarian] Regenerated @ a0e9749231373dd308a3e70b801feb64326d09ef 76d8c9437463e872bc7ab27ffc1fae22c72bf89f
1 parent a6c5a19 commit cfba7a4

File tree

604 files changed

+6012
-2525
lines changed

Some content is hidden

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

604 files changed

+6012
-2525
lines changed

CHANGES.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
11
twilio-go changelog
22
====================
3+
[2023-12-07] Version 2.0.0-rc.1
4+
-------------------------------
5+
**Library - Feature**
6+
- [PR #213](https://github.com/twilio/twilio-go/pull/213): Support JSON payload in HTTP requests. Thanks to [@AsabuHere](https://github.com/AsabuHere)!
7+
8+
**Accounts**
9+
- Updated Safelist metadata to correct the docs.
10+
- Add Global SafeList API changes
11+
12+
**Api**
13+
- Updated service base url for connect apps and authorized connect apps APIs **(breaking change)**
14+
- Update documentation to reflect RiskCheck GA
15+
- Added optional parameter `CallToken` for create participant api
16+
17+
**Events**
18+
- Marked as GA
19+
20+
**Flex**
21+
- Adding `provisioning_status` for Email Manager
22+
- Adding `offline_config` to Flex Configuration
23+
24+
**Insights**
25+
- decommission voice-qualitystats-endpoint role
26+
27+
**Intelligence**
28+
- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection.
29+
- Deleted `redacted` parameter from fetching transcript in v2 **(breaking change)**
30+
31+
**Lookups**
32+
- Add new `phone_number_quality_score` package to the lookup response
33+
- Remove `disposable_phone_number_risk` package **(breaking change)**
34+
35+
**Messaging**
36+
- Add tollfree edit_allowed and edit_reason fields
37+
- Update Phone Number, Short Code, Alpha Sender, US A2P and Channel Sender documentation
38+
- Add DELETE support to Tollfree Verification resource
39+
- Update US App To Person documentation with current `message_samples` requirements
40+
41+
**Serverless**
42+
- Add node18 as a valid Build runtime
43+
44+
**Taskrouter**
45+
- Add container attribute to task_queue_bulk_real_time_statistics endpoint
46+
- Remove beta_feature check on task_queue_bulk_real_time_statistics endpoint
47+
- Add `virtual_start_time` property to tasks
48+
- Updating `task_queue_data` format from `map` to `array` in the response of bulk get endpoint of TaskQueue Real Time Statistics API **(breaking change)**
49+
50+
**Trusthub**
51+
- Add additional optional fields in compliance_tollfree_inquiry.json
52+
- Rename did to tollfree_phone_number in compliance_tollfree_inquiry.json
53+
- Add new optional field notification_email to compliance_tollfree_inquiry.json
54+
55+
**Verify**
56+
- Remove `Tags` from Public Docs **(breaking change)**
57+
- Add `VerifyEventSubscriptionEnabled` parameter to service create and update endpoints.
58+
- Add `Tags` optional parameter on Verification creation.
59+
- Update Verify TOTP maturity to GA.
60+
61+
362
[2023-11-22] Version 2.0.0-rc.0
463
---------------------------
564
- Release Candidate preparation

client/client.go

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
package client
33

44
import (
5+
"bytes"
56
"encoding/json"
67
"fmt"
78
"net/http"
8-
"bytes"
99
"net/url"
1010
"regexp"
1111
"runtime"
1212
"strconv"
1313
"strings"
1414
"time"
15+
1516
"github.com/pkg/errors"
1617
"github.com/twilio/twilio-go/client/form"
1718
)
@@ -56,20 +57,20 @@ func (c *Client) SetTimeout(timeout time.Duration) {
5657
c.HTTPClient.Timeout = timeout
5758
}
5859

59-
func extractContentTypeHeader(headers map[string]interface{}) (cType string){
60-
headerType, ok := headers["Content-Type"]
61-
if !ok {
62-
return urlEncodedContentType
63-
}
64-
return headerType.(string)
60+
func extractContentTypeHeader(headers map[string]interface{}) (cType string) {
61+
headerType, ok := headers["Content-Type"]
62+
if !ok {
63+
return urlEncodedContentType
64+
}
65+
return headerType.(string)
6566
}
6667

6768
const (
6869
urlEncodedContentType = "application/x-www-form-urlencoded"
69-
jsonContentType = "application/json"
70-
keepZeros = true
71-
delimiter = '.'
72-
escapee = '\\'
70+
jsonContentType = "application/json"
71+
keepZeros = true
72+
delimiter = '.'
73+
escapee = '\\'
7374
)
7475

7576
func (c *Client) doWithErr(req *http.Request) (*http.Response, error) {
@@ -107,16 +108,16 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values,
107108
if err != nil {
108109
return nil, err
109110
}
110-
111+
111112
valueReader := &strings.Reader{}
112113
goVersion := runtime.Version()
113114
var req *http.Request
114115

115116
//For HTTP GET Method there are no body parameters. All other parameters like query, path etc
116-
// are added as information in the url itself. Also while Content-Type is json, we are sending
117-
// json body. In that case, data variable conatins all other parameters than body, which is the
117+
// are added as information in the url itself. Also while Content-Type is json, we are sending
118+
// json body. In that case, data variable conatins all other parameters than body, which is the
118119
//same case as GET method. In that case as well all parameters will be added to url
119-
if method == http.MethodGet || contentType == jsonContentType{
120+
if method == http.MethodGet || contentType == jsonContentType {
120121
if data != nil {
121122
v, _ := form.EncodeToStringWith(data, delimiter, escapee, keepZeros)
122123
regex := regexp.MustCompile(`\.\d+`)
@@ -127,12 +128,12 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values,
127128
}
128129

129130
//data is already processed and information will be added to u(the url) in the
130-
//previous step. Now body will solely contain json payload
131+
//previous step. Now body will solely contain json payload
131132
if contentType == jsonContentType {
132133
req, err = http.NewRequest(method, u.String(), bytes.NewBuffer(body))
133134
if err != nil {
134135
return nil, err
135-
}
136+
}
136137
} else {
137138
//Here the HTTP POST methods which is not having json content type are processed
138139
//All the values will be added in data and encoded (all body, query, path parameters)
@@ -146,7 +147,7 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values,
146147

147148
}
148149

149-
if contentType == urlEncodedContentType{
150+
if contentType == urlEncodedContentType {
150151
req.Header.Add("Content-Type", urlEncodedContentType)
151152
}
152153

@@ -175,4 +176,4 @@ func (c *Client) SetAccountSid(sid string) {
175176
// Returns the Account SID.
176177
func (c *Client) AccountSid() string {
177178
return c.accountSid
178-
}
179+
}

rest/accounts/v1/README.md

Lines changed: 5 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.50.1
8+
- API version: 1.0.0
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)
@@ -44,6 +44,9 @@ Class | Method | HTTP request | Description
4444
*CredentialsPublicKeysApi* | [**FetchCredentialPublicKey**](docs/CredentialsPublicKeysApi.md#fetchcredentialpublickey) | **Get** /v1/Credentials/PublicKeys/{Sid} |
4545
*CredentialsPublicKeysApi* | [**ListCredentialPublicKey**](docs/CredentialsPublicKeysApi.md#listcredentialpublickey) | **Get** /v1/Credentials/PublicKeys |
4646
*CredentialsPublicKeysApi* | [**UpdateCredentialPublicKey**](docs/CredentialsPublicKeysApi.md#updatecredentialpublickey) | **Post** /v1/Credentials/PublicKeys/{Sid} |
47+
*SafeListNumbersApi* | [**CreateSafelist**](docs/SafeListNumbersApi.md#createsafelist) | **Post** /v1/SafeList/Numbers |
48+
*SafeListNumbersApi* | [**DeleteSafelist**](docs/SafeListNumbersApi.md#deletesafelist) | **Delete** /v1/SafeList/Numbers |
49+
*SafeListNumbersApi* | [**FetchSafelist**](docs/SafeListNumbersApi.md#fetchsafelist) | **Get** /v1/SafeList/Numbers |
4750

4851

4952
## Documentation For Models
@@ -54,6 +57,7 @@ Class | Method | HTTP request | Description
5457
- [AccountsV1AuthTokenPromotion](docs/AccountsV1AuthTokenPromotion.md)
5558
- [AccountsV1CredentialAws](docs/AccountsV1CredentialAws.md)
5659
- [AccountsV1CredentialPublicKey](docs/AccountsV1CredentialPublicKey.md)
60+
- [AccountsV1Safelist](docs/AccountsV1Safelist.md)
5761
- [ListCredentialAwsResponseMeta](docs/ListCredentialAwsResponseMeta.md)
5862

5963

rest/api/v2010/docs/ApiV2010Safelist.md renamed to rest/accounts/v1/docs/AccountsV1Safelist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ApiV2010Safelist
1+
# AccountsV1Safelist
22

33
## Properties
44

rest/accounts/v1/docs/ListCredentialAwsResponseMeta.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**FirstPageUrl** | **string** | |[optional]
8+
**Key** | **string** | |[optional]
89
**NextPageUrl** | Pointer to **string** | |
910
**Page** | **int** | |[optional]
1011
**PageSize** | **int** | |[optional]
1112
**PreviousPageUrl** | Pointer to **string** | |
1213
**Url** | **string** | |[optional]
13-
**Key** | **string** | |[optional]
1414

1515
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1616

rest/api/v2010/docs/SafeListNumbersApi.md renamed to rest/accounts/v1/docs/SafeListNumbersApi.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# SafeListNumbersApi
22

3-
All URIs are relative to *https://api.twilio.com*
3+
All URIs are relative to *https://accounts.twilio.com*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**CreateSafelist**](SafeListNumbersApi.md#CreateSafelist) | **Post** /2010-04-01/SafeList/Numbers.json |
8-
[**DeleteSafelist**](SafeListNumbersApi.md#DeleteSafelist) | **Delete** /2010-04-01/SafeList/Numbers.json |
9-
[**FetchSafelist**](SafeListNumbersApi.md#FetchSafelist) | **Get** /2010-04-01/SafeList/Numbers.json |
7+
[**CreateSafelist**](SafeListNumbersApi.md#CreateSafelist) | **Post** /v1/SafeList/Numbers |
8+
[**DeleteSafelist**](SafeListNumbersApi.md#DeleteSafelist) | **Delete** /v1/SafeList/Numbers |
9+
[**FetchSafelist**](SafeListNumbersApi.md#FetchSafelist) | **Get** /v1/SafeList/Numbers |
1010

1111

1212

1313
## CreateSafelist
1414

15-
> ApiV2010Safelist CreateSafelist(ctx, optional)
15+
> AccountsV1Safelist CreateSafelist(ctx, optional)
1616
1717

1818

@@ -33,7 +33,7 @@ Name | Type | Description
3333

3434
### Return type
3535

36-
[**ApiV2010Safelist**](ApiV2010Safelist.md)
36+
[**AccountsV1Safelist**](AccountsV1Safelist.md)
3737

3838
### Authorization
3939

@@ -90,7 +90,7 @@ Name | Type | Description
9090

9191
## FetchSafelist
9292

93-
> ApiV2010Safelist FetchSafelist(ctx, optional)
93+
> AccountsV1Safelist FetchSafelist(ctx, optional)
9494
9595

9696

@@ -111,7 +111,7 @@ Name | Type | Description
111111

112112
### Return type
113113

114-
[**ApiV2010Safelist**](ApiV2010Safelist.md)
114+
[**AccountsV1Safelist**](AccountsV1Safelist.md)
115115

116116
### Authorization
117117

rest/api/v2010/model_api_v2010_safelist.go renamed to rest/accounts/v1/model_accounts_v1_safelist.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
55
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
66
*
7-
* Twilio - Api
7+
* Twilio - Accounts
88
* This is the public Twilio REST API.
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator.
@@ -14,8 +14,8 @@
1414

1515
package openapi
1616

17-
// ApiV2010Safelist struct for ApiV2010Safelist
18-
type ApiV2010Safelist struct {
17+
// AccountsV1Safelist struct for AccountsV1Safelist
18+
type AccountsV1Safelist struct {
1919
// The unique string that we created to identify the SafeList resource.
2020
Sid *string `json:"sid,omitempty"`
2121
// The phone number in SafeList.

rest/accounts/v1/model_list_credential_aws_response_meta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ package openapi
1717
// ListCredentialAwsResponseMeta struct for ListCredentialAwsResponseMeta
1818
type ListCredentialAwsResponseMeta struct {
1919
FirstPageUrl string `json:"first_page_url,omitempty"`
20+
Key string `json:"key,omitempty"`
2021
NextPageUrl *string `json:"next_page_url,omitempty"`
2122
Page int `json:"page,omitempty"`
2223
PageSize int `json:"page_size,omitempty"`
2324
PreviousPageUrl *string `json:"previous_page_url,omitempty"`
2425
Url string `json:"url,omitempty"`
25-
Key string `json:"key,omitempty"`
2626
}

rest/api/v2010/safe_list_numbers.go renamed to rest/accounts/v1/safe_list_numbers.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
55
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
66
*
7-
* Twilio - Api
7+
* Twilio - Accounts
88
* This is the public Twilio REST API.
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator.
@@ -31,8 +31,8 @@ func (params *CreateSafelistParams) SetPhoneNumber(PhoneNumber string) *CreateSa
3131
}
3232

3333
// Add a new phone number to SafeList.
34-
func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*ApiV2010Safelist, error) {
35-
path := "/2010-04-01/SafeList/Numbers.json"
34+
func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*AccountsV1Safelist, error) {
35+
path := "/v1/SafeList/Numbers"
3636

3737
data := url.Values{}
3838
headers := make(map[string]interface{})
@@ -48,7 +48,7 @@ func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*ApiV2010Safe
4848

4949
defer resp.Body.Close()
5050

51-
ps := &ApiV2010Safelist{}
51+
ps := &AccountsV1Safelist{}
5252
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
5353
return nil, err
5454
}
@@ -69,7 +69,7 @@ func (params *DeleteSafelistParams) SetPhoneNumber(PhoneNumber string) *DeleteSa
6969

7070
// Remove a phone number from SafeList.
7171
func (c *ApiService) DeleteSafelist(params *DeleteSafelistParams) error {
72-
path := "/2010-04-01/SafeList/Numbers.json"
72+
path := "/v1/SafeList/Numbers"
7373

7474
data := url.Values{}
7575
headers := make(map[string]interface{})
@@ -100,8 +100,8 @@ func (params *FetchSafelistParams) SetPhoneNumber(PhoneNumber string) *FetchSafe
100100
}
101101

102102
// Check if a phone number exists in SafeList.
103-
func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*ApiV2010Safelist, error) {
104-
path := "/2010-04-01/SafeList/Numbers.json"
103+
func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*AccountsV1Safelist, error) {
104+
path := "/v1/SafeList/Numbers"
105105

106106
data := url.Values{}
107107
headers := make(map[string]interface{})
@@ -117,7 +117,7 @@ func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*ApiV2010Safeli
117117

118118
defer resp.Body.Close()
119119

120-
ps := &ApiV2010Safelist{}
120+
ps := &AccountsV1Safelist{}
121121
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
122122
return nil, err
123123
}

0 commit comments

Comments
 (0)