func (c *ApiService) ListQuery(AssistantSid string, params *ListQueryParams) ([]AutopilotV1Query, error) {
	if params == nil {
		params = &ListQueryParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageQuery(AssistantSid, params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	var records []AutopilotV1Query
	for response != nil {
		records = append(records, response.Queries...)
		var record interface{}
		if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListQueryResponse); record == nil || err != nil {
			return records, err
		}
		response = record.(*ListQueryResponse)
	}
	return records, err
}
Lists Query records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
package openapi
import (
	"encoding/json"
	"fmt"
	"net/url"
	"strings"
	"github.com/twilio/twilio-go/client"
)
type CreateQueryParams struct {
	Language *string `json:"Language,omitempty"`
	ModelBuild *string `json:"ModelBuild,omitempty"`
	Query *string `json:"Query,omitempty"`
	Tasks *string `json:"Tasks,omitempty"`
}
func (params *CreateQueryParams) SetLanguage(Language string) *CreateQueryParams {
	params.Language = &Language
	return params
}
func (params *CreateQueryParams) SetModelBuild(ModelBuild string) *CreateQueryParams {
	params.ModelBuild = &ModelBuild
	return params
}
func (params *CreateQueryParams) SetQuery(Query string) *CreateQueryParams {
	params.Query = &Query
	return params
}
func (params *CreateQueryParams) SetTasks(Tasks string) *CreateQueryParams {
	params.Tasks = &Tasks
	return params
}
func (c *ApiService) CreateQuery(AssistantSid string, params *CreateQueryParams) (*AutopilotV1Query, error) {
	path := "/v1/Assistants/{AssistantSid}/Queries"
	path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.Language != nil {
		data.Set("Language", *params.Language)
	}
	if params != nil && params.ModelBuild != nil {
		data.Set("ModelBuild", *params.ModelBuild)
	}
	if params != nil && params.Query != nil {
		data.Set("Query", *params.Query)
	}
	if params != nil && params.Tasks != nil {
		data.Set("Tasks", *params.Tasks)
	}
	resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &AutopilotV1Query{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) DeleteQuery(AssistantSid string, Sid string) error {
	path := "/v1/Assistants/{AssistantSid}/Queries/{Sid}"
	path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1)
	path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	return nil
}
func (c *ApiService) FetchQuery(AssistantSid string, Sid string) (*AutopilotV1Query, error) {
	path := "/v1/Assistants/{AssistantSid}/Queries/{Sid}"
	path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1)
	path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &AutopilotV1Query{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
type ListQueryParams struct {
	Language *string `json:"Language,omitempty"`
	ModelBuild *string `json:"ModelBuild,omitempty"`
	Status *string `json:"Status,omitempty"`
	DialogueSid *string `json:"DialogueSid,omitempty"`
	PageSize *int `json:"PageSize,omitempty"`
	Limit *int `json:"limit,omitempty"`
}
func (params *ListQueryParams) SetLanguage(Language string) *ListQueryParams {
	params.Language = &Language
	return params
}
func (params *ListQueryParams) SetModelBuild(ModelBuild string) *ListQueryParams {
	params.ModelBuild = &ModelBuild
	return params
}
func (params *ListQueryParams) SetStatus(Status string) *ListQueryParams {
	params.Status = &Status
	return params
}
func (params *ListQueryParams) SetDialogueSid(DialogueSid string) *ListQueryParams {
	params.DialogueSid = &DialogueSid
	return params
}
func (params *ListQueryParams) SetPageSize(PageSize int) *ListQueryParams {
	params.PageSize = &PageSize
	return params
}
func (params *ListQueryParams) SetLimit(Limit int) *ListQueryParams {
	params.Limit = &Limit
	return params
}
func (c *ApiService) PageQuery(AssistantSid string, params *ListQueryParams, pageToken, pageNumber string) (*ListQueryResponse, error) {
	path := "/v1/Assistants/{AssistantSid}/Queries"
	path = strings.Replace(path, "{"+"AssistantSid"+"}", AssistantSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.Language != nil {
		data.Set("Language", *params.Language)
	}
	if params != nil && params.ModelBuild != nil {
		data.Set("ModelBuild", *params.ModelBuild)
	}
	if params != nil && params.Status != nil {
		data.Set("Status", *params.Status)
	}
	if params != nil && params.DialogueSid != nil {
		data.Set("DialogueSid", *params.DialogueSid)
	}
	if params != nil && params.PageSize != nil {
		data.Set("PageSize", fmt.Sprint(*params.PageSize))
	}
	if pageToken != "" {
		data.Set("PageToken", pageToken)
	}
	if pageNumber != "" {
		data.Set("Page", pageNumber)
	}
	resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &ListQueryResponse{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}