Skip to content

Commit c19a06d

Browse files
committed
[Librarian] Regenerated @ 08245333f4a8c9235d547b189cd9c422f73e0e7e 7bb98153c25ebfee95e6e85bd4c57969e6d02435
1 parent 10d3610 commit c19a06d

39 files changed

+1382
-33
lines changed

CHANGES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
twilio-go changelog
22
====================
3+
[2024-09-25] Version 1.23.2
4+
---------------------------
5+
**Accounts**
6+
- Update docs and mounts.
7+
- Change library visibility to public
8+
- Enable consent and contact bulk upsert APIs in prod.
9+
10+
**Serverless**
11+
- Add is_plugin parameter in deployments api to check if it is plugins deployment
12+
13+
314
[2024-09-18] Version 1.23.1
415
---------------------------
516
**Library - Fix**

rest/accounts/v1/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Class | Method | HTTP request | Description
3434
*AuthTokensPromoteApi* | [**UpdateAuthTokenPromotion**](docs/AuthTokensPromoteApi.md#updateauthtokenpromotion) | **Post** /v1/AuthTokens/Promote |
3535
*AuthTokensSecondaryApi* | [**CreateSecondaryAuthToken**](docs/AuthTokensSecondaryApi.md#createsecondaryauthtoken) | **Post** /v1/AuthTokens/Secondary |
3636
*AuthTokensSecondaryApi* | [**DeleteSecondaryAuthToken**](docs/AuthTokensSecondaryApi.md#deletesecondaryauthtoken) | **Delete** /v1/AuthTokens/Secondary |
37+
*ConsentsBulkApi* | [**CreateBulkConsents**](docs/ConsentsBulkApi.md#createbulkconsents) | **Post** /v1/Consents/Bulk |
38+
*ContactsBulkApi* | [**CreateBulkContacts**](docs/ContactsBulkApi.md#createbulkcontacts) | **Post** /v1/Contacts/Bulk |
3739
*CredentialsAWSApi* | [**CreateCredentialAws**](docs/CredentialsAWSApi.md#createcredentialaws) | **Post** /v1/Credentials/AWS |
3840
*CredentialsAWSApi* | [**DeleteCredentialAws**](docs/CredentialsAWSApi.md#deletecredentialaws) | **Delete** /v1/Credentials/AWS/{Sid} |
3941
*CredentialsAWSApi* | [**FetchCredentialAws**](docs/CredentialsAWSApi.md#fetchcredentialaws) | **Get** /v1/Credentials/AWS/{Sid} |
@@ -51,6 +53,8 @@ Class | Method | HTTP request | Description
5153

5254
## Documentation For Models
5355

56+
- [AccountsV1BulkContacts](docs/AccountsV1BulkContacts.md)
57+
- [AccountsV1BulkConsents](docs/AccountsV1BulkConsents.md)
5458
- [ListCredentialAwsResponse](docs/ListCredentialAwsResponse.md)
5559
- [ListCredentialPublicKeyResponse](docs/ListCredentialPublicKeyResponse.md)
5660
- [AccountsV1SecondaryAuthToken](docs/AccountsV1SecondaryAuthToken.md)

rest/accounts/v1/consents_bulk.go

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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+
)
21+
22+
// Optional parameters for the method 'CreateBulkConsents'
23+
type CreateBulkConsentsParams struct {
24+
// This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`].
25+
Items *[]interface{} `json:"Items,omitempty"`
26+
}
27+
28+
func (params *CreateBulkConsentsParams) SetItems(Items []interface{}) *CreateBulkConsentsParams {
29+
params.Items = &Items
30+
return params
31+
}
32+
33+
//
34+
func (c *ApiService) CreateBulkConsents(params *CreateBulkConsentsParams) (*AccountsV1BulkConsents, error) {
35+
path := "/v1/Consents/Bulk"
36+
37+
data := url.Values{}
38+
headers := map[string]interface{}{
39+
"Content-Type": "application/x-www-form-urlencoded",
40+
}
41+
42+
if params != nil && params.Items != nil {
43+
for _, item := range *params.Items {
44+
v, err := json.Marshal(item)
45+
46+
if err != nil {
47+
return nil, err
48+
}
49+
50+
data.Add("Items", string(v))
51+
}
52+
}
53+
54+
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
55+
if err != nil {
56+
return nil, err
57+
}
58+
59+
defer resp.Body.Close()
60+
61+
ps := &AccountsV1BulkConsents{}
62+
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
63+
return nil, err
64+
}
65+
66+
return ps, err
67+
}

rest/accounts/v1/contacts_bulk.go

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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+
)
21+
22+
// Optional parameters for the method 'CreateBulkContacts'
23+
type CreateBulkContactsParams struct {
24+
// A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code.
25+
Items *[]interface{} `json:"Items,omitempty"`
26+
}
27+
28+
func (params *CreateBulkContactsParams) SetItems(Items []interface{}) *CreateBulkContactsParams {
29+
params.Items = &Items
30+
return params
31+
}
32+
33+
//
34+
func (c *ApiService) CreateBulkContacts(params *CreateBulkContactsParams) (*AccountsV1BulkContacts, error) {
35+
path := "/v1/Contacts/Bulk"
36+
37+
data := url.Values{}
38+
headers := map[string]interface{}{
39+
"Content-Type": "application/x-www-form-urlencoded",
40+
}
41+
42+
if params != nil && params.Items != nil {
43+
for _, item := range *params.Items {
44+
v, err := json.Marshal(item)
45+
46+
if err != nil {
47+
return nil, err
48+
}
49+
50+
data.Add("Items", string(v))
51+
}
52+
}
53+
54+
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
55+
if err != nil {
56+
return nil, err
57+
}
58+
59+
defer resp.Body.Close()
60+
61+
ps := &AccountsV1BulkContacts{}
62+
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
63+
return nil, err
64+
}
65+
66+
return ps, err
67+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AccountsV1BulkConsents
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Items** | Pointer to **interface{}** | A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty. |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AccountsV1BulkContacts
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Items** | Pointer to **interface{}** | A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty. |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ConsentsBulkApi
2+
3+
All URIs are relative to *https://accounts.twilio.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**CreateBulkConsents**](ConsentsBulkApi.md#CreateBulkConsents) | **Post** /v1/Consents/Bulk |
8+
9+
10+
11+
## CreateBulkConsents
12+
13+
> AccountsV1BulkConsents CreateBulkConsents(ctx, optional)
14+
15+
16+
17+
18+
19+
### Path Parameters
20+
21+
This endpoint does not need any path parameter.
22+
23+
### Other Parameters
24+
25+
Other parameters are passed through a pointer to a CreateBulkConsentsParams struct
26+
27+
28+
Name | Type | Description
29+
------------- | ------------- | -------------
30+
**Items** | **[]interface{}** | This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`].
31+
32+
### Return type
33+
34+
[**AccountsV1BulkConsents**](AccountsV1BulkConsents.md)
35+
36+
### Authorization
37+
38+
[accountSid_authToken](../README.md#accountSid_authToken)
39+
40+
### HTTP request headers
41+
42+
- **Content-Type**: application/x-www-form-urlencoded
43+
- **Accept**: application/json
44+
45+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
46+
[[Back to Model list]](../README.md#documentation-for-models)
47+
[[Back to README]](../README.md)
48+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ContactsBulkApi
2+
3+
All URIs are relative to *https://accounts.twilio.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**CreateBulkContacts**](ContactsBulkApi.md#CreateBulkContacts) | **Post** /v1/Contacts/Bulk |
8+
9+
10+
11+
## CreateBulkContacts
12+
13+
> AccountsV1BulkContacts CreateBulkContacts(ctx, optional)
14+
15+
16+
17+
18+
19+
### Path Parameters
20+
21+
This endpoint does not need any path parameter.
22+
23+
### Other Parameters
24+
25+
Other parameters are passed through a pointer to a CreateBulkContactsParams struct
26+
27+
28+
Name | Type | Description
29+
------------- | ------------- | -------------
30+
**Items** | **[]interface{}** | A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code.
31+
32+
### Return type
33+
34+
[**AccountsV1BulkContacts**](AccountsV1BulkContacts.md)
35+
36+
### Authorization
37+
38+
[accountSid_authToken](../README.md#accountSid_authToken)
39+
40+
### HTTP request headers
41+
42+
- **Content-Type**: application/x-www-form-urlencoded
43+
- **Accept**: application/json
44+
45+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
46+
[[Back to Model list]](../README.md#documentation-for-models)
47+
[[Back to README]](../README.md)
48+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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+
// AccountsV1BulkConsents struct for AccountsV1BulkConsents
18+
type AccountsV1BulkConsents struct {
19+
// A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
20+
Items *interface{} `json:"items,omitempty"`
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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+
// AccountsV1BulkContacts struct for AccountsV1BulkContacts
18+
type AccountsV1BulkContacts struct {
19+
// A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
20+
Items *interface{} `json:"items,omitempty"`
21+
}

0 commit comments

Comments
 (0)