openapi

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 6 Imported by: 1

README

Go API client for openapi

This is the public Twilio REST API.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/twilio-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.18.0
  • Package version: 1.0.0
  • Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit https://support.twilio.com

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://studio.twilio.com

Class Method HTTP request Description
FlowsApi CreateFlow Post /v2/Flows
FlowsApi DeleteFlow Delete /v2/Flows/{Sid}
FlowsApi FetchFlow Get /v2/Flows/{Sid}
FlowsApi ListFlow Get /v2/Flows
FlowsApi UpdateFlow Post /v2/Flows/{Sid}
FlowsExecutionsApi CreateExecution Post /v2/Flows/{FlowSid}/Executions
FlowsExecutionsApi DeleteExecution Delete /v2/Flows/{FlowSid}/Executions/{Sid}
FlowsExecutionsApi FetchExecution Get /v2/Flows/{FlowSid}/Executions/{Sid}
FlowsExecutionsApi ListExecution Get /v2/Flows/{FlowSid}/Executions
FlowsExecutionsApi UpdateExecution Post /v2/Flows/{FlowSid}/Executions/{Sid}
FlowsExecutionsContextApi FetchExecutionContext Get /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Context
FlowsExecutionsStepsApi FetchExecutionStep Get /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Steps/{Sid}
FlowsExecutionsStepsApi ListExecutionStep Get /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Steps
FlowsExecutionsStepsContextApi FetchExecutionStepContext Get /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Steps/{StepSid}/Context
FlowsRevisionsApi FetchFlowRevision Get /v2/Flows/{Sid}/Revisions/{Revision}
FlowsRevisionsApi ListFlowRevision Get /v2/Flows/{Sid}/Revisions
FlowsTestUsersApi FetchTestUser Get /v2/Flows/{Sid}/TestUsers
FlowsTestUsersApi UpdateTestUser Post /v2/Flows/{Sid}/TestUsers
FlowsValidateApi UpdateFlowValidate Post /v2/Flows/Validate

Documentation For Models

Documentation For Authorization

accountSid_authToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService added in v0.11.0

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

func NewApiService added in v0.11.0

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient added in v0.11.0

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) CreateExecution added in v0.11.0

func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionParams) (*StudioV2FlowExecution, error)

Triggers a new Execution for the Flow

func (*ApiService) CreateFlow added in v0.11.0

func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error)

Create a Flow.

func (*ApiService) DeleteExecution added in v0.11.0

func (c *ApiService) DeleteExecution(FlowSid string, Sid string) error

Delete the Execution and all Steps relating to it.

func (*ApiService) DeleteFlow added in v0.11.0

func (c *ApiService) DeleteFlow(Sid string) error

Delete a specific Flow.

func (*ApiService) FetchExecution added in v0.11.0

func (c *ApiService) FetchExecution(FlowSid string, Sid string) (*StudioV2FlowExecution, error)

Retrieve an Execution

func (*ApiService) FetchExecutionContext added in v0.11.0

func (c *ApiService) FetchExecutionContext(FlowSid string, ExecutionSid string) (*StudioV2FlowExecutionExecutionContext, error)

Retrieve the most recent context for an Execution.

func (*ApiService) FetchExecutionStep added in v0.11.0

func (c *ApiService) FetchExecutionStep(FlowSid string, ExecutionSid string, Sid string) (*StudioV2FlowExecutionExecutionStep, error)

Retrieve a Step.

func (*ApiService) FetchExecutionStepContext added in v0.11.0

func (c *ApiService) FetchExecutionStepContext(FlowSid string, ExecutionSid string, StepSid string) (*StudioV2FlowExecutionExecutionStepExecutionStepContext, error)

Retrieve the context for an Execution Step.

func (*ApiService) FetchFlow added in v0.11.0

func (c *ApiService) FetchFlow(Sid string) (*StudioV2Flow, error)

Retrieve a specific Flow.

func (*ApiService) FetchFlowRevision added in v0.11.0

func (c *ApiService) FetchFlowRevision(Sid string, Revision string) (*StudioV2FlowFlowRevision, error)

Retrieve a specific Flow revision.

func (*ApiService) FetchTestUser added in v0.11.0

func (c *ApiService) FetchTestUser(Sid string) (*StudioV2FlowTestUser, error)

Fetch flow test users

func (*ApiService) ListExecution added in v0.11.0

func (c *ApiService) ListExecution(FlowSid string, params *ListExecutionParams) (*ListExecutionResponse, error)

Retrieve a list of all Executions for the Flow.

func (*ApiService) ListExecutionStep added in v0.11.0

func (c *ApiService) ListExecutionStep(FlowSid string, ExecutionSid string, params *ListExecutionStepParams) (*ListExecutionStepResponse, error)

Retrieve a list of all Steps for an Execution.

func (*ApiService) ListFlow added in v0.11.0

func (c *ApiService) ListFlow(params *ListFlowParams) (*ListFlowResponse, error)

Retrieve a list of all Flows.

func (*ApiService) ListFlowRevision added in v0.11.0

func (c *ApiService) ListFlowRevision(Sid string, params *ListFlowRevisionParams) (*ListFlowRevisionResponse, error)

Retrieve a list of all Flows revisions.

func (*ApiService) UpdateExecution added in v0.11.0

func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateExecutionParams) (*StudioV2FlowExecution, error)

Update the status of an Execution to `ended`.

func (*ApiService) UpdateFlow added in v0.11.0

func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2Flow, error)

Update a Flow.

func (*ApiService) UpdateFlowValidate added in v0.11.0

func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*StudioV2FlowValidate, error)

Validate flow JSON definition

func (*ApiService) UpdateTestUser added in v0.11.0

func (c *ApiService) UpdateTestUser(Sid string, params *UpdateTestUserParams) (*StudioV2FlowTestUser, error)

Update flow test users

type CreateExecutionParams

type CreateExecutionParams struct {
	// The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID.
	From *string `json:"From,omitempty"`
	// JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string.
	Parameters *map[string]interface{} `json:"Parameters,omitempty"`
	// The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`.
	To *string `json:"To,omitempty"`
}

Optional parameters for the method 'CreateExecution'

func (*CreateExecutionParams) SetFrom

func (params *CreateExecutionParams) SetFrom(From string) *CreateExecutionParams

func (*CreateExecutionParams) SetParameters

func (params *CreateExecutionParams) SetParameters(Parameters map[string]interface{}) *CreateExecutionParams

func (*CreateExecutionParams) SetTo

type CreateFlowParams

type CreateFlowParams struct {
	// Description of change made in the revision.
	CommitMessage *string `json:"CommitMessage,omitempty"`
	// JSON representation of flow definition.
	Definition *map[string]interface{} `json:"Definition,omitempty"`
	// The string that you assigned to describe the Flow.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The status of the Flow. Can be: `draft` or `published`.
	Status *string `json:"Status,omitempty"`
}

Optional parameters for the method 'CreateFlow'

func (*CreateFlowParams) SetCommitMessage

func (params *CreateFlowParams) SetCommitMessage(CommitMessage string) *CreateFlowParams

func (*CreateFlowParams) SetDefinition

func (params *CreateFlowParams) SetDefinition(Definition map[string]interface{}) *CreateFlowParams

func (*CreateFlowParams) SetFriendlyName

func (params *CreateFlowParams) SetFriendlyName(FriendlyName string) *CreateFlowParams

func (*CreateFlowParams) SetStatus

func (params *CreateFlowParams) SetStatus(Status string) *CreateFlowParams

type ListExecutionParams

type ListExecutionParams struct {
	// Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`.
	DateCreatedFrom *time.Time `json:"DateCreatedFrom,omitempty"`
	// Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`.
	DateCreatedTo *time.Time `json:"DateCreatedTo,omitempty"`
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
}

Optional parameters for the method 'ListExecution'

func (*ListExecutionParams) SetDateCreatedFrom

func (params *ListExecutionParams) SetDateCreatedFrom(DateCreatedFrom time.Time) *ListExecutionParams

func (*ListExecutionParams) SetDateCreatedTo

func (params *ListExecutionParams) SetDateCreatedTo(DateCreatedTo time.Time) *ListExecutionParams

func (*ListExecutionParams) SetPageSize

func (params *ListExecutionParams) SetPageSize(PageSize int) *ListExecutionParams

type ListExecutionResponse

type ListExecutionResponse struct {
	Executions []StudioV2FlowExecution `json:"executions,omitempty"`
	Meta       ListFlowResponseMeta    `json:"meta,omitempty"`
}

ListExecutionResponse struct for ListExecutionResponse

type ListExecutionStepParams

type ListExecutionStepParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
}

Optional parameters for the method 'ListExecutionStep'

func (*ListExecutionStepParams) SetPageSize

func (params *ListExecutionStepParams) SetPageSize(PageSize int) *ListExecutionStepParams

type ListExecutionStepResponse

type ListExecutionStepResponse struct {
	Meta  ListFlowResponseMeta                 `json:"meta,omitempty"`
	Steps []StudioV2FlowExecutionExecutionStep `json:"steps,omitempty"`
}

ListExecutionStepResponse struct for ListExecutionStepResponse

type ListFlowParams

type ListFlowParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
}

Optional parameters for the method 'ListFlow'

func (*ListFlowParams) SetPageSize

func (params *ListFlowParams) SetPageSize(PageSize int) *ListFlowParams

type ListFlowResponse

type ListFlowResponse struct {
	Flows []StudioV2Flow       `json:"flows,omitempty"`
	Meta  ListFlowResponseMeta `json:"meta,omitempty"`
}

ListFlowResponse struct for ListFlowResponse

type ListFlowResponseMeta

type ListFlowResponseMeta struct {
	FirstPageUrl    string `json:"first_page_url,omitempty"`
	Key             string `json:"key,omitempty"`
	NextPageUrl     string `json:"next_page_url,omitempty"`
	Page            int    `json:"page,omitempty"`
	PageSize        int    `json:"page_size,omitempty"`
	PreviousPageUrl string `json:"previous_page_url,omitempty"`
	Url             string `json:"url,omitempty"`
}

ListFlowResponseMeta struct for ListFlowResponseMeta

type ListFlowRevisionParams

type ListFlowRevisionParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
}

Optional parameters for the method 'ListFlowRevision'

func (*ListFlowRevisionParams) SetPageSize

func (params *ListFlowRevisionParams) SetPageSize(PageSize int) *ListFlowRevisionParams

type ListFlowRevisionResponse

type ListFlowRevisionResponse struct {
	Meta      ListFlowResponseMeta       `json:"meta,omitempty"`
	Revisions []StudioV2FlowFlowRevision `json:"revisions,omitempty"`
}

ListFlowRevisionResponse struct for ListFlowRevisionResponse

type StudioV2Flow

type StudioV2Flow struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// Description of change made in the revision
	CommitMessage *string `json:"commit_message,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// JSON representation of flow definition
	Definition *map[string]interface{} `json:"definition,omitempty"`
	// List of error in the flow definition
	Errors *[]map[string]interface{} `json:"errors,omitempty"`
	// The string that you assigned to describe the Flow
	FriendlyName *string `json:"friendly_name,omitempty"`
	// Nested resource URLs
	Links *map[string]interface{} `json:"links,omitempty"`
	// The latest revision number of the Flow's definition
	Revision *int `json:"revision,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the Flow
	Status *string `json:"status,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
	// Boolean if the flow definition is valid
	Valid *bool `json:"valid,omitempty"`
	// List of warnings in the flow definition
	Warnings   *[]map[string]interface{} `json:"warnings,omitempty"`
	WebhookUrl *string                   `json:"webhook_url,omitempty"`
}

StudioV2Flow struct for StudioV2Flow

type StudioV2FlowExecution

type StudioV2FlowExecution struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The phone number, SIP address or Client identifier that triggered the Execution
	ContactChannelAddress *string `json:"contact_channel_address,omitempty"`
	// The current state of the flow
	Context *map[string]interface{} `json:"context,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The SID of the Flow
	FlowSid *string `json:"flow_sid,omitempty"`
	// Nested resource URLs
	Links *map[string]interface{} `json:"links,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the Execution
	Status *string `json:"status,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

StudioV2FlowExecution struct for StudioV2FlowExecution

type StudioV2FlowExecutionExecutionContext

type StudioV2FlowExecutionExecutionContext struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The current state of the flow
	Context *map[string]interface{} `json:"context,omitempty"`
	// The SID of the Execution
	ExecutionSid *string `json:"execution_sid,omitempty"`
	// The SID of the Flow
	FlowSid *string `json:"flow_sid,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

StudioV2FlowExecutionExecutionContext struct for StudioV2FlowExecutionExecutionContext

type StudioV2FlowExecutionExecutionStep

type StudioV2FlowExecutionExecutionStep struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The current state of the flow
	Context *map[string]interface{} `json:"context,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The SID of the Execution
	ExecutionSid *string `json:"execution_sid,omitempty"`
	// The SID of the Flow
	FlowSid *string `json:"flow_sid,omitempty"`
	// The URLs of related resources
	Links *map[string]interface{} `json:"links,omitempty"`
	// The event that caused the Flow to transition to the Step
	Name *string `json:"name,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The Widget that preceded the Widget for the Step
	TransitionedFrom *string `json:"transitioned_from,omitempty"`
	// The Widget that will follow the Widget for the Step
	TransitionedTo *string `json:"transitioned_to,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

StudioV2FlowExecutionExecutionStep struct for StudioV2FlowExecutionExecutionStep

type StudioV2FlowExecutionExecutionStepExecutionStepContext

type StudioV2FlowExecutionExecutionStepExecutionStepContext struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The current state of the flow
	Context *map[string]interface{} `json:"context,omitempty"`
	// The SID of the Execution
	ExecutionSid *string `json:"execution_sid,omitempty"`
	// The SID of the Flow
	FlowSid *string `json:"flow_sid,omitempty"`
	// Step SID
	StepSid *string `json:"step_sid,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

StudioV2FlowExecutionExecutionStepExecutionStepContext struct for StudioV2FlowExecutionExecutionStepExecutionStepContext

type StudioV2FlowFlowRevision

type StudioV2FlowFlowRevision struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// Description of change made in the revision
	CommitMessage *string `json:"commit_message,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// JSON representation of flow definition
	Definition *map[string]interface{} `json:"definition,omitempty"`
	// List of error in the flow definition
	Errors *[]map[string]interface{} `json:"errors,omitempty"`
	// The string that you assigned to describe the Flow
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The latest revision number of the Flow's definition
	Revision *int `json:"revision,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the Flow
	Status *string `json:"status,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
	// Boolean if the flow definition is valid
	Valid *bool `json:"valid,omitempty"`
}

StudioV2FlowFlowRevision struct for StudioV2FlowFlowRevision

type StudioV2FlowTestUser

type StudioV2FlowTestUser struct {
	// Unique identifier of the flow.
	Sid *string `json:"sid,omitempty"`
	// List of test user identities that can test draft versions of the flow.
	TestUsers *[]string `json:"test_users,omitempty"`
	// The URL of this resource.
	Url *string `json:"url,omitempty"`
}

StudioV2FlowTestUser struct for StudioV2FlowTestUser

type StudioV2FlowValidate

type StudioV2FlowValidate struct {
	// Boolean if the flow definition is valid
	Valid *bool `json:"valid,omitempty"`
}

StudioV2FlowValidate struct for StudioV2FlowValidate

type UpdateExecutionParams

type UpdateExecutionParams struct {
	// The status of the Execution. Can only be `ended`.
	Status *string `json:"Status,omitempty"`
}

Optional parameters for the method 'UpdateExecution'

func (*UpdateExecutionParams) SetStatus

func (params *UpdateExecutionParams) SetStatus(Status string) *UpdateExecutionParams

type UpdateFlowParams

type UpdateFlowParams struct {
	// Description of change made in the revision.
	CommitMessage *string `json:"CommitMessage,omitempty"`
	// JSON representation of flow definition.
	Definition *map[string]interface{} `json:"Definition,omitempty"`
	// The string that you assigned to describe the Flow.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The status of the Flow. Can be: `draft` or `published`.
	Status *string `json:"Status,omitempty"`
}

Optional parameters for the method 'UpdateFlow'

func (*UpdateFlowParams) SetCommitMessage

func (params *UpdateFlowParams) SetCommitMessage(CommitMessage string) *UpdateFlowParams

func (*UpdateFlowParams) SetDefinition

func (params *UpdateFlowParams) SetDefinition(Definition map[string]interface{}) *UpdateFlowParams

func (*UpdateFlowParams) SetFriendlyName

func (params *UpdateFlowParams) SetFriendlyName(FriendlyName string) *UpdateFlowParams

func (*UpdateFlowParams) SetStatus

func (params *UpdateFlowParams) SetStatus(Status string) *UpdateFlowParams

type UpdateFlowValidateParams

type UpdateFlowValidateParams struct {
	// Description of change made in the revision.
	CommitMessage *string `json:"CommitMessage,omitempty"`
	// JSON representation of flow definition.
	Definition *map[string]interface{} `json:"Definition,omitempty"`
	// The string that you assigned to describe the Flow.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The status of the Flow. Can be: `draft` or `published`.
	Status *string `json:"Status,omitempty"`
}

Optional parameters for the method 'UpdateFlowValidate'

func (*UpdateFlowValidateParams) SetCommitMessage

func (params *UpdateFlowValidateParams) SetCommitMessage(CommitMessage string) *UpdateFlowValidateParams

func (*UpdateFlowValidateParams) SetDefinition

func (params *UpdateFlowValidateParams) SetDefinition(Definition map[string]interface{}) *UpdateFlowValidateParams

func (*UpdateFlowValidateParams) SetFriendlyName

func (params *UpdateFlowValidateParams) SetFriendlyName(FriendlyName string) *UpdateFlowValidateParams

func (*UpdateFlowValidateParams) SetStatus

func (params *UpdateFlowValidateParams) SetStatus(Status string) *UpdateFlowValidateParams

type UpdateTestUserParams

type UpdateTestUserParams struct {
	// List of test user identities that can test draft versions of the flow.
	TestUsers *[]string `json:"TestUsers,omitempty"`
}

Optional parameters for the method 'UpdateTestUser'

func (*UpdateTestUserParams) SetTestUsers

func (params *UpdateTestUserParams) SetTestUsers(TestUsers []string) *UpdateTestUserParams

Jump to

Keyboard shortcuts

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