openapi

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 5 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.43.2
  • 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://pricing.twilio.com

Class Method HTTP request Description
MessagingCountriesApi FetchMessagingCountry Get /v1/Messaging/Countries/{IsoCountry}
MessagingCountriesApi ListMessagingCountry Get /v1/Messaging/Countries
PhoneNumbersCountriesApi FetchPhoneNumberCountry Get /v1/PhoneNumbers/Countries/{IsoCountry}
PhoneNumbersCountriesApi ListPhoneNumberCountry Get /v1/PhoneNumbers/Countries
VoiceCountriesApi FetchVoiceCountry Get /v1/Voice/Countries/{IsoCountry}
VoiceCountriesApi ListVoiceCountry Get /v1/Voice/Countries
VoiceNumbersApi FetchVoiceNumber Get /v1/Voice/Numbers/{Number}

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 ApiService added in v0.11.0

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

func NewApiService added in v0.11.0

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient added in v0.11.0

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) FetchMessagingCountry added in v0.11.0

func (c *ApiService) FetchMessagingCountry(IsoCountry string) (*PricingV1MessagingCountryInstance, error)

func (*ApiService) FetchPhoneNumberCountry added in v0.11.0

func (c *ApiService) FetchPhoneNumberCountry(IsoCountry string) (*PricingV1PhoneNumberCountryInstance, error)

func (*ApiService) FetchVoiceCountry added in v0.11.0

func (c *ApiService) FetchVoiceCountry(IsoCountry string) (*PricingV1VoiceCountryInstance, error)

func (*ApiService) FetchVoiceNumber added in v0.11.0

func (c *ApiService) FetchVoiceNumber(Number string) (*PricingV1VoiceNumber, error)

func (*ApiService) ListMessagingCountry added in v0.11.0

func (c *ApiService) ListMessagingCountry(params *ListMessagingCountryParams) ([]PricingV1MessagingCountry, error)

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

func (*ApiService) ListPhoneNumberCountry added in v0.11.0

func (c *ApiService) ListPhoneNumberCountry(params *ListPhoneNumberCountryParams) ([]PricingV1PhoneNumberCountry, error)

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

func (*ApiService) ListVoiceCountry added in v0.11.0

func (c *ApiService) ListVoiceCountry(params *ListVoiceCountryParams) ([]PricingV1VoiceCountry, error)

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

func (*ApiService) PageMessagingCountry added in v0.13.0

func (c *ApiService) PageMessagingCountry(params *ListMessagingCountryParams, pageToken, pageNumber string) (*ListMessagingCountryResponse, error)

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

func (*ApiService) PagePhoneNumberCountry added in v0.13.0

func (c *ApiService) PagePhoneNumberCountry(params *ListPhoneNumberCountryParams, pageToken, pageNumber string) (*ListPhoneNumberCountryResponse, error)

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

func (*ApiService) PageVoiceCountry added in v0.13.0

func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, pageNumber string) (*ListVoiceCountryResponse, error)

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

func (*ApiService) StreamMessagingCountry added in v0.13.0

func (c *ApiService) StreamMessagingCountry(params *ListMessagingCountryParams) (chan PricingV1MessagingCountry, chan error)

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

func (*ApiService) StreamPhoneNumberCountry added in v0.13.0

func (c *ApiService) StreamPhoneNumberCountry(params *ListPhoneNumberCountryParams) (chan PricingV1PhoneNumberCountry, chan error)

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

func (*ApiService) StreamVoiceCountry added in v0.13.0

func (c *ApiService) StreamVoiceCountry(params *ListVoiceCountryParams) (chan PricingV1VoiceCountry, chan error)

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

type ListMessagingCountryParams

type ListMessagingCountryParams 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 'ListMessagingCountry'

func (*ListMessagingCountryParams) SetLimit added in v0.13.0

func (*ListMessagingCountryParams) SetPageSize

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

type ListMessagingCountryResponse

type ListMessagingCountryResponse struct {
	Countries []PricingV1MessagingCountry      `json:"countries,omitempty"`
	Meta      ListMessagingCountryResponseMeta `json:"meta,omitempty"`
}

ListMessagingCountryResponse struct for ListMessagingCountryResponse

type ListMessagingCountryResponseMeta

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

ListMessagingCountryResponseMeta struct for ListMessagingCountryResponseMeta

type ListPhoneNumberCountryParams

type ListPhoneNumberCountryParams 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 'ListPhoneNumberCountry'

func (*ListPhoneNumberCountryParams) SetLimit added in v0.13.0

func (*ListPhoneNumberCountryParams) SetPageSize

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

type ListPhoneNumberCountryResponse

type ListPhoneNumberCountryResponse struct {
	Countries []PricingV1PhoneNumberCountry    `json:"countries,omitempty"`
	Meta      ListMessagingCountryResponseMeta `json:"meta,omitempty"`
}

ListPhoneNumberCountryResponse struct for ListPhoneNumberCountryResponse

type ListVoiceCountryParams

type ListVoiceCountryParams 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 'ListVoiceCountry'

func (*ListVoiceCountryParams) SetLimit added in v0.13.0

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

func (*ListVoiceCountryParams) SetPageSize

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

type ListVoiceCountryResponse

type ListVoiceCountryResponse struct {
	Countries []PricingV1VoiceCountry          `json:"countries,omitempty"`
	Meta      ListMessagingCountryResponseMeta `json:"meta,omitempty"`
}

ListVoiceCountryResponse struct for ListVoiceCountryResponse

type PricingV1Messaging

type PricingV1Messaging struct {
	Name  *string                 `json:"name,omitempty"`
	Url   *string                 `json:"url,omitempty"`
	Links *map[string]interface{} `json:"links,omitempty"`
}

PricingV1Messaging struct for PricingV1Messaging

type PricingV1MessagingCountry added in v0.14.0

type PricingV1MessagingCountry struct {
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry *string `json:"iso_country,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1MessagingCountry struct for PricingV1MessagingCountry

type PricingV1MessagingCountryInstance added in v0.14.0

type PricingV1MessagingCountryInstance struct {
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry *string `json:"iso_country,omitempty"`
	// The list of [OutboundSMSPrice](https://www.twilio.com/docs/sms/api/pricing#outbound-sms-price) records that represent the price to send a message for each MCC/MNC applicable in this country.
	OutboundSmsPrices *[]PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices `json:"outbound_sms_prices,omitempty"`
	// The list of [InboundPrice](https://www.twilio.com/docs/sms/api/pricing#inbound-price) records that describe the price to receive an inbound SMS to the different Twilio phone number types supported in this country
	InboundSmsPrices *[]PricingV1MessagingMessagingCountryInstanceInboundSmsPrices `json:"inbound_sms_prices,omitempty"`
	// The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
	PriceUnit *string `json:"price_unit,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1MessagingCountryInstance struct for PricingV1MessagingCountryInstance

type PricingV1MessagingMessagingCountryInstanceInboundSmsPrices

type PricingV1MessagingMessagingCountryInstanceInboundSmsPrices struct {
	BasePrice    float32 `json:"base_price,omitempty"`
	CurrentPrice float32 `json:"current_price,omitempty"`
	NumberType   string  `json:"number_type,omitempty"`
}

PricingV1MessagingMessagingCountryInstanceInboundSmsPrices struct for PricingV1MessagingMessagingCountryInstanceInboundSmsPrices

func (*PricingV1MessagingMessagingCountryInstanceInboundSmsPrices) UnmarshalJSON added in v0.25.0

func (response *PricingV1MessagingMessagingCountryInstanceInboundSmsPrices) UnmarshalJSON(bytes []byte) (err error)

type PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices

type PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices struct {
	Carrier string                                                              `json:"carrier,omitempty"`
	Mcc     string                                                              `json:"mcc,omitempty"`
	Mnc     string                                                              `json:"mnc,omitempty"`
	Prices  []PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices `json:"prices,omitempty"`
}

PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices struct for PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices

type PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices added in v1.0.0

type PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices struct {
	BasePrice    float32 `json:"base_price,omitempty"`
	CurrentPrice float32 `json:"current_price,omitempty"`
	NumberType   string  `json:"number_type,omitempty"`
}

PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices struct for PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices

func (*PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices) UnmarshalJSON added in v1.0.0

func (response *PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices) UnmarshalJSON(bytes []byte) (err error)

type PricingV1PhoneNumber

type PricingV1PhoneNumber struct {
	Name  *string                 `json:"name,omitempty"`
	Url   *string                 `json:"url,omitempty"`
	Links *map[string]interface{} `json:"links,omitempty"`
}

PricingV1PhoneNumber struct for PricingV1PhoneNumber

type PricingV1PhoneNumberCountry added in v0.14.0

type PricingV1PhoneNumberCountry struct {
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry *string `json:"iso_country,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1PhoneNumberCountry struct for PricingV1PhoneNumberCountry

type PricingV1PhoneNumberCountryInstance added in v0.14.0

type PricingV1PhoneNumberCountryInstance struct {
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry *string `json:"iso_country,omitempty"`
	// The list of [PhoneNumberPrice](https://www.twilio.com/docs/phone-numbers/pricing#phone-number-price) records.
	PhoneNumberPrices *[]PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices `json:"phone_number_prices,omitempty"`
	// The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
	PriceUnit *string `json:"price_unit,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1PhoneNumberCountryInstance struct for PricingV1PhoneNumberCountryInstance

type PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices added in v0.24.0

type PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices struct {
	BasePrice    float32 `json:"base_price,omitempty"`
	CurrentPrice float32 `json:"current_price,omitempty"`
	NumberType   string  `json:"number_type,omitempty"`
}

PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices struct for PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices

func (*PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices) UnmarshalJSON added in v0.25.0

func (response *PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices) UnmarshalJSON(bytes []byte) (err error)

type PricingV1Voice

type PricingV1Voice struct {
	Name  *string                 `json:"name,omitempty"`
	Url   *string                 `json:"url,omitempty"`
	Links *map[string]interface{} `json:"links,omitempty"`
}

PricingV1Voice struct for PricingV1Voice

type PricingV1VoiceCountry added in v0.14.0

type PricingV1VoiceCountry struct {
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry *string `json:"iso_country,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1VoiceCountry struct for PricingV1VoiceCountry

type PricingV1VoiceCountryInstance added in v0.14.0

type PricingV1VoiceCountryInstance struct {
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry *string `json:"iso_country,omitempty"`
	// The list of OutboundPrefixPrice records, which include a list of the `prefixes`, the `friendly_name`, `base_price`, and the   `current_price` for those prefixes.
	OutboundPrefixPrices *[]PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices `json:"outbound_prefix_prices,omitempty"`
	// The list of [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) records.
	InboundCallPrices *[]PricingV1VoiceVoiceCountryInstanceInboundCallPrices `json:"inbound_call_prices,omitempty"`
	// The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
	PriceUnit *string `json:"price_unit,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1VoiceCountryInstance struct for PricingV1VoiceCountryInstance

type PricingV1VoiceNumber added in v0.14.0

type PricingV1VoiceNumber struct {
	// The phone number.
	Number *string `json:"number,omitempty"`
	// The name of the country.
	Country *string `json:"country,omitempty"`
	// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	IsoCountry        *string                                     `json:"iso_country,omitempty"`
	OutboundCallPrice *PricingV1VoiceVoiceNumberOutboundCallPrice `json:"outbound_call_price,omitempty"`
	InboundCallPrice  *PricingV1VoiceVoiceNumberInboundCallPrice  `json:"inbound_call_price,omitempty"`
	// The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
	PriceUnit *string `json:"price_unit,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

PricingV1VoiceNumber struct for PricingV1VoiceNumber

type PricingV1VoiceVoiceCountryInstanceInboundCallPrices added in v0.24.0

type PricingV1VoiceVoiceCountryInstanceInboundCallPrices struct {
	BasePrice    float32 `json:"base_price,omitempty"`
	CurrentPrice float32 `json:"current_price,omitempty"`
	NumberType   string  `json:"number_type,omitempty"`
}

PricingV1VoiceVoiceCountryInstanceInboundCallPrices struct for PricingV1VoiceVoiceCountryInstanceInboundCallPrices

func (*PricingV1VoiceVoiceCountryInstanceInboundCallPrices) UnmarshalJSON added in v0.25.0

func (response *PricingV1VoiceVoiceCountryInstanceInboundCallPrices) UnmarshalJSON(bytes []byte) (err error)

type PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices

type PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices struct {
	Prefixes     []string `json:"prefixes,omitempty"`
	BasePrice    float32  `json:"base_price,omitempty"`
	CurrentPrice float32  `json:"current_price,omitempty"`
	FriendlyName string   `json:"friendly_name,omitempty"`
}

PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices struct for PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices

func (*PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices) UnmarshalJSON added in v0.25.0

func (response *PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices) UnmarshalJSON(bytes []byte) (err error)

type PricingV1VoiceVoiceNumberInboundCallPrice

type PricingV1VoiceVoiceNumberInboundCallPrice struct {
	BasePrice    float32 `json:"base_price,omitempty"`
	CurrentPrice float32 `json:"current_price,omitempty"`
	NumberType   string  `json:"number_type,omitempty"`
}

PricingV1VoiceVoiceNumberInboundCallPrice The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. If `null`, the Phone Number is not a Twilio number owned by this account.

func (*PricingV1VoiceVoiceNumberInboundCallPrice) UnmarshalJSON added in v0.25.0

func (response *PricingV1VoiceVoiceNumberInboundCallPrice) UnmarshalJSON(bytes []byte) (err error)

type PricingV1VoiceVoiceNumberOutboundCallPrice

type PricingV1VoiceVoiceNumberOutboundCallPrice struct {
	BasePrice    float32 `json:"base_price,omitempty"`
	CurrentPrice float32 `json:"current_price,omitempty"`
}

PricingV1VoiceVoiceNumberOutboundCallPrice The OutboundCallPrice record, which includes a list of `origination_prefixes` and the `base_price` and `current_price` for those prefixes.

func (*PricingV1VoiceVoiceNumberOutboundCallPrice) UnmarshalJSON added in v0.25.0

func (response *PricingV1VoiceVoiceNumberOutboundCallPrice) UnmarshalJSON(bytes []byte) (err error)

Jump to

Keyboard shortcuts

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