openapi

package
v0.0.0-...-e041b52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 6 Imported by: 0

README

Go API client for openapi

This is the public Twilio REST API.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/twilio-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.52.1
  • Package version: 1.0.0
  • Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit https://support.twilio.com

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://accounts.twilio.com

Class Method HTTP request Description
AuthTokensPromoteApi UpdateAuthTokenPromotion Post /v1/AuthTokens/Promote
AuthTokensSecondaryApi CreateSecondaryAuthToken Post /v1/AuthTokens/Secondary
AuthTokensSecondaryApi DeleteSecondaryAuthToken Delete /v1/AuthTokens/Secondary
CredentialsAWSApi CreateCredentialAws Post /v1/Credentials/AWS
CredentialsAWSApi DeleteCredentialAws Delete /v1/Credentials/AWS/{Sid}
CredentialsAWSApi FetchCredentialAws Get /v1/Credentials/AWS/{Sid}
CredentialsAWSApi ListCredentialAws Get /v1/Credentials/AWS
CredentialsAWSApi UpdateCredentialAws Post /v1/Credentials/AWS/{Sid}
CredentialsPublicKeysApi CreateCredentialPublicKey Post /v1/Credentials/PublicKeys
CredentialsPublicKeysApi DeleteCredentialPublicKey Delete /v1/Credentials/PublicKeys/{Sid}
CredentialsPublicKeysApi FetchCredentialPublicKey Get /v1/Credentials/PublicKeys/{Sid}
CredentialsPublicKeysApi ListCredentialPublicKey Get /v1/Credentials/PublicKeys
CredentialsPublicKeysApi UpdateCredentialPublicKey Post /v1/Credentials/PublicKeys/{Sid}
SafeListNumbersApi CreateSafelist Post /v1/SafeList/Numbers
SafeListNumbersApi DeleteSafelist Delete /v1/SafeList/Numbers
SafeListNumbersApi FetchSafelist Get /v1/SafeList/Numbers

Documentation For Models

Documentation For Authorization

accountSid_authToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsV1AuthTokenPromotion

type AccountsV1AuthTokenPromotion struct {
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for.
	AccountSid *string `json:"account_sid,omitempty"`
	// The promoted Auth Token that must be used to authenticate future API requests.
	AuthToken *string `json:"auth_token,omitempty"`
	// The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The URI for this resource, relative to `https://accounts.twilio.com`
	Url *string `json:"url,omitempty"`
}

AccountsV1AuthTokenPromotion struct for AccountsV1AuthTokenPromotion

type AccountsV1CredentialAws

type AccountsV1CredentialAws struct {
	// The unique string that we created to identify the AWS resource.
	Sid *string `json:"sid,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AWS resource.
	AccountSid *string `json:"account_sid,omitempty"`
	// The string that you assigned to describe the resource.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The URI for this resource, relative to `https://accounts.twilio.com`
	Url *string `json:"url,omitempty"`
}

AccountsV1CredentialAws struct for AccountsV1CredentialAws

type AccountsV1CredentialPublicKey

type AccountsV1CredentialPublicKey struct {
	// The unique string that that we created to identify the PublicKey resource.
	Sid *string `json:"sid,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Credential that the PublicKey resource belongs to.
	AccountSid *string `json:"account_sid,omitempty"`
	// The string that you assigned to describe the resource.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The URI for this resource, relative to `https://accounts.twilio.com`
	Url *string `json:"url,omitempty"`
}

AccountsV1CredentialPublicKey struct for AccountsV1CredentialPublicKey

type AccountsV1Safelist

type AccountsV1Safelist 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"`
}

AccountsV1Safelist struct for AccountsV1Safelist

type AccountsV1SecondaryAuthToken

type AccountsV1SecondaryAuthToken struct {
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for.
	AccountSid *string `json:"account_sid,omitempty"`
	// The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in UTC when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The generated secondary Auth Token that can be used to authenticate future API requests.
	SecondaryAuthToken *string `json:"secondary_auth_token,omitempty"`
	// The URI for this resource, relative to `https://accounts.twilio.com`
	Url *string `json:"url,omitempty"`
}

AccountsV1SecondaryAuthToken struct for AccountsV1SecondaryAuthToken

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) CreateCredentialAws

func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*AccountsV1CredentialAws, error)

Create a new AWS Credential

func (*ApiService) CreateCredentialPublicKey

func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKeyParams) (*AccountsV1CredentialPublicKey, error)

Create a new Public Key Credential

func (*ApiService) CreateSafelist

func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*AccountsV1Safelist, error)

Add a new phone number to SafeList.

func (*ApiService) CreateSecondaryAuthToken

func (c *ApiService) CreateSecondaryAuthToken() (*AccountsV1SecondaryAuthToken, error)

Create a new secondary Auth Token

func (*ApiService) DeleteCredentialAws

func (c *ApiService) DeleteCredentialAws(Sid string) error

Delete a Credential from your account

func (*ApiService) DeleteCredentialPublicKey

func (c *ApiService) DeleteCredentialPublicKey(Sid string) error

Delete a Credential from your account

func (*ApiService) DeleteSafelist

func (c *ApiService) DeleteSafelist(params *DeleteSafelistParams) error

Remove a phone number from SafeList.

func (*ApiService) DeleteSecondaryAuthToken

func (c *ApiService) DeleteSecondaryAuthToken() error

Delete the secondary Auth Token from your account

func (*ApiService) FetchCredentialAws

func (c *ApiService) FetchCredentialAws(Sid string) (*AccountsV1CredentialAws, error)

Fetch the AWS credentials specified by the provided Credential Sid

func (*ApiService) FetchCredentialPublicKey

func (c *ApiService) FetchCredentialPublicKey(Sid string) (*AccountsV1CredentialPublicKey, error)

Fetch the public key specified by the provided Credential Sid

func (*ApiService) FetchSafelist

func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*AccountsV1Safelist, error)

Check if a phone number exists in SafeList.

func (*ApiService) ListCredentialAws

func (c *ApiService) ListCredentialAws(params *ListCredentialAwsParams) ([]AccountsV1CredentialAws, error)

Lists CredentialAws records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) ListCredentialPublicKey

func (c *ApiService) ListCredentialPublicKey(params *ListCredentialPublicKeyParams) ([]AccountsV1CredentialPublicKey, error)

Lists CredentialPublicKey records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) PageCredentialAws

func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToken, pageNumber string) (*ListCredentialAwsResponse, error)

Retrieve a single page of CredentialAws records from the API. Request is executed immediately.

func (*ApiService) PageCredentialPublicKey

func (c *ApiService) PageCredentialPublicKey(params *ListCredentialPublicKeyParams, pageToken, pageNumber string) (*ListCredentialPublicKeyResponse, error)

Retrieve a single page of CredentialPublicKey records from the API. Request is executed immediately.

func (*ApiService) StreamCredentialAws

func (c *ApiService) StreamCredentialAws(params *ListCredentialAwsParams) (chan AccountsV1CredentialAws, chan error)

Streams CredentialAws records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) StreamCredentialPublicKey

func (c *ApiService) StreamCredentialPublicKey(params *ListCredentialPublicKeyParams) (chan AccountsV1CredentialPublicKey, chan error)

Streams CredentialPublicKey records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) UpdateAuthTokenPromotion

func (c *ApiService) UpdateAuthTokenPromotion() (*AccountsV1AuthTokenPromotion, error)

Promote the secondary Auth Token to primary. After promoting the new token, all requests to Twilio using your old primary Auth Token will result in an error.

func (*ApiService) UpdateCredentialAws

func (c *ApiService) UpdateCredentialAws(Sid string, params *UpdateCredentialAwsParams) (*AccountsV1CredentialAws, error)

Modify the properties of a given Account

func (*ApiService) UpdateCredentialPublicKey

func (c *ApiService) UpdateCredentialPublicKey(Sid string, params *UpdateCredentialPublicKeyParams) (*AccountsV1CredentialPublicKey, error)

Modify the properties of a given Account

type CreateCredentialAwsParams

type CreateCredentialAwsParams struct {
	// A string that contains the AWS access credentials in the format `<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
	Credentials *string `json:"Credentials,omitempty"`
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request.
	AccountSid *string `json:"AccountSid,omitempty"`
}

Optional parameters for the method 'CreateCredentialAws'

func (*CreateCredentialAwsParams) SetAccountSid

func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) *CreateCredentialAwsParams

func (*CreateCredentialAwsParams) SetCredentials

func (params *CreateCredentialAwsParams) SetCredentials(Credentials string) *CreateCredentialAwsParams

func (*CreateCredentialAwsParams) SetFriendlyName

func (params *CreateCredentialAwsParams) SetFriendlyName(FriendlyName string) *CreateCredentialAwsParams

type CreateCredentialPublicKeyParams

type CreateCredentialPublicKeyParams struct {
	// A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----`
	PublicKey *string `json:"PublicKey,omitempty"`
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request
	AccountSid *string `json:"AccountSid,omitempty"`
}

Optional parameters for the method 'CreateCredentialPublicKey'

func (*CreateCredentialPublicKeyParams) SetAccountSid

func (params *CreateCredentialPublicKeyParams) SetAccountSid(AccountSid string) *CreateCredentialPublicKeyParams

func (*CreateCredentialPublicKeyParams) SetFriendlyName

func (params *CreateCredentialPublicKeyParams) SetFriendlyName(FriendlyName string) *CreateCredentialPublicKeyParams

func (*CreateCredentialPublicKeyParams) SetPublicKey

type CreateSafelistParams

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"`
}

Optional parameters for the method 'CreateSafelist'

func (*CreateSafelistParams) SetPhoneNumber

func (params *CreateSafelistParams) SetPhoneNumber(PhoneNumber string) *CreateSafelistParams

type DeleteSafelistParams

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"`
}

Optional parameters for the method 'DeleteSafelist'

func (*DeleteSafelistParams) SetPhoneNumber

func (params *DeleteSafelistParams) SetPhoneNumber(PhoneNumber string) *DeleteSafelistParams

type FetchSafelistParams

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"`
}

Optional parameters for the method 'FetchSafelist'

func (*FetchSafelistParams) SetPhoneNumber

func (params *FetchSafelistParams) SetPhoneNumber(PhoneNumber string) *FetchSafelistParams

type ListCredentialAwsParams

type ListCredentialAwsParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListCredentialAws'

func (*ListCredentialAwsParams) SetLimit

func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsParams

func (*ListCredentialAwsParams) SetPageSize

func (params *ListCredentialAwsParams) SetPageSize(PageSize int) *ListCredentialAwsParams

type ListCredentialAwsResponse

type ListCredentialAwsResponse struct {
	Credentials []AccountsV1CredentialAws     `json:"credentials,omitempty"`
	Meta        ListCredentialAwsResponseMeta `json:"meta,omitempty"`
}

ListCredentialAwsResponse struct for ListCredentialAwsResponse

type ListCredentialAwsResponseMeta

type ListCredentialAwsResponseMeta struct {
	FirstPageUrl    string  `json:"first_page_url,omitempty"`
	NextPageUrl     *string `json:"next_page_url,omitempty"`
	Page            int     `json:"page,omitempty"`
	PageSize        int     `json:"page_size,omitempty"`
	PreviousPageUrl *string `json:"previous_page_url,omitempty"`
	Url             string  `json:"url,omitempty"`
	Key             string  `json:"key,omitempty"`
}

ListCredentialAwsResponseMeta struct for ListCredentialAwsResponseMeta

type ListCredentialPublicKeyParams

type ListCredentialPublicKeyParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListCredentialPublicKey'

func (*ListCredentialPublicKeyParams) SetLimit

func (*ListCredentialPublicKeyParams) SetPageSize

func (params *ListCredentialPublicKeyParams) SetPageSize(PageSize int) *ListCredentialPublicKeyParams

type ListCredentialPublicKeyResponse

type ListCredentialPublicKeyResponse struct {
	Credentials []AccountsV1CredentialPublicKey `json:"credentials,omitempty"`
	Meta        ListCredentialAwsResponseMeta   `json:"meta,omitempty"`
}

ListCredentialPublicKeyResponse struct for ListCredentialPublicKeyResponse

type UpdateCredentialAwsParams

type UpdateCredentialAwsParams struct {
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
}

Optional parameters for the method 'UpdateCredentialAws'

func (*UpdateCredentialAwsParams) SetFriendlyName

func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) *UpdateCredentialAwsParams

type UpdateCredentialPublicKeyParams

type UpdateCredentialPublicKeyParams struct {
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
}

Optional parameters for the method 'UpdateCredentialPublicKey'

func (*UpdateCredentialPublicKeyParams) SetFriendlyName

func (params *UpdateCredentialPublicKeyParams) SetFriendlyName(FriendlyName string) *UpdateCredentialPublicKeyParams

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL