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: 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.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://routes.twilio.com

Class Method HTTP request Description
PhoneNumbersApi FetchPhoneNumber Get /v2/PhoneNumbers/{PhoneNumber}
PhoneNumbersApi UpdatePhoneNumber Post /v2/PhoneNumbers/{PhoneNumber}
SipDomainsApi FetchSipDomain Get /v2/SipDomains/{SipDomain}
SipDomainsApi UpdateSipDomain Post /v2/SipDomains/{SipDomain}
TrunksApi FetchTrunks Get /v2/Trunks/{SipTrunkDomain}
TrunksApi UpdateTrunks Post /v2/Trunks/{SipTrunkDomain}

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

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) FetchPhoneNumber

func (c *ApiService) FetchPhoneNumber(PhoneNumber string) (*RoutesV2PhoneNumber, error)

Fetch the Inbound Processing Region assigned to a phone number.

func (*ApiService) FetchSipDomain

func (c *ApiService) FetchSipDomain(SipDomain string) (*RoutesV2SipDomain, error)

func (*ApiService) FetchTrunks

func (c *ApiService) FetchTrunks(SipTrunkDomain string) (*RoutesV2Trunks, error)

Fetch the Inbound Processing Region assigned to a SIP Trunk.

func (*ApiService) UpdatePhoneNumber

func (c *ApiService) UpdatePhoneNumber(PhoneNumber string, params *UpdatePhoneNumberParams) (*RoutesV2PhoneNumber, error)

Assign an Inbound Processing Region to a phone number.

func (*ApiService) UpdateSipDomain

func (c *ApiService) UpdateSipDomain(SipDomain string, params *UpdateSipDomainParams) (*RoutesV2SipDomain, error)

func (*ApiService) UpdateTrunks

func (c *ApiService) UpdateTrunks(SipTrunkDomain string, params *UpdateTrunksParams) (*RoutesV2Trunks, error)

Assign an Inbound Processing Region to a SIP Trunk

type RoutesV2PhoneNumber

type RoutesV2PhoneNumber struct {
	// The phone number in E.164 format
	PhoneNumber *string `json:"phone_number,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
	// A 34 character string that uniquely identifies the Inbound Processing Region assignments for this phone number.
	Sid *string `json:"sid,omitempty"`
	// The unique SID identifier of the Account.
	AccountSid *string `json:"account_sid,omitempty"`
	// A human readable description of the Inbound Processing Region assignments for this phone number, up to 64 characters.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The Inbound Processing Region used for this phone number for voice.
	VoiceRegion *string `json:"voice_region,omitempty"`
	// The date that this phone number was assigned an Inbound Processing Region, given in ISO 8601 format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date that the Inbound Processing Region was updated for this phone number, given in ISO 8601 format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
}

RoutesV2PhoneNumber struct for RoutesV2PhoneNumber

type RoutesV2SipDomain

type RoutesV2SipDomain struct {
	SipDomain    *string    `json:"sip_domain,omitempty"`
	Url          *string    `json:"url,omitempty"`
	Sid          *string    `json:"sid,omitempty"`
	AccountSid   *string    `json:"account_sid,omitempty"`
	FriendlyName *string    `json:"friendly_name,omitempty"`
	VoiceRegion  *string    `json:"voice_region,omitempty"`
	DateCreated  *time.Time `json:"date_created,omitempty"`
	DateUpdated  *time.Time `json:"date_updated,omitempty"`
}

RoutesV2SipDomain struct for RoutesV2SipDomain

type RoutesV2Trunks

type RoutesV2Trunks struct {
	// The absolute URL of the SIP Trunk
	SipTrunkDomain *string `json:"sip_trunk_domain,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
	// A 34 character string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk.
	Sid *string `json:"sid,omitempty"`
	// The unique SID identifier of the Account.
	AccountSid *string `json:"account_sid,omitempty"`
	// A human readable description of the Inbound Processing Region assignments for this SIP Trunk, up to 64 characters.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The Inbound Processing Region used for this SIP Trunk for voice.
	VoiceRegion *string `json:"voice_region,omitempty"`
	// The date that this SIP Trunk was assigned an Inbound Processing Region, given in ISO 8601 format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date that the Inbound Processing Region was updated for this SIP Trunk, given in ISO 8601 format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
}

RoutesV2Trunks struct for RoutesV2Trunks

type UpdatePhoneNumberParams

type UpdatePhoneNumberParams struct {
	// The Inbound Processing Region used for this phone number for voice
	VoiceRegion *string `json:"VoiceRegion,omitempty"`
	// A human readable description of this resource, up to 64 characters.
	FriendlyName *string `json:"FriendlyName,omitempty"`
}

Optional parameters for the method 'UpdatePhoneNumber'

func (*UpdatePhoneNumberParams) SetFriendlyName

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

func (*UpdatePhoneNumberParams) SetVoiceRegion

func (params *UpdatePhoneNumberParams) SetVoiceRegion(VoiceRegion string) *UpdatePhoneNumberParams

type UpdateSipDomainParams

type UpdateSipDomainParams struct {
	//
	VoiceRegion *string `json:"VoiceRegion,omitempty"`
	//
	FriendlyName *string `json:"FriendlyName,omitempty"`
}

Optional parameters for the method 'UpdateSipDomain'

func (*UpdateSipDomainParams) SetFriendlyName

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

func (*UpdateSipDomainParams) SetVoiceRegion

func (params *UpdateSipDomainParams) SetVoiceRegion(VoiceRegion string) *UpdateSipDomainParams

type UpdateTrunksParams

type UpdateTrunksParams struct {
	// The Inbound Processing Region used for this SIP Trunk for voice
	VoiceRegion *string `json:"VoiceRegion,omitempty"`
	// A human readable description of this resource, up to 64 characters.
	FriendlyName *string `json:"FriendlyName,omitempty"`
}

Optional parameters for the method 'UpdateTrunks'

func (*UpdateTrunksParams) SetFriendlyName

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

func (*UpdateTrunksParams) SetVoiceRegion

func (params *UpdateTrunksParams) SetVoiceRegion(VoiceRegion string) *UpdateTrunksParams

Jump to

Keyboard shortcuts

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