samples

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package samples contains auto-generated files. DO NOT MODIFY

Package samples contains auto-generated files. DO NOT MODIFY

Package samples 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 task sample resources See https://www.twilio.com/docs/autopilot/api/task-sample for more details

func New

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

New creates a new instance of the samples client

func (Client) Create

func (c Client) Create(input *CreateSampleInput) (*CreateSampleResponse, error)

Create creates a new task sample See https://www.twilio.com/docs/autopilot/api/task-sample#create-a-sample-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 *CreateSampleInput) (*CreateSampleResponse, error)

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

func (*Client) NewSamplesPaginator

func (c *Client) NewSamplesPaginator() *SamplesPaginator

NewSamplesPaginator creates a new instance of the paginator for Page.

func (*Client) NewSamplesPaginatorWithOptions

func (c *Client) NewSamplesPaginatorWithOptions(options *SamplesPageOptions) *SamplesPaginator

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

func (Client) Page

func (c Client) Page(options *SamplesPageOptions) (*SamplesPageResponse, error)

Page retrieves a page of samples See https://www.twilio.com/docs/autopilot/api/task-sample#read-multiple-sample-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 *SamplesPageOptions) (*SamplesPageResponse, error)

PageWithContext retrieves a page of samples See https://www.twilio.com/docs/autopilot/api/task-sample#read-multiple-sample-resources for more details

type ClientProperties

type ClientProperties struct {
	AssistantSid string
	TaskSid      string
}

ClientProperties are the properties required to manage the samples resources

type CreateSampleInput

type CreateSampleInput struct {
	Language      string  `validate:"required" form:"Language"`
	SourceChannel *string `form:"SourceChannel,omitempty"`
	TaggedText    string  `validate:"required" form:"TaggedText"`
}

CreateSampleInput defines the input fields for creating a new task sample resource

type CreateSampleResponse

type CreateSampleResponse struct {
	AccountSid    string     `json:"account_sid"`
	AssistantSid  string     `json:"assistant_sid"`
	DateCreated   time.Time  `json:"date_created"`
	DateUpdated   *time.Time `json:"date_updated,omitempty"`
	Language      string     `json:"language"`
	Sid           string     `json:"sid"`
	SourceChannel *string    `json:"source_channel,omitempty"`
	TaggedText    string     `json:"tagged_text"`
	TaskSid       string     `json:"task_sid"`
	URL           string     `json:"url"`
}

CreateSampleResponse defines the response fields for the created task sample

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

type PageSampleResponse

type PageSampleResponse struct {
	AccountSid    string     `json:"account_sid"`
	AssistantSid  string     `json:"assistant_sid"`
	DateCreated   time.Time  `json:"date_created"`
	DateUpdated   *time.Time `json:"date_updated,omitempty"`
	Language      string     `json:"language"`
	Sid           string     `json:"sid"`
	SourceChannel *string    `json:"source_channel,omitempty"`
	TaggedText    string     `json:"tagged_text"`
	TaskSid       string     `json:"task_sid"`
	URL           string     `json:"url"`
}

type SamplesPage

type SamplesPage struct {
	CurrentPage *SamplesPageResponse
	Error       error
	// contains filtered or unexported fields
}

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

type SamplesPageOptions

type SamplesPageOptions struct {
	Language  *string
	PageSize  *int
	Page      *int
	PageToken *string
}

SamplesPageOptions defines the query options for the api operation

type SamplesPageResponse

type SamplesPageResponse struct {
	Meta    PageMetaResponse     `json:"meta"`
	Samples []PageSampleResponse `json:"samples"`
}

SamplesPageResponse defines the response fields for the samples page

type SamplesPaginator

type SamplesPaginator struct {
	Page    *SamplesPage
	Samples []PageSampleResponse
	// contains filtered or unexported fields
}

SamplesPaginator defines the fields for makings paginated api calls Samples is an array of samples that have been returned from all of the page calls

func (*SamplesPaginator) CurrentPage

func (p *SamplesPaginator) CurrentPage() *SamplesPageResponse

CurrentPage retrieves the results for the current page

func (*SamplesPaginator) Error

func (p *SamplesPaginator) Error() error

Error retrieves the error returned from the page

func (*SamplesPaginator) Next

func (p *SamplesPaginator) 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 (*SamplesPaginator) NextWithContext

func (p *SamplesPaginator) 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

Jump to

Keyboard shortcuts

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