openapi

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 6 Imported by: 0

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.23.2
  • 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://media.twilio.com

Class Method HTTP request Description
MediaProcessorsApi CreateMediaProcessor Post /v1/MediaProcessors
MediaProcessorsApi FetchMediaProcessor Get /v1/MediaProcessors/{Sid}
MediaProcessorsApi ListMediaProcessor Get /v1/MediaProcessors
MediaProcessorsApi UpdateMediaProcessor Post /v1/MediaProcessors/{Sid}
PlayerStreamersApi CreatePlayerStreamer Post /v1/PlayerStreamers
PlayerStreamersApi FetchPlayerStreamer Get /v1/PlayerStreamers/{Sid}
PlayerStreamersApi ListPlayerStreamer Get /v1/PlayerStreamers
PlayerStreamersApi UpdatePlayerStreamer Post /v1/PlayerStreamers/{Sid}
PlayerStreamersPlaybackGrantApi CreatePlayerStreamerPlaybackGrant Post /v1/PlayerStreamers/{Sid}/PlaybackGrant
PlayerStreamersPlaybackGrantApi FetchPlayerStreamerPlaybackGrant Get /v1/PlayerStreamers/{Sid}/PlaybackGrant

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

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

func NewApiService

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) CreateMediaProcessor

func (c *ApiService) CreateMediaProcessor(params *CreateMediaProcessorParams) (*MediaV1MediaProcessor, error)

func (*ApiService) CreatePlayerStreamer

func (c *ApiService) CreatePlayerStreamer(params *CreatePlayerStreamerParams) (*MediaV1PlayerStreamer, error)

func (*ApiService) CreatePlayerStreamerPlaybackGrant

func (c *ApiService) CreatePlayerStreamerPlaybackGrant(Sid string, params *CreatePlayerStreamerPlaybackGrantParams) (*MediaV1PlayerStreamerPlaybackGrant, error)

func (*ApiService) FetchMediaProcessor

func (c *ApiService) FetchMediaProcessor(Sid string) (*MediaV1MediaProcessor, error)

Returns a single MediaProcessor resource identified by a SID.

func (*ApiService) FetchPlayerStreamer

func (c *ApiService) FetchPlayerStreamer(Sid string) (*MediaV1PlayerStreamer, error)

Returns a single PlayerStreamer resource identified by a SID.

func (*ApiService) FetchPlayerStreamerPlaybackGrant

func (c *ApiService) FetchPlayerStreamerPlaybackGrant(Sid string) (*MediaV1PlayerStreamerPlaybackGrant, error)

**This method is not enabled.** Returns a single PlaybackGrant resource identified by a SID.

func (*ApiService) ListMediaProcessor

func (c *ApiService) ListMediaProcessor(params *ListMediaProcessorParams) ([]MediaV1MediaProcessor, error)

Lists MediaProcessor records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) ListPlayerStreamer

func (c *ApiService) ListPlayerStreamer(params *ListPlayerStreamerParams) ([]MediaV1PlayerStreamer, error)

Lists PlayerStreamer records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) PageMediaProcessor

func (c *ApiService) PageMediaProcessor(params *ListMediaProcessorParams, pageToken, pageNumber string) (*ListMediaProcessorResponse, error)

Retrieve a single page of MediaProcessor records from the API. Request is executed immediately.

func (*ApiService) PagePlayerStreamer

func (c *ApiService) PagePlayerStreamer(params *ListPlayerStreamerParams, pageToken, pageNumber string) (*ListPlayerStreamerResponse, error)

Retrieve a single page of PlayerStreamer records from the API. Request is executed immediately.

func (*ApiService) StreamMediaProcessor

func (c *ApiService) StreamMediaProcessor(params *ListMediaProcessorParams) (chan MediaV1MediaProcessor, error)

Streams MediaProcessor records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) StreamPlayerStreamer

func (c *ApiService) StreamPlayerStreamer(params *ListPlayerStreamerParams) (chan MediaV1PlayerStreamer, error)

Streams PlayerStreamer records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) UpdateMediaProcessor

func (c *ApiService) UpdateMediaProcessor(Sid string, params *UpdateMediaProcessorParams) (*MediaV1MediaProcessor, error)

Updates a MediaProcessor resource identified by a SID.

func (*ApiService) UpdatePlayerStreamer

func (c *ApiService) UpdatePlayerStreamer(Sid string, params *UpdatePlayerStreamerParams) (*MediaV1PlayerStreamer, error)

Updates a PlayerStreamer resource identified by a SID.

type CreateMediaProcessorParams

type CreateMediaProcessorParams struct {
	// The [Media Extension](/docs/live/api/media-extensions-overview) name or URL. Ex: `video-composer-v1`
	Extension *string `json:"Extension,omitempty"`
	// The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/api/media-extensions-overview) you are using for more information about the context to send.
	ExtensionContext *string `json:"ExtensionContext,omitempty"`
	// User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/api/media-extensions-overview) you are using for more information about whether you need to provide this.
	ExtensionEnvironment *map[string]interface{} `json:"ExtensionEnvironment,omitempty"`
	// The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/status-callbacks) for details.
	StatusCallback *string `json:"StatusCallback,omitempty"`
	// The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
	StatusCallbackMethod *string `json:"StatusCallbackMethod,omitempty"`
}

Optional parameters for the method 'CreateMediaProcessor'

func (*CreateMediaProcessorParams) SetExtension

func (params *CreateMediaProcessorParams) SetExtension(Extension string) *CreateMediaProcessorParams

func (*CreateMediaProcessorParams) SetExtensionContext

func (params *CreateMediaProcessorParams) SetExtensionContext(ExtensionContext string) *CreateMediaProcessorParams

func (*CreateMediaProcessorParams) SetExtensionEnvironment

func (params *CreateMediaProcessorParams) SetExtensionEnvironment(ExtensionEnvironment map[string]interface{}) *CreateMediaProcessorParams

func (*CreateMediaProcessorParams) SetStatusCallback

func (params *CreateMediaProcessorParams) SetStatusCallback(StatusCallback string) *CreateMediaProcessorParams

func (*CreateMediaProcessorParams) SetStatusCallbackMethod

func (params *CreateMediaProcessorParams) SetStatusCallbackMethod(StatusCallbackMethod string) *CreateMediaProcessorParams

type CreatePlayerStreamerParams

type CreatePlayerStreamerParams struct {
	// The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/status-callbacks) for more details.
	StatusCallback *string `json:"StatusCallback,omitempty"`
	// The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
	StatusCallbackMethod *string `json:"StatusCallbackMethod,omitempty"`
	// Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`.
	Video *bool `json:"Video,omitempty"`
}

Optional parameters for the method 'CreatePlayerStreamer'

func (*CreatePlayerStreamerParams) SetStatusCallback

func (params *CreatePlayerStreamerParams) SetStatusCallback(StatusCallback string) *CreatePlayerStreamerParams

func (*CreatePlayerStreamerParams) SetStatusCallbackMethod

func (params *CreatePlayerStreamerParams) SetStatusCallbackMethod(StatusCallbackMethod string) *CreatePlayerStreamerParams

func (*CreatePlayerStreamerParams) SetVideo

type CreatePlayerStreamerPlaybackGrantParams

type CreatePlayerStreamerPlaybackGrantParams struct {
	// The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain.
	AccessControlAllowOrigin *string `json:"AccessControlAllowOrigin,omitempty"`
	// The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds.
	Ttl *int `json:"Ttl,omitempty"`
}

Optional parameters for the method 'CreatePlayerStreamerPlaybackGrant'

func (*CreatePlayerStreamerPlaybackGrantParams) SetAccessControlAllowOrigin

func (params *CreatePlayerStreamerPlaybackGrantParams) SetAccessControlAllowOrigin(AccessControlAllowOrigin string) *CreatePlayerStreamerPlaybackGrantParams

func (*CreatePlayerStreamerPlaybackGrantParams) SetTtl

type ListMediaProcessorParams

type ListMediaProcessorParams struct {
	// The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
	Order *string `json:"Order,omitempty"`
	// Status to filter by, with possible values `started`, `ended` or `failed`.
	Status *string `json:"Status,omitempty"`
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListMediaProcessor'

func (*ListMediaProcessorParams) SetLimit

func (params *ListMediaProcessorParams) SetLimit(Limit int) *ListMediaProcessorParams

func (*ListMediaProcessorParams) SetOrder

func (params *ListMediaProcessorParams) SetOrder(Order string) *ListMediaProcessorParams

func (*ListMediaProcessorParams) SetPageSize

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

func (*ListMediaProcessorParams) SetStatus

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

type ListMediaProcessorResponse

type ListMediaProcessorResponse struct {
	MediaProcessors []MediaV1MediaProcessor        `json:"media_processors,omitempty"`
	Meta            ListMediaProcessorResponseMeta `json:"meta,omitempty"`
}

ListMediaProcessorResponse struct for ListMediaProcessorResponse

type ListMediaProcessorResponseMeta

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

ListMediaProcessorResponseMeta struct for ListMediaProcessorResponseMeta

type ListPlayerStreamerParams

type ListPlayerStreamerParams struct {
	// The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
	Order *string `json:"Order,omitempty"`
	// Status to filter by, with possible values `created`, `started`, `ended`, or `failed`.
	Status *string `json:"Status,omitempty"`
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListPlayerStreamer'

func (*ListPlayerStreamerParams) SetLimit

func (params *ListPlayerStreamerParams) SetLimit(Limit int) *ListPlayerStreamerParams

func (*ListPlayerStreamerParams) SetOrder

func (params *ListPlayerStreamerParams) SetOrder(Order string) *ListPlayerStreamerParams

func (*ListPlayerStreamerParams) SetPageSize

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

func (*ListPlayerStreamerParams) SetStatus

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

type ListPlayerStreamerResponse

type ListPlayerStreamerResponse struct {
	Meta            ListMediaProcessorResponseMeta `json:"meta,omitempty"`
	PlayerStreamers []MediaV1PlayerStreamer        `json:"player_streamers,omitempty"`
}

ListPlayerStreamerResponse struct for ListPlayerStreamerResponse

type MediaV1MediaProcessor

type MediaV1MediaProcessor struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,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 reason why a MediaProcessor ended
	EndedReason *string `json:"ended_reason,omitempty"`
	// The Media Extension name or URL
	Extension *string `json:"extension,omitempty"`
	// The Media Extension context
	ExtensionContext *string `json:"extension_context,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the MediaProcessor
	Status *string `json:"status,omitempty"`
	// The URL to which Twilio will send MediaProcessor event updates
	StatusCallback *string `json:"status_callback,omitempty"`
	// The HTTP method Twilio should use to call the `status_callback` URL
	StatusCallbackMethod *string `json:"status_callback_method,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

MediaV1MediaProcessor struct for MediaV1MediaProcessor

type MediaV1PlayerStreamer

type MediaV1PlayerStreamer struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,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 reason why a PlayerStreamer ended
	EndedReason *string `json:"ended_reason,omitempty"`
	// The URLs of related resources
	Links *map[string]interface{} `json:"links,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the PlayerStreamer
	Status *string `json:"status,omitempty"`
	// The URL to which Twilio will send PlayerStreamer event updates
	StatusCallback *string `json:"status_callback,omitempty"`
	// The HTTP method Twilio should use to call the `status_callback` URL
	StatusCallbackMethod *string `json:"status_callback_method,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
	// Whether the PlayerStreamer is configured to stream video
	Video *bool `json:"video,omitempty"`
}

MediaV1PlayerStreamer struct for MediaV1PlayerStreamer

type MediaV1PlayerStreamerPlaybackGrant

type MediaV1PlayerStreamerPlaybackGrant struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The grant that authorizes the player sdk to connect to the livestream
	Grant *map[string]interface{} `json:"grant,omitempty"`
	// The unique string that identifies the PlayerStreamer associated with this PlaybackGrant.
	Sid *string `json:"sid,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

MediaV1PlayerStreamerPlaybackGrant struct for MediaV1PlayerStreamerPlaybackGrant

type UpdateMediaProcessorParams

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

Optional parameters for the method 'UpdateMediaProcessor'

func (*UpdateMediaProcessorParams) SetStatus

type UpdatePlayerStreamerParams

type UpdatePlayerStreamerParams struct {
	// The status the PlayerStreamer should be transitioned to. Can be: `ended`.
	Status *string `json:"Status,omitempty"`
}

Optional parameters for the method 'UpdatePlayerStreamer'

func (*UpdatePlayerStreamerParams) SetStatus

Jump to

Keyboard shortcuts

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