messages

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package messages contains auto-generated files. DO NOT MODIFY

Package messages contains auto-generated files. DO NOT MODIFY

Package messages contains auto-generated files. DO NOT MODIFY

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for managing message resources See https://www.twilio.com/docs/sms/api/message-resource for more details

func New

func New(client *client.Client, properties ClientProperties) *Client

New creates a new instance of the messages client

func (Client) Create

Create creates a new message resource See https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource for more details Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information

func (Client) CreateWithContext

func (c Client) CreateWithContext(context context.Context, input *CreateMessageInput) (*CreateMessageResponse, error)

CreateWithContext creates a new message resource See https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource for more details

func (*Client) NewMessagesPaginator

func (c *Client) NewMessagesPaginator() *MessagesPaginator

NewMessagesPaginator creates a new instance of the paginator for Page.

func (*Client) NewMessagesPaginatorWithOptions

func (c *Client) NewMessagesPaginatorWithOptions(options *MessagesPageOptions) *MessagesPaginator

NewMessagesPaginatorWithOptions creates a new instance of the paginator for Page with options.

func (Client) Page

Page retrieves a page of messages See https://www.twilio.com/docs/sms/api/message-resource#read-multiple-message-resources for more details Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information

func (Client) PageWithContext

func (c Client) PageWithContext(context context.Context, options *MessagesPageOptions) (*MessagesPageResponse, error)

PageWithContext retrieves a page of messages See https://www.twilio.com/docs/sms/api/message-resource#read-multiple-message-resources for more details

type ClientProperties

type ClientProperties struct {
	AccountSid string
}

ClientProperties are the properties required to manage the messages resources

type CreateMessageInput

type CreateMessageInput struct {
	AddressRetention    *string   `form:"AddressRetention,omitempty"`
	ApplicationSid      *string   `form:"ApplicationSid,omitempty"`
	Attempt             *int      `form:"Attempt,omitempty"`
	Body                *string   `form:"Body,omitempty"`
	ContentRetention    *string   `form:"ContentRetention,omitempty"`
	ForceDelivery       *bool     `form:"ForceDelivery,omitempty"`
	From                *string   `form:"From,omitempty"`
	MaxPrice            *string   `form:"MaxPrice,omitempty"`
	MediaURLs           *[]string `form:"MediaUrl,omitempty"`
	MessagingServiceSid *string   `form:"MessagingServiceSid,omitempty"`
	PersistentActions   *[]string `form:"PersistentAction,omitempty"`
	ProvideFeedback     *bool     `form:"ProvideFeedback,omitempty"`
	SmartEncoded        *bool     `form:"SmartEncoded,omitempty"`
	StatusCallback      *string   `form:"StatusCallback,omitempty"`
	To                  string    `validate:"required" form:"To"`
	ValidityPeriod      *int      `form:"ValidityPeriod,omitempty"`
}

CreateMessageInput defines input fields for creating a new message resource

type CreateMessageResponse

type CreateMessageResponse struct {
	APIVersion          string             `json:"api_version"`
	AccountSid          string             `json:"account_sid"`
	Body                string             `json:"body"`
	DateCreated         utils.RFC2822Time  `json:"date_created"`
	DateSent            utils.RFC2822Time  `json:"date_sent"`
	DateUpdated         *utils.RFC2822Time `json:"date_updated,omitempty"`
	Direction           string             `json:"direction"`
	ErrorCode           *int               `json:"error_code,omitempty"`
	ErrorMessage        *string            `json:"error_message,omitempty"`
	From                *string            `json:"from,omitempty"`
	MessagingServiceSid *string            `json:"messaging_service_sid,omitempty"`
	NumMedia            string             `json:"num_media"`
	NumSegments         string             `json:"num_segments"`
	Price               *string            `json:"price,omitempty"`
	PriceUnit           string             `json:"price_unit"`
	Sid                 string             `json:"sid"`
	Status              string             `json:"status"`
	To                  string             `json:"to"`
}

CreateMessageResponse defines the response fields for the created message

type MessagesPage

type MessagesPage struct {
	CurrentPage *MessagesPageResponse
	Error       error
	// contains filtered or unexported fields
}

MessagesPage defines the fields for the page The CurrentPage and Error fields can be used to access the PageMessageResponse or error that is returned from the api call(s)

type MessagesPageOptions

type MessagesPageOptions struct {
	PageSize  *int
	Page      *int
	PageToken *string
	To        *string
	From      *string
	DateSent  *string
}

MessagesPageOptions defines the query options for the api operation

type MessagesPageResponse

type MessagesPageResponse struct {
	End             int                   `json:"end"`
	FirstPageURI    string                `json:"first_page_uri"`
	Messages        []PageMessageResponse `json:"messages"`
	NextPageURI     *string               `json:"next_page_uri,omitempty"`
	Page            int                   `json:"page"`
	PageSize        int                   `json:"page_size"`
	PreviousPageURI *string               `json:"previous_page_uri,omitempty"`
	Start           int                   `json:"start"`
	URI             string                `json:"uri"`
}

MessagesPageResponse defines the response fields for the messages page

type MessagesPaginator

type MessagesPaginator struct {
	Page     *MessagesPage
	Messages []PageMessageResponse
	// contains filtered or unexported fields
}

MessagesPaginator defines the fields for makings paginated api calls Messages is an array of messages that have been returned from all of the page calls

func (*MessagesPaginator) CurrentPage

func (p *MessagesPaginator) CurrentPage() *MessagesPageResponse

CurrentPage retrieves the results for the current page

func (*MessagesPaginator) Error

func (p *MessagesPaginator) Error() error

Error retrieves the error returned from the page

func (*MessagesPaginator) Next

func (p *MessagesPaginator) Next() bool

Next retrieves the next page of results. Next will return false when either an error occurs or there are no more pages to iterate Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information

func (*MessagesPaginator) NextWithContext

func (p *MessagesPaginator) NextWithContext(context context.Context) bool

NextWithContext retrieves the next page of results. NextWithContext will return false when either an error occurs or there are no more pages to iterate

type PageMessageResponse

type PageMessageResponse struct {
	APIVersion          string             `json:"api_version"`
	AccountSid          string             `json:"account_sid"`
	Body                string             `json:"body"`
	DateCreated         utils.RFC2822Time  `json:"date_created"`
	DateSent            utils.RFC2822Time  `json:"date_sent"`
	DateUpdated         *utils.RFC2822Time `json:"date_updated,omitempty"`
	Direction           string             `json:"direction"`
	ErrorCode           *int               `json:"error_code,omitempty"`
	ErrorMessage        *string            `json:"error_message,omitempty"`
	From                *string            `json:"from,omitempty"`
	MessagingServiceSid *string            `json:"messaging_service_sid,omitempty"`
	NumMedia            string             `json:"num_media"`
	NumSegments         string             `json:"num_segments"`
	Price               *string            `json:"price,omitempty"`
	PriceUnit           string             `json:"price_unit"`
	Sid                 string             `json:"sid"`
	Status              string             `json:"status"`
	To                  string             `json:"to"`
}

Jump to

Keyboard shortcuts

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