client

package
Version: v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSON       = "application/json"
	URLEncoded = "application/x-www-form-urlencoded"
	FormData   = "multipart/form-data"
)

Variables

This section is empty.

Functions

func CreateBaseURL

func CreateBaseURL(subDomain string, apiVersion string, edge *string, region *string) string

Types

type APIClientConfig added in v0.10.0

type APIClientConfig struct {
	APIVersion   string
	Beta         bool
	DebugEnabled bool
	Edge         *string
	Region       *string
	RetryConfig  RetryConfig
	SubDomain    string
}

APIClientConfig is the internal definition for each sub client which is used to call the Twilio API's

func NewAPIClientConfig added in v0.10.0

func NewAPIClientConfig(config *Config) *APIClientConfig

NewAPIClientConfig is an internal function for creating a api client config struct using default and user defined config

type Client

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

func New

func New(sess *session.Session, config *APIClientConfig) *Client

func (Client) GetRestyClient

func (c Client) GetRestyClient() *resty.Client

Used for testing purposes only

func (Client) Send

func (c Client) Send(context context.Context, op Operation, input interface{}, output interface{}) error

type Config

type Config struct {
	BackoffInterval *int
	DebugEnabled    *bool
	Edge            *string
	Region          *string
	RetryAttempts   *int
}

Config is the user defined configuration for the Twilio Client. This can be used to enable debugging, configuring the number of retry attempts, setting the time in milliseconds between retry attempts, edge location and region details

type Operation

type Operation struct {
	OverrideBaseURL *string
	Method          string
	URI             string
	ContentType     string
	PathParams      map[string]string
	QueryParams     *url.Values
}

type RetryConfig

type RetryConfig struct {
	Attempts int
	WaitTime time.Duration
}

RetryConfig defines the retry configuration for the HTTP client

Jump to

Keyboard shortcuts

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