-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pass_query_param_in_delete
- Loading branch information
Showing
73 changed files
with
2,366 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Accounts | ||
* This is the public Twilio REST API. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
package openapi | ||
|
||
import ( | ||
"encoding/json" | ||
"net/url" | ||
) | ||
|
||
// Optional parameters for the method 'CreateBulkConsents' | ||
type CreateBulkConsentsParams struct { | ||
// 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`]. | ||
Items *[]interface{} `json:"Items,omitempty"` | ||
} | ||
|
||
func (params *CreateBulkConsentsParams) SetItems(Items []interface{}) *CreateBulkConsentsParams { | ||
params.Items = &Items | ||
return params | ||
} | ||
|
||
// | ||
func (c *ApiService) CreateBulkConsents(params *CreateBulkConsentsParams) (*AccountsV1BulkConsents, error) { | ||
path := "/v1/Consents/Bulk" | ||
|
||
data := url.Values{} | ||
headers := map[string]interface{}{ | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
} | ||
|
||
if params != nil && params.Items != nil { | ||
for _, item := range *params.Items { | ||
v, err := json.Marshal(item) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
data.Add("Items", string(v)) | ||
} | ||
} | ||
|
||
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
defer resp.Body.Close() | ||
|
||
ps := &AccountsV1BulkConsents{} | ||
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { | ||
return nil, err | ||
} | ||
|
||
return ps, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Accounts | ||
* This is the public Twilio REST API. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
package openapi | ||
|
||
import ( | ||
"encoding/json" | ||
"net/url" | ||
) | ||
|
||
// Optional parameters for the method 'CreateBulkContacts' | ||
type CreateBulkContactsParams struct { | ||
// 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. | ||
Items *[]interface{} `json:"Items,omitempty"` | ||
} | ||
|
||
func (params *CreateBulkContactsParams) SetItems(Items []interface{}) *CreateBulkContactsParams { | ||
params.Items = &Items | ||
return params | ||
} | ||
|
||
// | ||
func (c *ApiService) CreateBulkContacts(params *CreateBulkContactsParams) (*AccountsV1BulkContacts, error) { | ||
path := "/v1/Contacts/Bulk" | ||
|
||
data := url.Values{} | ||
headers := map[string]interface{}{ | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
} | ||
|
||
if params != nil && params.Items != nil { | ||
for _, item := range *params.Items { | ||
v, err := json.Marshal(item) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
data.Add("Items", string(v)) | ||
} | ||
} | ||
|
||
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
defer resp.Body.Close() | ||
|
||
ps := &AccountsV1BulkContacts{} | ||
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { | ||
return nil, err | ||
} | ||
|
||
return ps, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# AccountsV1BulkConsents | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**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. | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# AccountsV1BulkContacts | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**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. | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# ConsentsBulkApi | ||
|
||
All URIs are relative to *https://accounts.twilio.com* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**CreateBulkConsents**](ConsentsBulkApi.md#CreateBulkConsents) | **Post** /v1/Consents/Bulk | | ||
|
||
|
||
|
||
## CreateBulkConsents | ||
|
||
> AccountsV1BulkConsents CreateBulkConsents(ctx, optional) | ||
|
||
|
||
|
||
|
||
### Path Parameters | ||
|
||
This endpoint does not need any path parameter. | ||
|
||
### Other Parameters | ||
|
||
Other parameters are passed through a pointer to a CreateBulkConsentsParams struct | ||
|
||
|
||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**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`]. | ||
|
||
### Return type | ||
|
||
[**AccountsV1BulkConsents**](AccountsV1BulkConsents.md) | ||
|
||
### Authorization | ||
|
||
[accountSid_authToken](../README.md#accountSid_authToken) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: application/x-www-form-urlencoded | ||
- **Accept**: application/json | ||
|
||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) | ||
[[Back to Model list]](../README.md#documentation-for-models) | ||
[[Back to README]](../README.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# ContactsBulkApi | ||
|
||
All URIs are relative to *https://accounts.twilio.com* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**CreateBulkContacts**](ContactsBulkApi.md#CreateBulkContacts) | **Post** /v1/Contacts/Bulk | | ||
|
||
|
||
|
||
## CreateBulkContacts | ||
|
||
> AccountsV1BulkContacts CreateBulkContacts(ctx, optional) | ||
|
||
|
||
|
||
|
||
### Path Parameters | ||
|
||
This endpoint does not need any path parameter. | ||
|
||
### Other Parameters | ||
|
||
Other parameters are passed through a pointer to a CreateBulkContactsParams struct | ||
|
||
|
||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**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. | ||
|
||
### Return type | ||
|
||
[**AccountsV1BulkContacts**](AccountsV1BulkContacts.md) | ||
|
||
### Authorization | ||
|
||
[accountSid_authToken](../README.md#accountSid_authToken) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: application/x-www-form-urlencoded | ||
- **Accept**: application/json | ||
|
||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) | ||
[[Back to Model list]](../README.md#documentation-for-models) | ||
[[Back to README]](../README.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Accounts | ||
* This is the public Twilio REST API. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
package openapi | ||
|
||
// AccountsV1BulkConsents struct for AccountsV1BulkConsents | ||
type AccountsV1BulkConsents struct { | ||
// 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. | ||
Items *interface{} `json:"items,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Accounts | ||
* This is the public Twilio REST API. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
package openapi | ||
|
||
// AccountsV1BulkContacts struct for AccountsV1BulkContacts | ||
type AccountsV1BulkContacts struct { | ||
// 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. | ||
Items *interface{} `json:"items,omitempty"` | ||
} |
Oops, something went wrong.