-
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.
[Librarian] Regenerated @ c9ac9b9736431d573d8dec29ad3095eee969cdea
- Loading branch information
Showing
100 changed files
with
535 additions
and
104 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
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,12 @@ | ||
# ApiV2010Safelist | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**Sid** | Pointer to **string** | The unique string that we created to identify the SafeList resource. | | ||
**PhoneNumber** | Pointer to **string** | The phone number in SafeList. | | ||
|
||
[[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,128 @@ | ||
# SafeListNumbersApi | ||
|
||
All URIs are relative to *https://api.twilio.com* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**CreateSafelist**](SafeListNumbersApi.md#CreateSafelist) | **Post** /2010-04-01/SafeList/Numbers.json | | ||
[**DeleteSafelist**](SafeListNumbersApi.md#DeleteSafelist) | **Delete** /2010-04-01/SafeList/Numbers.json | | ||
[**FetchSafelist**](SafeListNumbersApi.md#FetchSafelist) | **Get** /2010-04-01/SafeList/Numbers.json | | ||
|
||
|
||
|
||
## CreateSafelist | ||
|
||
> ApiV2010Safelist CreateSafelist(ctx, optional) | ||
|
||
|
||
Add a new phone number to SafeList. | ||
|
||
### Path Parameters | ||
|
||
This endpoint does not need any path parameter. | ||
|
||
### Other Parameters | ||
|
||
Other parameters are passed through a pointer to a CreateSafelistParams struct | ||
|
||
|
||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**PhoneNumber** | **string** | The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). | ||
|
||
### Return type | ||
|
||
[**ApiV2010Safelist**](ApiV2010Safelist.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) | ||
|
||
|
||
## DeleteSafelist | ||
|
||
> DeleteSafelist(ctx, optional) | ||
|
||
|
||
Remove a phone number from SafeList. | ||
|
||
### Path Parameters | ||
|
||
This endpoint does not need any path parameter. | ||
|
||
### Other Parameters | ||
|
||
Other parameters are passed through a pointer to a DeleteSafelistParams struct | ||
|
||
|
||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**PhoneNumber** | **string** | The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). | ||
|
||
### Return type | ||
|
||
(empty response body) | ||
|
||
### Authorization | ||
|
||
[accountSid_authToken](../README.md#accountSid_authToken) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: Not defined | ||
|
||
[[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) | ||
|
||
|
||
## FetchSafelist | ||
|
||
> ApiV2010Safelist FetchSafelist(ctx, optional) | ||
|
||
|
||
Check if a phone number exists in SafeList. | ||
|
||
### Path Parameters | ||
|
||
This endpoint does not need any path parameter. | ||
|
||
### Other Parameters | ||
|
||
Other parameters are passed through a pointer to a FetchSafelistParams struct | ||
|
||
|
||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**PhoneNumber** | **string** | The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). | ||
|
||
### Return type | ||
|
||
[**ApiV2010Safelist**](ApiV2010Safelist.md) | ||
|
||
### Authorization | ||
|
||
[accountSid_authToken](../README.md#accountSid_authToken) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **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,23 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Api | ||
* 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 | ||
|
||
// ApiV2010Safelist struct for ApiV2010Safelist | ||
type ApiV2010Safelist struct { | ||
// The unique string that we created to identify the SafeList resource. | ||
Sid *string `json:"sid,omitempty"` | ||
// The phone number in SafeList. | ||
PhoneNumber *string `json:"phone_number,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,126 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Api | ||
* 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 'CreateSafelist' | ||
type CreateSafelistParams struct { | ||
// The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). | ||
PhoneNumber *string `json:"PhoneNumber,omitempty"` | ||
} | ||
|
||
func (params *CreateSafelistParams) SetPhoneNumber(PhoneNumber string) *CreateSafelistParams { | ||
params.PhoneNumber = &PhoneNumber | ||
return params | ||
} | ||
|
||
// Add a new phone number to SafeList. | ||
func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*ApiV2010Safelist, error) { | ||
path := "/2010-04-01/SafeList/Numbers.json" | ||
|
||
data := url.Values{} | ||
headers := make(map[string]interface{}) | ||
|
||
if params != nil && params.PhoneNumber != nil { | ||
data.Set("PhoneNumber", *params.PhoneNumber) | ||
} | ||
|
||
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
defer resp.Body.Close() | ||
|
||
ps := &ApiV2010Safelist{} | ||
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { | ||
return nil, err | ||
} | ||
|
||
return ps, err | ||
} | ||
|
||
// Optional parameters for the method 'DeleteSafelist' | ||
type DeleteSafelistParams struct { | ||
// The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). | ||
PhoneNumber *string `json:"PhoneNumber,omitempty"` | ||
} | ||
|
||
func (params *DeleteSafelistParams) SetPhoneNumber(PhoneNumber string) *DeleteSafelistParams { | ||
params.PhoneNumber = &PhoneNumber | ||
return params | ||
} | ||
|
||
// Remove a phone number from SafeList. | ||
func (c *ApiService) DeleteSafelist(params *DeleteSafelistParams) error { | ||
path := "/2010-04-01/SafeList/Numbers.json" | ||
|
||
data := url.Values{} | ||
headers := make(map[string]interface{}) | ||
|
||
if params != nil && params.PhoneNumber != nil { | ||
data.Set("PhoneNumber", *params.PhoneNumber) | ||
} | ||
|
||
resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
defer resp.Body.Close() | ||
|
||
return nil | ||
} | ||
|
||
// Optional parameters for the method 'FetchSafelist' | ||
type FetchSafelistParams struct { | ||
// The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). | ||
PhoneNumber *string `json:"PhoneNumber,omitempty"` | ||
} | ||
|
||
func (params *FetchSafelistParams) SetPhoneNumber(PhoneNumber string) *FetchSafelistParams { | ||
params.PhoneNumber = &PhoneNumber | ||
return params | ||
} | ||
|
||
// Check if a phone number exists in SafeList. | ||
func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*ApiV2010Safelist, error) { | ||
path := "/2010-04-01/SafeList/Numbers.json" | ||
|
||
data := url.Values{} | ||
headers := make(map[string]interface{}) | ||
|
||
if params != nil && params.PhoneNumber != nil { | ||
data.Set("PhoneNumber", *params.PhoneNumber) | ||
} | ||
|
||
resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
defer resp.Body.Close() | ||
|
||
ps := &ApiV2010Safelist{} | ||
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
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
Oops, something went wrong.