messages

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 7 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/conversations/api/conversation-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 See https://www.twilio.com/docs/conversations/api/conversation-message-resource#create-a-conversationmessage-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 See https://www.twilio.com/docs/conversations/api/conversation-message-resource#create-a-conversationmessage-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/conversations/api/conversation-message-resource#list-all-conversation-messages 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/conversations/api/conversation-message-resource#list-all-conversation-messages for more details

type ClientProperties

type ClientProperties struct {
	ConversationSid string
	ServiceSid      string
}

ClientProperties are the properties required to manage the messages resources

type CreateMessageDeliveryResponse added in v0.6.0

type CreateMessageDeliveryResponse struct {
	Delivered   string `json:"delivered"`
	Failed      string `json:"failed"`
	Read        string `json:"read"`
	Sent        string `json:"sent"`
	Total       int    `json:"total"`
	Undelivered string `json:"undelivered"`
}

type CreateMessageInput

type CreateMessageInput struct {
	Attributes  *string            `form:"Attributes,omitempty"`
	Author      *string            `form:"Author,omitempty"`
	Body        *string            `form:"Body,omitempty"`
	DateCreated *utils.RFC2822Time `form:"DateCreated,omitempty"`
	DateUpdated *utils.RFC2822Time `form:"DateUpdated,omitempty"`
	MediaSid    *string            `form:"MediaSid,omitempty"`
}

CreateMessageInput defines the input fields for creating a new message resource

type CreateMessageMediaResponse added in v0.6.0

type CreateMessageMediaResponse struct {
	ContentType string `json:"content_type"`
	Filename    string `json:"filename"`
	Sid         string `json:"sid"`
	Size        int    `json:"size"`
}

type CreateMessageResponse

type CreateMessageResponse struct {
	AccountSid      string                         `json:"account_sid"`
	Attributes      string                         `json:"attributes"`
	Author          string                         `json:"author"`
	Body            *string                        `json:"body,omitempty"`
	ChatServiceSid  string                         `json:"chat_service_sid"`
	ConversationSid string                         `json:"conversation_sid"`
	DateCreated     time.Time                      `json:"date_created"`
	DateUpdated     *time.Time                     `json:"date_updated,omitempty"`
	Delivery        *CreateMessageDeliveryResponse `json:"delivery,omitempty"`
	Index           int                            `json:"index"`
	Media           *[]CreateMessageMediaResponse  `json:"media,omitempty"`
	ParticipantSid  *string                        `json:"participant_sid,omitempty"`
	Sid             string                         `json:"sid"`
	URL             string                         `json:"url"`
}

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
}

MessagesPageOptions defines the query options for the api operation

type MessagesPageResponse

type MessagesPageResponse struct {
	Messages []PageMessageResponse `json:"messages"`
	Meta     PageMetaResponse      `json:"meta"`
}

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 PageMessageDeliveryResponse added in v0.6.0

type PageMessageDeliveryResponse struct {
	Delivered   string `json:"delivered"`
	Failed      string `json:"failed"`
	Read        string `json:"read"`
	Sent        string `json:"sent"`
	Total       int    `json:"total"`
	Undelivered string `json:"undelivered"`
}

type PageMessageMediaResponse added in v0.6.0

type PageMessageMediaResponse struct {
	ContentType string `json:"content_type"`
	Filename    string `json:"filename"`
	Sid         string `json:"sid"`
	Size        int    `json:"size"`
}

type PageMessageResponse

type PageMessageResponse struct {
	AccountSid      string                       `json:"account_sid"`
	Attributes      string                       `json:"attributes"`
	Author          string                       `json:"author"`
	Body            *string                      `json:"body,omitempty"`
	ChatServiceSid  string                       `json:"chat_service_sid"`
	ConversationSid string                       `json:"conversation_sid"`
	DateCreated     time.Time                    `json:"date_created"`
	DateUpdated     *time.Time                   `json:"date_updated,omitempty"`
	Delivery        *PageMessageDeliveryResponse `json:"delivery,omitempty"`
	Index           int                          `json:"index"`
	Media           *[]PageMessageMediaResponse  `json:"media,omitempty"`
	ParticipantSid  *string                      `json:"participant_sid,omitempty"`
	Sid             string                       `json:"sid"`
	URL             string                       `json:"url"`
}

type PageMetaResponse

type PageMetaResponse struct {
	FirstPageURL    string  `json:"first_page_url"`
	Key             string  `json:"key"`
	NextPageURL     *string `json:"next_page_url,omitempty"`
	Page            int     `json:"page"`
	PageSize        int     `json:"page_size"`
	PreviousPageURL *string `json:"previous_page_url,omitempty"`
	URL             string  `json:"url"`
}

Jump to

Keyboard shortcuts

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