openapi

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 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.16.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://proxy.twilio.com

Class Method HTTP request Description
DefaultApi CreateMessageInteraction Post /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{ParticipantSid}/MessageInteractions
DefaultApi CreateParticipant Post /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants
DefaultApi CreatePhoneNumber Post /v1/Services/{ServiceSid}/PhoneNumbers
DefaultApi CreateService Post /v1/Services
DefaultApi CreateSession Post /v1/Services/{ServiceSid}/Sessions
DefaultApi CreateShortCode Post /v1/Services/{ServiceSid}/ShortCodes
DefaultApi DeleteInteraction Delete /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}
DefaultApi DeleteParticipant Delete /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid}
DefaultApi DeletePhoneNumber Delete /v1/Services/{ServiceSid}/PhoneNumbers/{Sid}
DefaultApi DeleteService Delete /v1/Services/{Sid}
DefaultApi DeleteSession Delete /v1/Services/{ServiceSid}/Sessions/{Sid}
DefaultApi DeleteShortCode Delete /v1/Services/{ServiceSid}/ShortCodes/{Sid}
DefaultApi FetchInteraction Get /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}
DefaultApi FetchMessageInteraction Get /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{ParticipantSid}/MessageInteractions/{Sid}
DefaultApi FetchParticipant Get /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid}
DefaultApi FetchPhoneNumber Get /v1/Services/{ServiceSid}/PhoneNumbers/{Sid}
DefaultApi FetchService Get /v1/Services/{Sid}
DefaultApi FetchSession Get /v1/Services/{ServiceSid}/Sessions/{Sid}
DefaultApi FetchShortCode Get /v1/Services/{ServiceSid}/ShortCodes/{Sid}
DefaultApi ListInteraction Get /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions
DefaultApi ListMessageInteraction Get /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{ParticipantSid}/MessageInteractions
DefaultApi ListParticipant Get /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants
DefaultApi ListPhoneNumber Get /v1/Services/{ServiceSid}/PhoneNumbers
DefaultApi ListService Get /v1/Services
DefaultApi ListSession Get /v1/Services/{ServiceSid}/Sessions
DefaultApi ListShortCode Get /v1/Services/{ServiceSid}/ShortCodes
DefaultApi UpdatePhoneNumber Post /v1/Services/{ServiceSid}/PhoneNumbers/{Sid}
DefaultApi UpdateService Post /v1/Services/{Sid}
DefaultApi UpdateSession Post /v1/Services/{ServiceSid}/Sessions/{Sid}
DefaultApi UpdateShortCode Post /v1/Services/{ServiceSid}/ShortCodes/{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 CreateMessageInteractionParams

type CreateMessageInteractionParams struct {
	// The message to send to the participant
	Body *string `json:"Body,omitempty"`
	// Reserved. Not currently supported.
	MediaUrl *[]string `json:"MediaUrl,omitempty"`
}

Optional parameters for the method 'CreateMessageInteraction'

func (*CreateMessageInteractionParams) SetBody

func (*CreateMessageInteractionParams) SetMediaUrl

func (params *CreateMessageInteractionParams) SetMediaUrl(MediaUrl []string) *CreateMessageInteractionParams

type CreateParticipantParams

type CreateParticipantParams struct {
	// [Experimental] For accounts with the ProxyAllowParticipantConflict account flag, setting to true enables per-request opt-in to allowing Proxy to reject a Participant create request that could cause the same Identifier/ProxyIdentifier pair to be active in multiple Sessions. Depending on the context, this could be a 409 error (Twilio error code 80623) or a 400 error (Twilio error code 80604). If not provided, requests will be allowed to succeed and a Debugger notification (80802) will be emitted. Having multiple, active Participants with the same Identifier/ProxyIdentifier pair causes calls and messages from affected Participants to be routed incorrectly. Please note, the default behavior for accounts without the ProxyAllowParticipantConflict flag is to reject the request as described.  This will eventually be the default for all accounts.
	FailOnParticipantConflict *bool `json:"FailOnParticipantConflict,omitempty"`
	// The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.**
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The phone number of the Participant.
	Identifier *string `json:"Identifier,omitempty"`
	// The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool.
	ProxyIdentifier *string `json:"ProxyIdentifier,omitempty"`
	// The SID of the Proxy Identifier to assign to the Participant.
	ProxyIdentifierSid *string `json:"ProxyIdentifierSid,omitempty"`
}

Optional parameters for the method 'CreateParticipant'

func (*CreateParticipantParams) SetFailOnParticipantConflict

func (params *CreateParticipantParams) SetFailOnParticipantConflict(FailOnParticipantConflict bool) *CreateParticipantParams

func (*CreateParticipantParams) SetFriendlyName

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

func (*CreateParticipantParams) SetIdentifier

func (params *CreateParticipantParams) SetIdentifier(Identifier string) *CreateParticipantParams

func (*CreateParticipantParams) SetProxyIdentifier

func (params *CreateParticipantParams) SetProxyIdentifier(ProxyIdentifier string) *CreateParticipantParams

func (*CreateParticipantParams) SetProxyIdentifierSid

func (params *CreateParticipantParams) SetProxyIdentifierSid(ProxyIdentifierSid string) *CreateParticipantParams

type CreatePhoneNumberParams

type CreatePhoneNumberParams struct {
	// Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.
	IsReserved *bool `json:"IsReserved,omitempty"`
	// The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.  E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.
	PhoneNumber *string `json:"PhoneNumber,omitempty"`
	// The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service.
	Sid *string `json:"Sid,omitempty"`
}

Optional parameters for the method 'CreatePhoneNumber'

func (*CreatePhoneNumberParams) SetIsReserved

func (params *CreatePhoneNumberParams) SetIsReserved(IsReserved bool) *CreatePhoneNumberParams

func (*CreatePhoneNumberParams) SetPhoneNumber

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

func (*CreatePhoneNumberParams) SetSid

type CreateServiceParams

type CreateServiceParams struct {
	// The URL we should call when the interaction status changes.
	CallbackUrl *string `json:"CallbackUrl,omitempty"`
	// The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship.
	ChatInstanceSid *string `json:"ChatInstanceSid,omitempty"`
	// The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value.
	DefaultTtl *int32 `json:"DefaultTtl,omitempty"`
	// Where a proxy number must be located relative to the participant identifier. Can be: `country`, `area-code`, or `extended-area-code`. The default value is `country` and more specific areas than `country` are only available in North America.
	GeoMatchLevel *string `json:"GeoMatchLevel,omitempty"`
	// The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues.
	InterceptCallbackUrl *string `json:"InterceptCallbackUrl,omitempty"`
	// The preference for Proxy Number selection in the Service instance. Can be: `prefer-sticky` or `avoid-sticky` and the default is `prefer-sticky`. `prefer-sticky` means that we will try and select the same Proxy Number for a given participant if they have previous [Sessions](https://www.twilio.com/docs/proxy/api/session), but we will not fail if that Proxy Number cannot be used.  `avoid-sticky` means that we will try to use different Proxy Numbers as long as that is possible within a given pool rather than try and use a previously assigned number.
	NumberSelectionBehavior *string `json:"NumberSelectionBehavior,omitempty"`
	// The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information.
	OutOfSessionCallbackUrl *string `json:"OutOfSessionCallbackUrl,omitempty"`
	// An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.**
	UniqueName *string `json:"UniqueName,omitempty"`
}

Optional parameters for the method 'CreateService'

func (*CreateServiceParams) SetCallbackUrl

func (params *CreateServiceParams) SetCallbackUrl(CallbackUrl string) *CreateServiceParams

func (*CreateServiceParams) SetChatInstanceSid

func (params *CreateServiceParams) SetChatInstanceSid(ChatInstanceSid string) *CreateServiceParams

func (*CreateServiceParams) SetDefaultTtl

func (params *CreateServiceParams) SetDefaultTtl(DefaultTtl int32) *CreateServiceParams

func (*CreateServiceParams) SetGeoMatchLevel

func (params *CreateServiceParams) SetGeoMatchLevel(GeoMatchLevel string) *CreateServiceParams

func (*CreateServiceParams) SetInterceptCallbackUrl

func (params *CreateServiceParams) SetInterceptCallbackUrl(InterceptCallbackUrl string) *CreateServiceParams

func (*CreateServiceParams) SetNumberSelectionBehavior

func (params *CreateServiceParams) SetNumberSelectionBehavior(NumberSelectionBehavior string) *CreateServiceParams

func (*CreateServiceParams) SetOutOfSessionCallbackUrl

func (params *CreateServiceParams) SetOutOfSessionCallbackUrl(OutOfSessionCallbackUrl string) *CreateServiceParams

func (*CreateServiceParams) SetUniqueName

func (params *CreateServiceParams) SetUniqueName(UniqueName string) *CreateServiceParams

type CreateSessionParams

type CreateSessionParams struct {
	// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value.
	DateExpiry *time.Time `json:"DateExpiry,omitempty"`
	// [Experimental] For accounts with the ProxyAllowParticipantConflict account flag, setting to true enables per-request opt-in to allowing Proxy to reject a Session create (with Participants) request that could cause the same Identifier/ProxyIdentifier pair to be active in multiple Sessions. Depending on the context, this could be a 409 error (Twilio error code 80623) or a 400 error (Twilio error code 80604). If not provided, requests will be allowed to succeed and a Debugger notification (80802) will be emitted. Having multiple, active Participants with the same Identifier/ProxyIdentifier pair causes calls and messages from affected Participants to be routed incorrectly. Please note, the default behavior for accounts without the ProxyAllowParticipantConflict flag is to reject the request as described.  This will eventually be the default for all accounts.
	FailOnParticipantConflict *bool `json:"FailOnParticipantConflict,omitempty"`
	// The Mode of the Session. Can be: `message-only`, `voice-only`, or `voice-and-message` and the default value is `voice-and-message`.
	Mode *string `json:"Mode,omitempty"`
	// The Participant objects to include in the new session.
	Participants *[]map[string]interface{} `json:"Participants,omitempty"`
	// The initial status of the Session. Can be: `open`, `in-progress`, `closed`, `failed`, or `unknown`. The default is `open` on create.
	Status *string `json:"Status,omitempty"`
	// The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.
	Ttl *int32 `json:"Ttl,omitempty"`
	// An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.**
	UniqueName *string `json:"UniqueName,omitempty"`
}

Optional parameters for the method 'CreateSession'

func (*CreateSessionParams) SetDateExpiry

func (params *CreateSessionParams) SetDateExpiry(DateExpiry time.Time) *CreateSessionParams

func (*CreateSessionParams) SetFailOnParticipantConflict

func (params *CreateSessionParams) SetFailOnParticipantConflict(FailOnParticipantConflict bool) *CreateSessionParams

func (*CreateSessionParams) SetMode

func (params *CreateSessionParams) SetMode(Mode string) *CreateSessionParams

func (*CreateSessionParams) SetParticipants

func (params *CreateSessionParams) SetParticipants(Participants []map[string]interface{}) *CreateSessionParams

func (*CreateSessionParams) SetStatus

func (params *CreateSessionParams) SetStatus(Status string) *CreateSessionParams

func (*CreateSessionParams) SetTtl

func (params *CreateSessionParams) SetTtl(Ttl int32) *CreateSessionParams

func (*CreateSessionParams) SetUniqueName

func (params *CreateSessionParams) SetUniqueName(UniqueName string) *CreateSessionParams

type CreateShortCodeParams

type CreateShortCodeParams struct {
	// The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service.
	Sid *string `json:"Sid,omitempty"`
}

Optional parameters for the method 'CreateShortCode'

func (*CreateShortCodeParams) SetSid

func (params *CreateShortCodeParams) SetSid(Sid string) *CreateShortCodeParams

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

func (c *DefaultApiService) CreateMessageInteraction(ServiceSid string, SessionSid string, ParticipantSid string, params *CreateMessageInteractionParams) (*ProxyV1ServiceSessionParticipantMessageInteraction, error)

Create a new message Interaction to send directly from your system to one [Participant](https://www.twilio.com/docs/proxy/api/participant). The `inbound` properties for the Interaction will always be empty.

func (*DefaultApiService) CreateParticipant

func (c *DefaultApiService) CreateParticipant(ServiceSid string, SessionSid string, params *CreateParticipantParams) (*ProxyV1ServiceSessionParticipant, error)

Add a new Participant to the Session

func (*DefaultApiService) CreatePhoneNumber

func (c *DefaultApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNumberParams) (*ProxyV1ServicePhoneNumber, error)

Add a Phone Number to a Service's Proxy Number Pool.

func (*DefaultApiService) CreateService

func (c *DefaultApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service, error)

Create a new Service for Twilio Proxy

func (*DefaultApiService) CreateSession

func (c *DefaultApiService) CreateSession(ServiceSid string, params *CreateSessionParams) (*ProxyV1ServiceSession, error)

Create a new Session

func (*DefaultApiService) CreateShortCode

func (c *DefaultApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeParams) (*ProxyV1ServiceShortCode, error)

Add a Short Code to the Proxy Number Pool for the Service.

func (*DefaultApiService) DeleteInteraction

func (c *DefaultApiService) DeleteInteraction(ServiceSid string, SessionSid string, Sid string) error

Delete a specific Interaction.

func (*DefaultApiService) DeleteParticipant

func (c *DefaultApiService) DeleteParticipant(ServiceSid string, SessionSid string, Sid string) error

Delete a specific Participant. This is a soft-delete. The participant remains associated with the session and cannot be re-added. Participants are only permanently deleted when the [Session](https://www.twilio.com/docs/proxy/api/session) is deleted.

func (*DefaultApiService) DeletePhoneNumber

func (c *DefaultApiService) DeletePhoneNumber(ServiceSid string, Sid string) error

Delete a specific Phone Number from a Service.

func (*DefaultApiService) DeleteService

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

Delete a specific Service.

func (*DefaultApiService) DeleteSession

func (c *DefaultApiService) DeleteSession(ServiceSid string, Sid string) error

Delete a specific Session.

func (*DefaultApiService) DeleteShortCode

func (c *DefaultApiService) DeleteShortCode(ServiceSid string, Sid string) error

Delete a specific Short Code from a Service.

func (*DefaultApiService) FetchInteraction

func (c *DefaultApiService) FetchInteraction(ServiceSid string, SessionSid string, Sid string) (*ProxyV1ServiceSessionInteraction, error)

Retrieve a list of Interactions for a given [Session](https://www.twilio.com/docs/proxy/api/session).

func (*DefaultApiService) FetchMessageInteraction

func (c *DefaultApiService) FetchMessageInteraction(ServiceSid string, SessionSid string, ParticipantSid string, Sid string) (*ProxyV1ServiceSessionParticipantMessageInteraction, error)

func (*DefaultApiService) FetchParticipant

func (c *DefaultApiService) FetchParticipant(ServiceSid string, SessionSid string, Sid string) (*ProxyV1ServiceSessionParticipant, error)

Fetch a specific Participant.

func (*DefaultApiService) FetchPhoneNumber

func (c *DefaultApiService) FetchPhoneNumber(ServiceSid string, Sid string) (*ProxyV1ServicePhoneNumber, error)

Fetch a specific Phone Number.

func (*DefaultApiService) FetchService

func (c *DefaultApiService) FetchService(Sid string) (*ProxyV1Service, error)

Fetch a specific Service.

func (*DefaultApiService) FetchSession

func (c *DefaultApiService) FetchSession(ServiceSid string, Sid string) (*ProxyV1ServiceSession, error)

Fetch a specific Session.

func (*DefaultApiService) FetchShortCode

func (c *DefaultApiService) FetchShortCode(ServiceSid string, Sid string) (*ProxyV1ServiceShortCode, error)

Fetch a specific Short Code.

func (*DefaultApiService) ListInteraction

func (c *DefaultApiService) ListInteraction(ServiceSid string, SessionSid string, params *ListInteractionParams) (*ListInteractionResponse, error)

Retrieve a list of all Interactions for a Session. A maximum of 100 records will be returned per page.

func (*DefaultApiService) ListMessageInteraction

func (c *DefaultApiService) ListMessageInteraction(ServiceSid string, SessionSid string, ParticipantSid string, params *ListMessageInteractionParams) (*ListMessageInteractionResponse, error)

func (*DefaultApiService) ListParticipant

func (c *DefaultApiService) ListParticipant(ServiceSid string, SessionSid string, params *ListParticipantParams) (*ListParticipantResponse, error)

Retrieve a list of all Participants in a Session.

func (*DefaultApiService) ListPhoneNumber

func (c *DefaultApiService) ListPhoneNumber(ServiceSid string, params *ListPhoneNumberParams) (*ListPhoneNumberResponse, error)

Retrieve a list of all Phone Numbers in the Proxy Number Pool for a Service. A maximum of 100 records will be returned per page.

func (*DefaultApiService) ListService

func (c *DefaultApiService) ListService(params *ListServiceParams) (*ListServiceResponse, error)

Retrieve a list of all Services for Twilio Proxy. A maximum of 100 records will be returned per page.

func (*DefaultApiService) ListSession

func (c *DefaultApiService) ListSession(ServiceSid string, params *ListSessionParams) (*ListSessionResponse, error)

Retrieve a list of all Sessions for the Service. A maximum of 100 records will be returned per page.

func (*DefaultApiService) ListShortCode

func (c *DefaultApiService) ListShortCode(ServiceSid string, params *ListShortCodeParams) (*ListShortCodeResponse, error)

Retrieve a list of all Short Codes in the Proxy Number Pool for the Service. A maximum of 100 records will be returned per page.

func (*DefaultApiService) UpdatePhoneNumber

func (c *DefaultApiService) UpdatePhoneNumber(ServiceSid string, Sid string, params *UpdatePhoneNumberParams) (*ProxyV1ServicePhoneNumber, error)

Update a specific Proxy Number.

func (*DefaultApiService) UpdateService

func (c *DefaultApiService) UpdateService(Sid string, params *UpdateServiceParams) (*ProxyV1Service, error)

Update a specific Service.

func (*DefaultApiService) UpdateSession

func (c *DefaultApiService) UpdateSession(ServiceSid string, Sid string, params *UpdateSessionParams) (*ProxyV1ServiceSession, error)

Update a specific Session.

func (*DefaultApiService) UpdateShortCode

func (c *DefaultApiService) UpdateShortCode(ServiceSid string, Sid string, params *UpdateShortCodeParams) (*ProxyV1ServiceShortCode, error)

Update a specific Short Code.

type ListInteractionParams

type ListInteractionParams 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 'ListInteraction'

func (*ListInteractionParams) SetPageSize

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

type ListInteractionResponse

type ListInteractionResponse struct {
	Interactions []ProxyV1ServiceSessionInteraction `json:"interactions,omitempty"`
	Meta         ListServiceResponseMeta            `json:"meta,omitempty"`
}

ListInteractionResponse struct for ListInteractionResponse

type ListMessageInteractionParams

type ListMessageInteractionParams 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 'ListMessageInteraction'

func (*ListMessageInteractionParams) SetPageSize

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

type ListMessageInteractionResponse

type ListMessageInteractionResponse struct {
	Interactions []ProxyV1ServiceSessionParticipantMessageInteraction `json:"interactions,omitempty"`
	Meta         ListServiceResponseMeta                              `json:"meta,omitempty"`
}

ListMessageInteractionResponse struct for ListMessageInteractionResponse

type ListParticipantParams

type ListParticipantParams 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 'ListParticipant'

func (*ListParticipantParams) SetPageSize

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

type ListParticipantResponse

type ListParticipantResponse struct {
	Meta         ListServiceResponseMeta            `json:"meta,omitempty"`
	Participants []ProxyV1ServiceSessionParticipant `json:"participants,omitempty"`
}

ListParticipantResponse struct for ListParticipantResponse

type ListPhoneNumberParams

type ListPhoneNumberParams 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 'ListPhoneNumber'

func (*ListPhoneNumberParams) SetPageSize

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

type ListPhoneNumberResponse

type ListPhoneNumberResponse struct {
	Meta         ListServiceResponseMeta     `json:"meta,omitempty"`
	PhoneNumbers []ProxyV1ServicePhoneNumber `json:"phone_numbers,omitempty"`
}

ListPhoneNumberResponse struct for ListPhoneNumberResponse

type ListServiceParams

type ListServiceParams 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 'ListService'

func (*ListServiceParams) SetPageSize

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

type ListServiceResponse

type ListServiceResponse struct {
	Meta     ListServiceResponseMeta `json:"meta,omitempty"`
	Services []ProxyV1Service        `json:"services,omitempty"`
}

ListServiceResponse struct for ListServiceResponse

type ListServiceResponseMeta

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

ListServiceResponseMeta struct for ListServiceResponseMeta

type ListSessionParams

type ListSessionParams 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 'ListSession'

func (*ListSessionParams) SetPageSize

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

type ListSessionResponse

type ListSessionResponse struct {
	Meta     ListServiceResponseMeta `json:"meta,omitempty"`
	Sessions []ProxyV1ServiceSession `json:"sessions,omitempty"`
}

ListSessionResponse struct for ListSessionResponse

type ListShortCodeParams

type ListShortCodeParams 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 'ListShortCode'

func (*ListShortCodeParams) SetPageSize

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

type ListShortCodeResponse

type ListShortCodeResponse struct {
	Meta       ListServiceResponseMeta   `json:"meta,omitempty"`
	ShortCodes []ProxyV1ServiceShortCode `json:"short_codes,omitempty"`
}

ListShortCodeResponse struct for ListShortCodeResponse

type ProxyV1Service

type ProxyV1Service struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The URL we call when the interaction status changes
	CallbackUrl *string `json:"callback_url,omitempty"`
	// The SID of the Chat Service Instance
	ChatInstanceSid *string `json:"chat_instance_sid,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// Default TTL for a Session, in seconds
	DefaultTtl *int32 `json:"default_ttl,omitempty"`
	// Where a proxy number must be located relative to the participant identifier
	GeoMatchLevel *string `json:"geo_match_level,omitempty"`
	// The URL we call on each interaction
	InterceptCallbackUrl *string `json:"intercept_callback_url,omitempty"`
	// The URLs of resources related to the Service
	Links *map[string]interface{} `json:"links,omitempty"`
	// The preference for Proxy Number selection for the Service instance
	NumberSelectionBehavior *string `json:"number_selection_behavior,omitempty"`
	// The URL we call when an inbound call or SMS action occurs on a closed or non-existent Session
	OutOfSessionCallbackUrl *string `json:"out_of_session_callback_url,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// An application-defined string that uniquely identifies the resource
	UniqueName *string `json:"unique_name,omitempty"`
	// The absolute URL of the Service resource
	Url *string `json:"url,omitempty"`
}

ProxyV1Service struct for ProxyV1Service

type ProxyV1ServicePhoneNumber

type ProxyV1ServicePhoneNumber struct {
	// The SID of the Account that created the resource
	AccountSid   *string                                `json:"account_sid,omitempty"`
	Capabilities *ProxyV1ServicePhoneNumberCapabilities `json:"capabilities,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 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 number of open session assigned to the number.
	InUse *int32 `json:"in_use,omitempty"`
	// Reserve the phone number for manual assignment to participants only
	IsReserved *bool `json:"is_reserved,omitempty"`
	// The ISO Country Code
	IsoCountry *string `json:"iso_country,omitempty"`
	// The phone number in E.164 format
	PhoneNumber *string `json:"phone_number,omitempty"`
	// The SID of the PhoneNumber resource's parent Service resource
	ServiceSid *string `json:"service_sid,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The absolute URL of the PhoneNumber resource
	Url *string `json:"url,omitempty"`
}

ProxyV1ServicePhoneNumber struct for ProxyV1ServicePhoneNumber

type ProxyV1ServicePhoneNumberCapabilities

type ProxyV1ServicePhoneNumberCapabilities struct {
	Fax   bool `json:"fax,omitempty"`
	Mms   bool `json:"mms,omitempty"`
	Sms   bool `json:"sms,omitempty"`
	Voice bool `json:"voice,omitempty"`
}

ProxyV1ServicePhoneNumberCapabilities The capabilities of the phone number

type ProxyV1ServiceSession

type ProxyV1ServiceSession struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The reason the Session ended
	ClosedReason *string `json:"closed_reason,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date when the Session ended
	DateEnded *time.Time `json:"date_ended,omitempty"`
	// The ISO 8601 date when the Session should expire
	DateExpiry *time.Time `json:"date_expiry,omitempty"`
	// The ISO 8601 date when the Session last had an interaction
	DateLastInteraction *time.Time `json:"date_last_interaction,omitempty"`
	// The ISO 8601 date when the Session started
	DateStarted *time.Time `json:"date_started,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The URLs of resources related to the Session
	Links *map[string]interface{} `json:"links,omitempty"`
	// The Mode of the Session
	Mode *string `json:"mode,omitempty"`
	// The SID of the resource's parent Service
	ServiceSid *string `json:"service_sid,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the Session
	Status *string `json:"status,omitempty"`
	// When the session will expire
	Ttl *int32 `json:"ttl,omitempty"`
	// An application-defined string that uniquely identifies the resource
	UniqueName *string `json:"unique_name,omitempty"`
	// The absolute URL of the Session resource
	Url *string `json:"url,omitempty"`
}

ProxyV1ServiceSession struct for ProxyV1ServiceSession

type ProxyV1ServiceSessionInteraction

type ProxyV1ServiceSessionInteraction struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// A JSON string that includes the message body of message interactions
	Data *string `json:"data,omitempty"`
	// The ISO 8601 date and time in GMT when the Interaction was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The SID of the inbound Participant resource
	InboundParticipantSid *string `json:"inbound_participant_sid,omitempty"`
	// The SID of the inbound resource
	InboundResourceSid *string `json:"inbound_resource_sid,omitempty"`
	// The inbound resource status of the Interaction
	InboundResourceStatus *string `json:"inbound_resource_status,omitempty"`
	// The inbound resource type
	InboundResourceType *string `json:"inbound_resource_type,omitempty"`
	// The URL of the Twilio inbound resource
	InboundResourceUrl *string `json:"inbound_resource_url,omitempty"`
	// The SID of the outbound Participant
	OutboundParticipantSid *string `json:"outbound_participant_sid,omitempty"`
	// The SID of the outbound resource
	OutboundResourceSid *string `json:"outbound_resource_sid,omitempty"`
	// The outbound resource status of the Interaction
	OutboundResourceStatus *string `json:"outbound_resource_status,omitempty"`
	// The outbound resource type
	OutboundResourceType *string `json:"outbound_resource_type,omitempty"`
	// The URL of the Twilio outbound resource
	OutboundResourceUrl *string `json:"outbound_resource_url,omitempty"`
	// The SID of the resource's parent Service
	ServiceSid *string `json:"service_sid,omitempty"`
	// The SID of the resource's parent Session
	SessionSid *string `json:"session_sid,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The Type of the Interaction
	Type *string `json:"type,omitempty"`
	// The absolute URL of the Interaction resource
	Url *string `json:"url,omitempty"`
}

ProxyV1ServiceSessionInteraction struct for ProxyV1ServiceSessionInteraction

type ProxyV1ServiceSessionParticipant

type ProxyV1ServiceSessionParticipant struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date the Participant was removed
	DateDeleted *time.Time `json:"date_deleted,omitempty"`
	// The ISO 8601 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 participant
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The phone number or channel identifier of the Participant
	Identifier *string `json:"identifier,omitempty"`
	// The URLs to resources related the participant
	Links *map[string]interface{} `json:"links,omitempty"`
	// The phone number or short code of the participant's partner
	ProxyIdentifier *string `json:"proxy_identifier,omitempty"`
	// The SID of the Proxy Identifier assigned to the Participant
	ProxyIdentifierSid *string `json:"proxy_identifier_sid,omitempty"`
	// The SID of the resource's parent Service
	ServiceSid *string `json:"service_sid,omitempty"`
	// The SID of the resource's parent Session
	SessionSid *string `json:"session_sid,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The absolute URL of the Participant resource
	Url *string `json:"url,omitempty"`
}

ProxyV1ServiceSessionParticipant struct for ProxyV1ServiceSessionParticipant

type ProxyV1ServiceSessionParticipantMessageInteraction

type ProxyV1ServiceSessionParticipantMessageInteraction struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// A JSON string that includes the message body sent to the participant
	Data *string `json:"data,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// Always empty for Message Interactions
	InboundParticipantSid *string `json:"inbound_participant_sid,omitempty"`
	// Always empty for Message Interactions
	InboundResourceSid *string `json:"inbound_resource_sid,omitempty"`
	// Always empty for Message Interactions
	InboundResourceStatus *string `json:"inbound_resource_status,omitempty"`
	// Always empty for Message Interactions
	InboundResourceType *string `json:"inbound_resource_type,omitempty"`
	// Always empty for Message Interactions
	InboundResourceUrl *string `json:"inbound_resource_url,omitempty"`
	// The SID of the outbound Participant resource
	OutboundParticipantSid *string `json:"outbound_participant_sid,omitempty"`
	// The SID of the outbound Message resource
	OutboundResourceSid *string `json:"outbound_resource_sid,omitempty"`
	// The outbound resource status
	OutboundResourceStatus *string `json:"outbound_resource_status,omitempty"`
	// The outbound resource type
	OutboundResourceType *string `json:"outbound_resource_type,omitempty"`
	// The URL of the Twilio message resource
	OutboundResourceUrl *string `json:"outbound_resource_url,omitempty"`
	// The SID of the Participant resource
	ParticipantSid *string `json:"participant_sid,omitempty"`
	// The SID of the resource's parent Service
	ServiceSid *string `json:"service_sid,omitempty"`
	// The SID of the resource's parent Session
	SessionSid *string `json:"session_sid,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The Type of Message Interaction
	Type *string `json:"type,omitempty"`
	// The absolute URL of the MessageInteraction resource
	Url *string `json:"url,omitempty"`
}

ProxyV1ServiceSessionParticipantMessageInteraction struct for ProxyV1ServiceSessionParticipantMessageInteraction

type ProxyV1ServiceShortCode

type ProxyV1ServiceShortCode struct {
	// The SID of the Account that created the resource
	AccountSid   *string                              `json:"account_sid,omitempty"`
	Capabilities *ProxyV1ServiceShortCodeCapabilities `json:"capabilities,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// Whether the short code should be reserved for manual assignment to participants only
	IsReserved *bool `json:"is_reserved,omitempty"`
	// The ISO Country Code
	IsoCountry *string `json:"iso_country,omitempty"`
	// The SID of the resource's parent Service
	ServiceSid *string `json:"service_sid,omitempty"`
	// The short code's number
	ShortCode *string `json:"short_code,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The absolute URL of the ShortCode resource
	Url *string `json:"url,omitempty"`
}

ProxyV1ServiceShortCode struct for ProxyV1ServiceShortCode

type ProxyV1ServiceShortCodeCapabilities

type ProxyV1ServiceShortCodeCapabilities struct {
	Fax   bool `json:"fax,omitempty"`
	Mms   bool `json:"mms,omitempty"`
	Sms   bool `json:"sms,omitempty"`
	Voice bool `json:"voice,omitempty"`
}

ProxyV1ServiceShortCodeCapabilities The capabilities of the short code

type UpdatePhoneNumberParams

type UpdatePhoneNumberParams struct {
	// Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.
	IsReserved *bool `json:"IsReserved,omitempty"`
}

Optional parameters for the method 'UpdatePhoneNumber'

func (*UpdatePhoneNumberParams) SetIsReserved

func (params *UpdatePhoneNumberParams) SetIsReserved(IsReserved bool) *UpdatePhoneNumberParams

type UpdateServiceParams

type UpdateServiceParams struct {
	// The URL we should call when the interaction status changes.
	CallbackUrl *string `json:"CallbackUrl,omitempty"`
	// The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship.
	ChatInstanceSid *string `json:"ChatInstanceSid,omitempty"`
	// The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value.
	DefaultTtl *int32 `json:"DefaultTtl,omitempty"`
	// Where a proxy number must be located relative to the participant identifier. Can be: `country`, `area-code`, or `extended-area-code`. The default value is `country` and more specific areas than `country` are only available in North America.
	GeoMatchLevel *string `json:"GeoMatchLevel,omitempty"`
	// The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues.
	InterceptCallbackUrl *string `json:"InterceptCallbackUrl,omitempty"`
	// The preference for Proxy Number selection in the Service instance. Can be: `prefer-sticky` or `avoid-sticky` and the default is `prefer-sticky`. `prefer-sticky` means that we will try and select the same Proxy Number for a given participant if they have previous [Sessions](https://www.twilio.com/docs/proxy/api/session), but we will not fail if that Proxy Number cannot be used.  `avoid-sticky` means that we will try to use different Proxy Numbers as long as that is possible within a given pool rather than try and use a previously assigned number.
	NumberSelectionBehavior *string `json:"NumberSelectionBehavior,omitempty"`
	// The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information.
	OutOfSessionCallbackUrl *string `json:"OutOfSessionCallbackUrl,omitempty"`
	// An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.**
	UniqueName *string `json:"UniqueName,omitempty"`
}

Optional parameters for the method 'UpdateService'

func (*UpdateServiceParams) SetCallbackUrl

func (params *UpdateServiceParams) SetCallbackUrl(CallbackUrl string) *UpdateServiceParams

func (*UpdateServiceParams) SetChatInstanceSid

func (params *UpdateServiceParams) SetChatInstanceSid(ChatInstanceSid string) *UpdateServiceParams

func (*UpdateServiceParams) SetDefaultTtl

func (params *UpdateServiceParams) SetDefaultTtl(DefaultTtl int32) *UpdateServiceParams

func (*UpdateServiceParams) SetGeoMatchLevel

func (params *UpdateServiceParams) SetGeoMatchLevel(GeoMatchLevel string) *UpdateServiceParams

func (*UpdateServiceParams) SetInterceptCallbackUrl

func (params *UpdateServiceParams) SetInterceptCallbackUrl(InterceptCallbackUrl string) *UpdateServiceParams

func (*UpdateServiceParams) SetNumberSelectionBehavior

func (params *UpdateServiceParams) SetNumberSelectionBehavior(NumberSelectionBehavior string) *UpdateServiceParams

func (*UpdateServiceParams) SetOutOfSessionCallbackUrl

func (params *UpdateServiceParams) SetOutOfSessionCallbackUrl(OutOfSessionCallbackUrl string) *UpdateServiceParams

func (*UpdateServiceParams) SetUniqueName

func (params *UpdateServiceParams) SetUniqueName(UniqueName string) *UpdateServiceParams

type UpdateSessionParams

type UpdateSessionParams struct {
	// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value.
	DateExpiry *time.Time `json:"DateExpiry,omitempty"`
	// [Experimental] For accounts with the ProxyAllowParticipantConflict account flag, setting to true enables per-request opt-in to allowing Proxy to return a 400 error (Twilio error code 80604) when a request to set a Session to in-progress would cause Participants with the same Identifier/ProxyIdentifier pair to be active in multiple Sessions. If not provided, requests will be allowed to succeed, and a Debugger notification (80801) will be emitted. Having multiple, active Participants with the same Identifier/ProxyIdentifier pair causes calls and messages from affected Participants to be routed incorrectly. Please note, the default behavior for accounts without the ProxyAllowParticipantConflict flag is to reject the request as described.  This will eventually be the default for all accounts.
	FailOnParticipantConflict *bool `json:"FailOnParticipantConflict,omitempty"`
	// The new status of the resource. Can be: `in-progress` to re-open a session or `closed` to close a session.
	Status *string `json:"Status,omitempty"`
	// The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.
	Ttl *int32 `json:"Ttl,omitempty"`
}

Optional parameters for the method 'UpdateSession'

func (*UpdateSessionParams) SetDateExpiry

func (params *UpdateSessionParams) SetDateExpiry(DateExpiry time.Time) *UpdateSessionParams

func (*UpdateSessionParams) SetFailOnParticipantConflict

func (params *UpdateSessionParams) SetFailOnParticipantConflict(FailOnParticipantConflict bool) *UpdateSessionParams

func (*UpdateSessionParams) SetStatus

func (params *UpdateSessionParams) SetStatus(Status string) *UpdateSessionParams

func (*UpdateSessionParams) SetTtl

func (params *UpdateSessionParams) SetTtl(Ttl int32) *UpdateSessionParams

type UpdateShortCodeParams

type UpdateShortCodeParams struct {
	// Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.
	IsReserved *bool `json:"IsReserved,omitempty"`
}

Optional parameters for the method 'UpdateShortCode'

func (*UpdateShortCodeParams) SetIsReserved

func (params *UpdateShortCodeParams) SetIsReserved(IsReserved bool) *UpdateShortCodeParams

Jump to

Keyboard shortcuts

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