openapi

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 6 Imported by: 1

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.17.0
  • 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
DefaultApi CreateCredentialAws Post /v1/Credentials/AWS
DefaultApi CreateCredentialPublicKey Post /v1/Credentials/PublicKeys
DefaultApi CreateSecondaryAuthToken Post /v1/AuthTokens/Secondary
DefaultApi DeleteCredentialAws Delete /v1/Credentials/AWS/{Sid}
DefaultApi DeleteCredentialPublicKey Delete /v1/Credentials/PublicKeys/{Sid}
DefaultApi DeleteSecondaryAuthToken Delete /v1/AuthTokens/Secondary
DefaultApi FetchCredentialAws Get /v1/Credentials/AWS/{Sid}
DefaultApi FetchCredentialPublicKey Get /v1/Credentials/PublicKeys/{Sid}
DefaultApi ListCredentialAws Get /v1/Credentials/AWS
DefaultApi ListCredentialPublicKey Get /v1/Credentials/PublicKeys
DefaultApi UpdateAuthTokenPromotion Post /v1/AuthTokens/Promote
DefaultApi UpdateCredentialAws Post /v1/Credentials/AWS/{Sid}
DefaultApi UpdateCredentialPublicKey Post /v1/Credentials/PublicKeys/{Sid}

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)

Author

support@twilio.com

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 that the secondary Auth Token was created for
	AccountSid *string `json:"account_sid,omitempty"`
	// The promoted Auth Token
	AuthToken *string `json:"auth_token,omitempty"`
	// The ISO 8601 formatted date and time in UTC when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 formatted date and time in UTC when the resource was last updated
	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 AccountsV1CredentialCredentialAws

type AccountsV1CredentialCredentialAws struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The RFC 2822 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The RFC 2822 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The string that you assigned to describe the resource
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The URI for this resource, relative to `https://accounts.twilio.com`
	Url *string `json:"url,omitempty"`
}

AccountsV1CredentialCredentialAws struct for AccountsV1CredentialCredentialAws

type AccountsV1CredentialCredentialPublicKey

type AccountsV1CredentialCredentialPublicKey struct {
	// The SID of the Account that created the Credential that the PublicKey resource belongs to
	AccountSid *string `json:"account_sid,omitempty"`
	// The RFC 2822 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The RFC 2822 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The string that you assigned to describe the resource
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The URI for this resource, relative to `https://accounts.twilio.com`
	Url *string `json:"url,omitempty"`
}

AccountsV1CredentialCredentialPublicKey struct for AccountsV1CredentialCredentialPublicKey

type AccountsV1SecondaryAuthToken

type AccountsV1SecondaryAuthToken struct {
	// The SID of the Account that the secondary Auth Token was created for
	AccountSid *string `json:"account_sid,omitempty"`
	// The ISO 8601 formatted date and time in UTC when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 formatted date and time in UTC when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The generated secondary Auth Token
	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 CreateCredentialAwsParams

type CreateCredentialAwsParams struct {
	// 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"`
	// 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"`
}

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 {
	// 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"`
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----`
	PublicKey *string `json:"PublicKey,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 DefaultApiService

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

func NewDefaultApiService

func NewDefaultApiService(requestHandler *twilio.RequestHandler) *DefaultApiService

func NewDefaultApiServiceWithClient added in v0.9.0

func NewDefaultApiServiceWithClient(client twilio.BaseClient) *DefaultApiService

func (*DefaultApiService) CreateCredentialAws

Create a new AWS Credential

func (*DefaultApiService) CreateCredentialPublicKey

Create a new Public Key Credential

func (*DefaultApiService) CreateSecondaryAuthToken

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

Create a new secondary Auth Token

func (*DefaultApiService) DeleteCredentialAws

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

Delete a Credential from your account

func (*DefaultApiService) DeleteCredentialPublicKey

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

Delete a Credential from your account

func (*DefaultApiService) DeleteSecondaryAuthToken

func (c *DefaultApiService) DeleteSecondaryAuthToken() error

Delete the secondary Auth Token from your account

func (*DefaultApiService) FetchCredentialAws

func (c *DefaultApiService) FetchCredentialAws(Sid string) (*AccountsV1CredentialCredentialAws, error)

Fetch the AWS credentials specified by the provided Credential Sid

func (*DefaultApiService) FetchCredentialPublicKey

func (c *DefaultApiService) FetchCredentialPublicKey(Sid string) (*AccountsV1CredentialCredentialPublicKey, error)

Fetch the public key specified by the provided Credential Sid

func (*DefaultApiService) ListCredentialAws

Retrieves a collection of AWS Credentials belonging to the account used to make the request

func (*DefaultApiService) ListCredentialPublicKey

Retrieves a collection of Public Key Credentials belonging to the account used to make the request

func (*DefaultApiService) UpdateAuthTokenPromotion

func (c *DefaultApiService) 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 (*DefaultApiService) UpdateCredentialAws

Modify the properties of a given Account

func (*DefaultApiService) UpdateCredentialPublicKey

Modify the properties of a given Account

type ListCredentialAwsParams

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

Optional parameters for the method 'ListCredentialAws'

func (*ListCredentialAwsParams) SetPageSize

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

type ListCredentialAwsResponse

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

ListCredentialAwsResponse struct for ListCredentialAwsResponse

type ListCredentialAwsResponseMeta

type ListCredentialAwsResponseMeta struct {
	FirstPageUrl    string `json:"first_page_url,omitempty"`
	Key             string `json:"key,omitempty"`
	NextPageUrl     string `json:"next_page_url,omitempty"`
	Page            int32  `json:"page,omitempty"`
	PageSize        int32  `json:"page_size,omitempty"`
	PreviousPageUrl string `json:"previous_page_url,omitempty"`
	Url             string `json:"url,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 *int32 `json:"PageSize,omitempty"`
}

Optional parameters for the method 'ListCredentialPublicKey'

func (*ListCredentialPublicKeyParams) SetPageSize

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

type ListCredentialPublicKeyResponse

type ListCredentialPublicKeyResponse struct {
	Credentials []AccountsV1CredentialCredentialPublicKey `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