queries

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

This is an autogenerated file. DO NOT MODIFY

This is an autogenerated file. DO NOT MODIFY

This is an autogenerated file. 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 query resources See https://www.twilio.com/docs/autopilot/api/query for more details

func New

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

New creates a new instance of the queries client

func (Client) Create

func (c Client) Create(input *CreateQueryInput) (*CreateQueryResponse, error)

Create creates a new query resource See https://www.twilio.com/docs/autopilot/api/query#create-a-query-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 *CreateQueryInput) (*CreateQueryResponse, error)

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

func (*Client) NewQueriesPaginator

func (c *Client) NewQueriesPaginator() *QueriesPaginator

NewQueriesPaginator creates a new instance of the paginator for Page.

func (*Client) NewQueriesPaginatorWithOptions

func (c *Client) NewQueriesPaginatorWithOptions(options *QueriesPageOptions) *QueriesPaginator

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

func (Client) Page

func (c Client) Page(options *QueriesPageOptions) (*QueriesPageResponse, error)

Page retrieves a page of queries See https://www.twilio.com/docs/autopilot/api/query?code-sample=code-read-list-all-queries-for-an-assistant 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 *QueriesPageOptions) (*QueriesPageResponse, error)

PageWithContext retrieves a page of queries See https://www.twilio.com/docs/autopilot/api/query?code-sample=code-read-list-all-queries-for-an-assistant for more details

type ClientProperties

type ClientProperties struct {
	AssistantSid string
}

ClientProperties are the properties required to manage the queries resources

type CreateQueryInput

type CreateQueryInput struct {
	Language   string  `validate:"required" form:"Language"`
	ModelBuild *string `form:"ModelBuild,omitempty"`
	Query      string  `validate:"required" form:"Query"`
	Tasks      *string `form:"Tasks,omitempty"`
}

CreateQueryInput defines the input fields for creating a new query resource

type CreateQueryResponse

type CreateQueryResponse struct {
	AccountSid    string                    `json:"account_sid"`
	AssistantSid  string                    `json:"assistant_sid"`
	DateCreated   time.Time                 `json:"date_created"`
	DateUpdated   *time.Time                `json:"date_updated,omitempty"`
	DialogueSid   *string                   `json:"dialogue_sid,omitempty"`
	Language      string                    `json:"language"`
	ModelBuildSid string                    `json:"model_build_sid"`
	Query         string                    `json:"query"`
	Results       CreateQueryResponseResult `json:"results"`
	SampleSid     string                    `json:"sample_sid"`
	Sid           string                    `json:"sid"`
	SourceChannel string                    `json:"source_channel"`
	Status        string                    `json:"status"`
	URL           string                    `json:"url"`
}

CreateQueryResponse defines the response fields for the created query

type CreateQueryResponseField

type CreateQueryResponseField struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

type CreateQueryResponseResult

type CreateQueryResponseResult struct {
	Fields []CreateQueryResponseField `json:"fields"`
	Task   string                     `json:"task"`
}

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 PageQueryResponse

type PageQueryResponse struct {
	AccountSid    string                  `json:"account_sid"`
	AssistantSid  string                  `json:"assistant_sid"`
	DateCreated   time.Time               `json:"date_created"`
	DateUpdated   *time.Time              `json:"date_updated,omitempty"`
	DialogueSid   *string                 `json:"dialogue_sid,omitempty"`
	Language      string                  `json:"language"`
	ModelBuildSid string                  `json:"model_build_sid"`
	Query         string                  `json:"query"`
	Results       PageQueryResponseResult `json:"results"`
	SampleSid     string                  `json:"sample_sid"`
	Sid           string                  `json:"sid"`
	SourceChannel string                  `json:"source_channel"`
	Status        string                  `json:"status"`
	URL           string                  `json:"url"`
}

type PageQueryResponseField

type PageQueryResponseField struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

type PageQueryResponseResult

type PageQueryResponseResult struct {
	Fields []PageQueryResponseField `json:"fields"`
	Task   string                   `json:"task"`
}

type QueriesPage

type QueriesPage struct {
	CurrentPage *QueriesPageResponse
	Error       error
	// contains filtered or unexported fields
}

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

type QueriesPageOptions

type QueriesPageOptions struct {
	Language    *string
	ModelBuild  *string
	Status      *string
	DialogueSid *string
	PageSize    *int
	Page        *int
	PageToken   *string
}

QueriesPageOptions defines the query options for the api operation

type QueriesPageResponse

type QueriesPageResponse struct {
	Meta    PageMetaResponse    `json:"meta"`
	Queries []PageQueryResponse `json:"queries"`
}

QueriesPageResponse defines the response fields for the query page

type QueriesPaginator

type QueriesPaginator struct {
	Page    *QueriesPage
	Queries []PageQueryResponse
	// contains filtered or unexported fields
}

QueriesPaginator defines the fields for makings paginated api calls Queries is an array of queries that have been returned from all of the page calls

func (*QueriesPaginator) CurrentPage

func (p *QueriesPaginator) CurrentPage() *QueriesPageResponse

CurrentPage retrieves the results for the current page

func (*QueriesPaginator) Error

func (p *QueriesPaginator) Error() error

Error retrieves the error returned from the page

func (*QueriesPaginator) Next

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

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