diff --git a/CHANGES.md b/CHANGES.md index c45211cb7..7a7392f65 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,58 @@ twilio-go changelog ==================== +[2024-04-01] Version 1.19.1 +--------------------------- +**Library - Chore** +- [PR #238](https://github.com/twilio/twilio-go/pull/238): Merge '2.0.0-rc' to 'main'. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #241](https://github.com/twilio/twilio-go/pull/241): Revert "feat!: Merge '2.0.0-rc' to main". Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Api** +- Add property `queue_time` to conference participant resource +- Update RiskCheck documentation +- Correct call filtering by start and end time documentation, clarifying that times are UTC. +- Correct precedence documentation for application_sid vs status_callback in message creation +- Mark MaxPrice as deprecated + +**Flex** +- Adding optional parameter to `plugins` +- Making `plugins` visibility to public + +**Media** +- Remove API: MediaProcessor + +**Messaging** +- Remove Sending-Window due to test failure +- Add Sending-Window as a response property to Messaging Services, gated by a beta feature flag +- Add new `errors` attribute to the Brand Registration resource. +- Mark `brand_feedback` attribute as deprecated. +- Mark `failure_reason` attribute as deprecated. +- The new `errors` attribute is expected to provide additional information about Brand registration failures and feedback (if any has been provided by The Campaign Registry). Consumers should use this attribute instead of `brand_feedback` and `failure_reason`. + +**Numbers** +- Correct valid_until_date field to be visible in Bundles resource +- Adding port_in_status field to the Port In resource and phone_number_status and sid fields to the Port In Phone Number resource +- Correcting mount_name for porting port in fetch API + +**Oauth** +- Modified token endpoint response +- Added refresh_token and scope as optional parameter to token endpoint +- Add new APIs for vendor authorize and token endpoints + +**Trusthub** +- Add update inquiry endpoint in compliance_registration. +- Add new field in themeSetId in compliance_registration. +- Add new field in statusCallbackUrl in compliance_registration. +- Add new field in isvRegisteringForSelfOrTenant in compliance_registration. + +**Voice** +- Correct call filtering by start and end time documentation, clarifying that times are UTC. + +**Twiml** +- Add support for new Google voices (Q1 2024) for `Say` verb - gu-IN voices +- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb - Niamh (en-IE) and Sofie (da-DK) voices +- Expanded description of Action parameter for Message verb + + [2024-02-27] Version 1.19.0 --------------------------- **Library - Chore** diff --git a/client/version.go b/client/version.go index 8a144bdb4..07dc4cf4f 100644 --- a/client/version.go +++ b/client/version.go @@ -2,4 +2,4 @@ package client // LibraryVersion specifies the current version of twilio-go. -const LibraryVersion = "1.19.0" +const LibraryVersion = "1.19.1" diff --git a/rest/media/v1/README.md b/rest/media/v1/README.md deleted file mode 100644 index 6c73a7819..000000000 --- a/rest/media/v1/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Go API client for openapi - -This is the public Twilio REST API. - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/twilio-oai](https://github.com/twilio/twilio-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: com.twilio.oai.TwilioGoGenerator -For more information, please visit [https://support.twilio.com](https://support.twilio.com) - -## Installation - -Install the following dependencies: - -```shell -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: - -```golang -import "./openapi" -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://media.twilio.com* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*MediaProcessorsApi* | [**CreateMediaProcessor**](docs/MediaProcessorsApi.md#createmediaprocessor) | **Post** /v1/MediaProcessors | -*MediaProcessorsApi* | [**FetchMediaProcessor**](docs/MediaProcessorsApi.md#fetchmediaprocessor) | **Get** /v1/MediaProcessors/{Sid} | -*MediaProcessorsApi* | [**ListMediaProcessor**](docs/MediaProcessorsApi.md#listmediaprocessor) | **Get** /v1/MediaProcessors | -*MediaProcessorsApi* | [**UpdateMediaProcessor**](docs/MediaProcessorsApi.md#updatemediaprocessor) | **Post** /v1/MediaProcessors/{Sid} | -*MediaRecordingsApi* | [**DeleteMediaRecording**](docs/MediaRecordingsApi.md#deletemediarecording) | **Delete** /v1/MediaRecordings/{Sid} | -*MediaRecordingsApi* | [**FetchMediaRecording**](docs/MediaRecordingsApi.md#fetchmediarecording) | **Get** /v1/MediaRecordings/{Sid} | -*MediaRecordingsApi* | [**ListMediaRecording**](docs/MediaRecordingsApi.md#listmediarecording) | **Get** /v1/MediaRecordings | -*PlayerStreamersApi* | [**CreatePlayerStreamer**](docs/PlayerStreamersApi.md#createplayerstreamer) | **Post** /v1/PlayerStreamers | -*PlayerStreamersApi* | [**FetchPlayerStreamer**](docs/PlayerStreamersApi.md#fetchplayerstreamer) | **Get** /v1/PlayerStreamers/{Sid} | -*PlayerStreamersApi* | [**ListPlayerStreamer**](docs/PlayerStreamersApi.md#listplayerstreamer) | **Get** /v1/PlayerStreamers | -*PlayerStreamersApi* | [**UpdatePlayerStreamer**](docs/PlayerStreamersApi.md#updateplayerstreamer) | **Post** /v1/PlayerStreamers/{Sid} | -*PlayerStreamersPlaybackGrantApi* | [**CreatePlayerStreamerPlaybackGrant**](docs/PlayerStreamersPlaybackGrantApi.md#createplayerstreamerplaybackgrant) | **Post** /v1/PlayerStreamers/{Sid}/PlaybackGrant | -*PlayerStreamersPlaybackGrantApi* | [**FetchPlayerStreamerPlaybackGrant**](docs/PlayerStreamersPlaybackGrantApi.md#fetchplayerstreamerplaybackgrant) | **Get** /v1/PlayerStreamers/{Sid}/PlaybackGrant | - - -## Documentation For Models - - - [MediaV1MediaProcessor](docs/MediaV1MediaProcessor.md) - - [ListMediaProcessorResponseMeta](docs/ListMediaProcessorResponseMeta.md) - - [MediaV1MediaRecording](docs/MediaV1MediaRecording.md) - - [MediaV1PlayerStreamerPlaybackGrant](docs/MediaV1PlayerStreamerPlaybackGrant.md) - - [ListPlayerStreamerResponse](docs/ListPlayerStreamerResponse.md) - - [ListMediaRecordingResponse](docs/ListMediaRecordingResponse.md) - - [ListMediaProcessorResponse](docs/ListMediaProcessorResponse.md) - - [MediaV1PlayerStreamer](docs/MediaV1PlayerStreamer.md) - - -## Documentation For Authorization - - - -## accountSid_authToken - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - diff --git a/rest/media/v1/api_service.go b/rest/media/v1/api_service.go deleted file mode 100644 index 59274da84..000000000 --- a/rest/media/v1/api_service.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - twilio "github.com/twilio/twilio-go/client" -) - -type ApiService struct { - baseURL string - requestHandler *twilio.RequestHandler -} - -func NewApiService(requestHandler *twilio.RequestHandler) *ApiService { - return &ApiService{ - requestHandler: requestHandler, - baseURL: "https://media.twilio.com", - } -} - -func NewApiServiceWithClient(client twilio.BaseClient) *ApiService { - return NewApiService(twilio.NewRequestHandler(client)) -} diff --git a/rest/media/v1/docs/ListMediaProcessorResponse.md b/rest/media/v1/docs/ListMediaProcessorResponse.md deleted file mode 100644 index a620c11db..000000000 --- a/rest/media/v1/docs/ListMediaProcessorResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListMediaProcessorResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MediaProcessors** | [**[]MediaV1MediaProcessor**](MediaV1MediaProcessor.md) | |[optional] -**Meta** | [**ListMediaProcessorResponseMeta**](ListMediaProcessorResponseMeta.md) | |[optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/ListMediaProcessorResponseMeta.md b/rest/media/v1/docs/ListMediaProcessorResponseMeta.md deleted file mode 100644 index 85fb22ec7..000000000 --- a/rest/media/v1/docs/ListMediaProcessorResponseMeta.md +++ /dev/null @@ -1,17 +0,0 @@ -# ListMediaProcessorResponseMeta - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**FirstPageUrl** | **string** | |[optional] -**Key** | **string** | |[optional] -**NextPageUrl** | Pointer to **string** | | -**Page** | **int** | |[optional] -**PageSize** | **int** | |[optional] -**PreviousPageUrl** | Pointer to **string** | | -**Url** | **string** | |[optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/ListMediaRecordingResponse.md b/rest/media/v1/docs/ListMediaRecordingResponse.md deleted file mode 100644 index 3205bd9d0..000000000 --- a/rest/media/v1/docs/ListMediaRecordingResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListMediaRecordingResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MediaRecordings** | [**[]MediaV1MediaRecording**](MediaV1MediaRecording.md) | |[optional] -**Meta** | [**ListMediaProcessorResponseMeta**](ListMediaProcessorResponseMeta.md) | |[optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/ListPlayerStreamerResponse.md b/rest/media/v1/docs/ListPlayerStreamerResponse.md deleted file mode 100644 index cf938d2ee..000000000 --- a/rest/media/v1/docs/ListPlayerStreamerResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListPlayerStreamerResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**PlayerStreamers** | [**[]MediaV1PlayerStreamer**](MediaV1PlayerStreamer.md) | |[optional] -**Meta** | [**ListMediaProcessorResponseMeta**](ListMediaProcessorResponseMeta.md) | |[optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/MediaProcessorsApi.md b/rest/media/v1/docs/MediaProcessorsApi.md deleted file mode 100644 index ea9177007..000000000 --- a/rest/media/v1/docs/MediaProcessorsApi.md +++ /dev/null @@ -1,183 +0,0 @@ -# MediaProcessorsApi - -All URIs are relative to *https://media.twilio.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateMediaProcessor**](MediaProcessorsApi.md#CreateMediaProcessor) | **Post** /v1/MediaProcessors | -[**FetchMediaProcessor**](MediaProcessorsApi.md#FetchMediaProcessor) | **Get** /v1/MediaProcessors/{Sid} | -[**ListMediaProcessor**](MediaProcessorsApi.md#ListMediaProcessor) | **Get** /v1/MediaProcessors | -[**UpdateMediaProcessor**](MediaProcessorsApi.md#UpdateMediaProcessor) | **Post** /v1/MediaProcessors/{Sid} | - - - -## CreateMediaProcessor - -> MediaV1MediaProcessor CreateMediaProcessor(ctx, optional) - - - - - -### Path Parameters - -This endpoint does not need any path parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a CreateMediaProcessorParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Extension** | **string** | The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` -**ExtensionContext** | **string** | The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. -**ExtensionEnvironment** | [**interface{}**](interface{}.md) | 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/media-extensions-overview) you are using for more information about whether you need to provide this. -**StatusCallback** | **string** | The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. -**StatusCallbackMethod** | **string** | The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. -**MaxDuration** | **int** | The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. - -### Return type - -[**MediaV1MediaProcessor**](MediaV1MediaProcessor.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FetchMediaProcessor - -> MediaV1MediaProcessor FetchMediaProcessor(ctx, Sid) - - - -Returns a single MediaProcessor resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the MediaProcessor resource to fetch. - -### Other Parameters - -Other parameters are passed through a pointer to a FetchMediaProcessorParams struct - - -Name | Type | Description -------------- | ------------- | ------------- - -### Return type - -[**MediaV1MediaProcessor**](MediaV1MediaProcessor.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ListMediaProcessor - -> []MediaV1MediaProcessor ListMediaProcessor(ctx, optional) - - - -Returns a list of MediaProcessors. - -### Path Parameters - -This endpoint does not need any path parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a ListMediaProcessorParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Order** | **string** | The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. -**Status** | **string** | Status to filter by, with possible values `started`, `ended` or `failed`. -**PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. -**Limit** | **int** | Max number of records to return. - -### Return type - -[**[]MediaV1MediaProcessor**](MediaV1MediaProcessor.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdateMediaProcessor - -> MediaV1MediaProcessor UpdateMediaProcessor(ctx, Sidoptional) - - - -Updates a MediaProcessor resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the MediaProcessor resource to update. - -### Other Parameters - -Other parameters are passed through a pointer to a UpdateMediaProcessorParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Status** | **string** | - -### Return type - -[**MediaV1MediaProcessor**](MediaV1MediaProcessor.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/rest/media/v1/docs/MediaRecordingsApi.md b/rest/media/v1/docs/MediaRecordingsApi.md deleted file mode 100644 index d83cbbb7d..000000000 --- a/rest/media/v1/docs/MediaRecordingsApi.md +++ /dev/null @@ -1,139 +0,0 @@ -# MediaRecordingsApi - -All URIs are relative to *https://media.twilio.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteMediaRecording**](MediaRecordingsApi.md#DeleteMediaRecording) | **Delete** /v1/MediaRecordings/{Sid} | -[**FetchMediaRecording**](MediaRecordingsApi.md#FetchMediaRecording) | **Get** /v1/MediaRecordings/{Sid} | -[**ListMediaRecording**](MediaRecordingsApi.md#ListMediaRecording) | **Get** /v1/MediaRecordings | - - - -## DeleteMediaRecording - -> DeleteMediaRecording(ctx, Sid) - - - -Deletes a MediaRecording resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the MediaRecording resource to delete. - -### Other Parameters - -Other parameters are passed through a pointer to a DeleteMediaRecordingParams struct - - -Name | Type | Description -------------- | ------------- | ------------- - -### Return type - - (empty response body) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FetchMediaRecording - -> MediaV1MediaRecording FetchMediaRecording(ctx, Sid) - - - -Returns a single MediaRecording resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the MediaRecording resource to fetch. - -### Other Parameters - -Other parameters are passed through a pointer to a FetchMediaRecordingParams struct - - -Name | Type | Description -------------- | ------------- | ------------- - -### Return type - -[**MediaV1MediaRecording**](MediaV1MediaRecording.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ListMediaRecording - -> []MediaV1MediaRecording ListMediaRecording(ctx, optional) - - - -Returns a list of MediaRecordings. - -### Path Parameters - -This endpoint does not need any path parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a ListMediaRecordingParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Order** | **string** | The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. -**Status** | **string** | Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. -**ProcessorSid** | **string** | SID of a MediaProcessor to filter by. -**SourceSid** | **string** | SID of a MediaRecording source to filter by. -**PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. -**Limit** | **int** | Max number of records to return. - -### Return type - -[**[]MediaV1MediaRecording**](MediaV1MediaRecording.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/rest/media/v1/docs/MediaV1MediaProcessor.md b/rest/media/v1/docs/MediaV1MediaProcessor.md deleted file mode 100644 index d34e962c6..000000000 --- a/rest/media/v1/docs/MediaV1MediaProcessor.md +++ /dev/null @@ -1,22 +0,0 @@ -# MediaV1MediaProcessor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccountSid** | Pointer to **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaProcessor resource. | -**Sid** | Pointer to **string** | The unique string generated to identify the MediaProcessor resource. | -**DateCreated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**DateUpdated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**Extension** | Pointer to **string** | The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` | -**ExtensionContext** | Pointer to **string** | The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. | -**Status** | Pointer to [**string**](MediaProcessorEnumStatus.md) | | -**Url** | Pointer to **string** | The absolute URL of the resource. | -**EndedReason** | Pointer to **string** | The reason why a MediaProcessor ended. When a MediaProcessor is in progress, will be `null`. When a MediaProcessor is completed, can be `ended-via-api`, `max-duration-exceeded`, `error-loading-extension`, `error-streaming-media` or `internal-service-error`. See [ended reasons](/docs/live/api/mediaprocessors#mediaprocessor-ended-reason-values) for more details. | -**StatusCallback** | Pointer to **string** | The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. | -**StatusCallbackMethod** | Pointer to **string** | The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. | -**MaxDuration** | Pointer to **int** | The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/MediaV1MediaRecording.md b/rest/media/v1/docs/MediaV1MediaRecording.md deleted file mode 100644 index 92317714a..000000000 --- a/rest/media/v1/docs/MediaV1MediaRecording.md +++ /dev/null @@ -1,25 +0,0 @@ -# MediaV1MediaRecording - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccountSid** | Pointer to **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaRecording resource. | -**DateCreated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**DateUpdated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**Duration** | Pointer to **int** | The duration of the MediaRecording in seconds. | -**Format** | Pointer to [**string**](MediaRecordingEnumFormat.md) | | -**Links** | Pointer to **map[string]interface{}** | The URLs of related resources. | -**ProcessorSid** | Pointer to **string** | The SID of the MediaProcessor resource which produced the MediaRecording. | -**Resolution** | Pointer to **string** | The dimensions of the video image in pixels expressed as columns (width) and rows (height). | -**SourceSid** | Pointer to **string** | The SID of the resource that generated the original media track(s) of the MediaRecording. | -**Sid** | Pointer to **string** | The unique string generated to identify the MediaRecording resource. | -**MediaSize** | Pointer to **int64** | The size of the recording media in bytes. | -**Status** | Pointer to [**string**](MediaRecordingEnumStatus.md) | | -**StatusCallback** | Pointer to **string** | The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. | -**StatusCallbackMethod** | Pointer to **string** | The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. | -**Url** | Pointer to **string** | The absolute URL of the resource. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/MediaV1PlayerStreamer.md b/rest/media/v1/docs/MediaV1PlayerStreamer.md deleted file mode 100644 index e42bf88bf..000000000 --- a/rest/media/v1/docs/MediaV1PlayerStreamer.md +++ /dev/null @@ -1,22 +0,0 @@ -# MediaV1PlayerStreamer - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccountSid** | Pointer to **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource. | -**DateCreated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**DateUpdated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**Video** | Pointer to **bool** | Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. | -**Links** | Pointer to **map[string]interface{}** | The URLs of related resources. | -**Sid** | Pointer to **string** | The unique string generated to identify the PlayerStreamer resource. | -**Status** | Pointer to [**string**](PlayerStreamerEnumStatus.md) | | -**Url** | Pointer to **string** | The absolute URL of the resource. | -**StatusCallback** | Pointer to **string** | The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. | -**StatusCallbackMethod** | Pointer to **string** | The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. | -**EndedReason** | Pointer to [**string**](PlayerStreamerEnumEndedReason.md) | | -**MaxDuration** | Pointer to **int** | The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/MediaV1PlayerStreamerPlaybackGrant.md b/rest/media/v1/docs/MediaV1PlayerStreamerPlaybackGrant.md deleted file mode 100644 index 0acfeb28f..000000000 --- a/rest/media/v1/docs/MediaV1PlayerStreamerPlaybackGrant.md +++ /dev/null @@ -1,15 +0,0 @@ -# MediaV1PlayerStreamerPlaybackGrant - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Sid** | Pointer to **string** | The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for. | -**Url** | Pointer to **string** | The absolute URL of the resource. | -**AccountSid** | Pointer to **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this resource. | -**DateCreated** | Pointer to [**time.Time**](time.Time.md) | The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. | -**Grant** | Pointer to **interface{}** | The grant that authorizes the player sdk to connect to the livestream | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rest/media/v1/docs/PlayerStreamersApi.md b/rest/media/v1/docs/PlayerStreamersApi.md deleted file mode 100644 index fc20e245c..000000000 --- a/rest/media/v1/docs/PlayerStreamersApi.md +++ /dev/null @@ -1,181 +0,0 @@ -# PlayerStreamersApi - -All URIs are relative to *https://media.twilio.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreatePlayerStreamer**](PlayerStreamersApi.md#CreatePlayerStreamer) | **Post** /v1/PlayerStreamers | -[**FetchPlayerStreamer**](PlayerStreamersApi.md#FetchPlayerStreamer) | **Get** /v1/PlayerStreamers/{Sid} | -[**ListPlayerStreamer**](PlayerStreamersApi.md#ListPlayerStreamer) | **Get** /v1/PlayerStreamers | -[**UpdatePlayerStreamer**](PlayerStreamersApi.md#UpdatePlayerStreamer) | **Post** /v1/PlayerStreamers/{Sid} | - - - -## CreatePlayerStreamer - -> MediaV1PlayerStreamer CreatePlayerStreamer(ctx, optional) - - - - - -### Path Parameters - -This endpoint does not need any path parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a CreatePlayerStreamerParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Video** | **bool** | Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. -**StatusCallback** | **string** | The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. -**StatusCallbackMethod** | **string** | The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. -**MaxDuration** | **int** | The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. - -### Return type - -[**MediaV1PlayerStreamer**](MediaV1PlayerStreamer.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FetchPlayerStreamer - -> MediaV1PlayerStreamer FetchPlayerStreamer(ctx, Sid) - - - -Returns a single PlayerStreamer resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the PlayerStreamer resource to fetch. - -### Other Parameters - -Other parameters are passed through a pointer to a FetchPlayerStreamerParams struct - - -Name | Type | Description -------------- | ------------- | ------------- - -### Return type - -[**MediaV1PlayerStreamer**](MediaV1PlayerStreamer.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ListPlayerStreamer - -> []MediaV1PlayerStreamer ListPlayerStreamer(ctx, optional) - - - -Returns a list of PlayerStreamers. - -### Path Parameters - -This endpoint does not need any path parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a ListPlayerStreamerParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Order** | **string** | The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. -**Status** | **string** | Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. -**PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. -**Limit** | **int** | Max number of records to return. - -### Return type - -[**[]MediaV1PlayerStreamer**](MediaV1PlayerStreamer.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePlayerStreamer - -> MediaV1PlayerStreamer UpdatePlayerStreamer(ctx, Sidoptional) - - - -Updates a PlayerStreamer resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the PlayerStreamer resource to update. - -### Other Parameters - -Other parameters are passed through a pointer to a UpdatePlayerStreamerParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Status** | **string** | - -### Return type - -[**MediaV1PlayerStreamer**](MediaV1PlayerStreamer.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/rest/media/v1/docs/PlayerStreamersPlaybackGrantApi.md b/rest/media/v1/docs/PlayerStreamersPlaybackGrantApi.md deleted file mode 100644 index 14c7cf49c..000000000 --- a/rest/media/v1/docs/PlayerStreamersPlaybackGrantApi.md +++ /dev/null @@ -1,96 +0,0 @@ -# PlayerStreamersPlaybackGrantApi - -All URIs are relative to *https://media.twilio.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreatePlayerStreamerPlaybackGrant**](PlayerStreamersPlaybackGrantApi.md#CreatePlayerStreamerPlaybackGrant) | **Post** /v1/PlayerStreamers/{Sid}/PlaybackGrant | -[**FetchPlayerStreamerPlaybackGrant**](PlayerStreamersPlaybackGrantApi.md#FetchPlayerStreamerPlaybackGrant) | **Get** /v1/PlayerStreamers/{Sid}/PlaybackGrant | - - - -## CreatePlayerStreamerPlaybackGrant - -> MediaV1PlayerStreamerPlaybackGrant CreatePlayerStreamerPlaybackGrant(ctx, Sidoptional) - - - - - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The unique string generated to identify the PlayerStreamer resource associated with this PlaybackGrant - -### Other Parameters - -Other parameters are passed through a pointer to a CreatePlayerStreamerPlaybackGrantParams struct - - -Name | Type | Description -------------- | ------------- | ------------- -**Ttl** | **int** | The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. -**AccessControlAllowOrigin** | **string** | The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. - -### Return type - -[**MediaV1PlayerStreamerPlaybackGrant**](MediaV1PlayerStreamerPlaybackGrant.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FetchPlayerStreamerPlaybackGrant - -> MediaV1PlayerStreamerPlaybackGrant FetchPlayerStreamerPlaybackGrant(ctx, Sid) - - - -**This method is not enabled.** Returns a single PlaybackGrant resource identified by a SID. - -### Path Parameters - - -Name | Type | Description -------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**Sid** | **string** | The SID of the PlayerStreamer resource to fetch. - -### Other Parameters - -Other parameters are passed through a pointer to a FetchPlayerStreamerPlaybackGrantParams struct - - -Name | Type | Description -------------- | ------------- | ------------- - -### Return type - -[**MediaV1PlayerStreamerPlaybackGrant**](MediaV1PlayerStreamerPlaybackGrant.md) - -### Authorization - -[accountSid_authToken](../README.md#accountSid_authToken) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/rest/media/v1/media_processors.go b/rest/media/v1/media_processors.go deleted file mode 100644 index 93916118f..000000000 --- a/rest/media/v1/media_processors.go +++ /dev/null @@ -1,326 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" - - "github.com/twilio/twilio-go/client" -) - -// Optional parameters for the method 'CreateMediaProcessor' -type CreateMediaProcessorParams struct { - // The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` - 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/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/media-extensions-overview) you are using for more information about whether you need to provide this. - ExtensionEnvironment *interface{} `json:"ExtensionEnvironment,omitempty"` - // The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/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"` - // The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. - MaxDuration *int `json:"MaxDuration,omitempty"` -} - -func (params *CreateMediaProcessorParams) SetExtension(Extension string) *CreateMediaProcessorParams { - params.Extension = &Extension - return params -} -func (params *CreateMediaProcessorParams) SetExtensionContext(ExtensionContext string) *CreateMediaProcessorParams { - params.ExtensionContext = &ExtensionContext - return params -} -func (params *CreateMediaProcessorParams) SetExtensionEnvironment(ExtensionEnvironment interface{}) *CreateMediaProcessorParams { - params.ExtensionEnvironment = &ExtensionEnvironment - return params -} -func (params *CreateMediaProcessorParams) SetStatusCallback(StatusCallback string) *CreateMediaProcessorParams { - params.StatusCallback = &StatusCallback - return params -} -func (params *CreateMediaProcessorParams) SetStatusCallbackMethod(StatusCallbackMethod string) *CreateMediaProcessorParams { - params.StatusCallbackMethod = &StatusCallbackMethod - return params -} -func (params *CreateMediaProcessorParams) SetMaxDuration(MaxDuration int) *CreateMediaProcessorParams { - params.MaxDuration = &MaxDuration - return params -} - -func (c *ApiService) CreateMediaProcessor(params *CreateMediaProcessorParams) (*MediaV1MediaProcessor, error) { - path := "/v1/MediaProcessors" - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Extension != nil { - data.Set("Extension", *params.Extension) - } - if params != nil && params.ExtensionContext != nil { - data.Set("ExtensionContext", *params.ExtensionContext) - } - if params != nil && params.ExtensionEnvironment != nil { - v, err := json.Marshal(params.ExtensionEnvironment) - - if err != nil { - return nil, err - } - - data.Set("ExtensionEnvironment", string(v)) - } - if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) - } - if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) - } - if params != nil && params.MaxDuration != nil { - data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) - } - - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &MediaV1MediaProcessor{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Returns a single MediaProcessor resource identified by a SID. -func (c *ApiService) FetchMediaProcessor(Sid string) (*MediaV1MediaProcessor, error) { - path := "/v1/MediaProcessors/{Sid}" - 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 := &MediaV1MediaProcessor{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Optional parameters for the method 'ListMediaProcessor' -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"` -} - -func (params *ListMediaProcessorParams) SetOrder(Order string) *ListMediaProcessorParams { - params.Order = &Order - return params -} -func (params *ListMediaProcessorParams) SetStatus(Status string) *ListMediaProcessorParams { - params.Status = &Status - return params -} -func (params *ListMediaProcessorParams) SetPageSize(PageSize int) *ListMediaProcessorParams { - params.PageSize = &PageSize - return params -} -func (params *ListMediaProcessorParams) SetLimit(Limit int) *ListMediaProcessorParams { - params.Limit = &Limit - return params -} - -// Retrieve a single page of MediaProcessor records from the API. Request is executed immediately. -func (c *ApiService) PageMediaProcessor(params *ListMediaProcessorParams, pageToken, pageNumber string) (*ListMediaProcessorResponse, error) { - path := "/v1/MediaProcessors" - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Order != nil { - data.Set("Order", *params.Order) - } - if params != nil && params.Status != nil { - data.Set("Status", *params.Status) - } - 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 := &ListMediaProcessorResponse{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Lists MediaProcessor records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning. -func (c *ApiService) ListMediaProcessor(params *ListMediaProcessorParams) ([]MediaV1MediaProcessor, error) { - response, errors := c.StreamMediaProcessor(params) - - records := make([]MediaV1MediaProcessor, 0) - for record := range response { - records = append(records, record) - } - - if err := <-errors; err != nil { - return nil, err - } - - return records, nil -} - -// 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 (c *ApiService) StreamMediaProcessor(params *ListMediaProcessorParams) (chan MediaV1MediaProcessor, chan error) { - if params == nil { - params = &ListMediaProcessorParams{} - } - params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit)) - - recordChannel := make(chan MediaV1MediaProcessor, 1) - errorChannel := make(chan error, 1) - - response, err := c.PageMediaProcessor(params, "", "") - if err != nil { - errorChannel <- err - close(recordChannel) - close(errorChannel) - } else { - go c.streamMediaProcessor(response, params, recordChannel, errorChannel) - } - - return recordChannel, errorChannel -} - -func (c *ApiService) streamMediaProcessor(response *ListMediaProcessorResponse, params *ListMediaProcessorParams, recordChannel chan MediaV1MediaProcessor, errorChannel chan error) { - curRecord := 1 - - for response != nil { - responseRecords := response.MediaProcessors - for item := range responseRecords { - recordChannel <- responseRecords[item] - curRecord += 1 - if params.Limit != nil && *params.Limit < curRecord { - close(recordChannel) - close(errorChannel) - return - } - } - - record, err := client.GetNext(c.baseURL, response, c.getNextListMediaProcessorResponse) - if err != nil { - errorChannel <- err - break - } else if record == nil { - break - } - - response = record.(*ListMediaProcessorResponse) - } - - close(recordChannel) - close(errorChannel) -} - -func (c *ApiService) getNextListMediaProcessorResponse(nextPageUrl string) (interface{}, error) { - if nextPageUrl == "" { - return nil, nil - } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &ListMediaProcessorResponse{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - return ps, nil -} - -// Optional parameters for the method 'UpdateMediaProcessor' -type UpdateMediaProcessorParams struct { - // - Status *string `json:"Status,omitempty"` -} - -func (params *UpdateMediaProcessorParams) SetStatus(Status string) *UpdateMediaProcessorParams { - params.Status = &Status - return params -} - -// Updates a MediaProcessor resource identified by a SID. -func (c *ApiService) UpdateMediaProcessor(Sid string, params *UpdateMediaProcessorParams) (*MediaV1MediaProcessor, error) { - path := "/v1/MediaProcessors/{Sid}" - path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Status != nil { - data.Set("Status", *params.Status) - } - - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &MediaV1MediaProcessor{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} diff --git a/rest/media/v1/media_recordings.go b/rest/media/v1/media_recordings.go deleted file mode 100644 index 631f8a8c2..000000000 --- a/rest/media/v1/media_recordings.go +++ /dev/null @@ -1,237 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" - - "github.com/twilio/twilio-go/client" -) - -// Deletes a MediaRecording resource identified by a SID. -func (c *ApiService) DeleteMediaRecording(Sid string) error { - path := "/v1/MediaRecordings/{Sid}" - 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 -} - -// Returns a single MediaRecording resource identified by a SID. -func (c *ApiService) FetchMediaRecording(Sid string) (*MediaV1MediaRecording, error) { - path := "/v1/MediaRecordings/{Sid}" - 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 := &MediaV1MediaRecording{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Optional parameters for the method 'ListMediaRecording' -type ListMediaRecordingParams 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 `processing`, `completed`, `deleted`, or `failed`. - Status *string `json:"Status,omitempty"` - // SID of a MediaProcessor to filter by. - ProcessorSid *string `json:"ProcessorSid,omitempty"` - // SID of a MediaRecording source to filter by. - SourceSid *string `json:"SourceSid,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"` -} - -func (params *ListMediaRecordingParams) SetOrder(Order string) *ListMediaRecordingParams { - params.Order = &Order - return params -} -func (params *ListMediaRecordingParams) SetStatus(Status string) *ListMediaRecordingParams { - params.Status = &Status - return params -} -func (params *ListMediaRecordingParams) SetProcessorSid(ProcessorSid string) *ListMediaRecordingParams { - params.ProcessorSid = &ProcessorSid - return params -} -func (params *ListMediaRecordingParams) SetSourceSid(SourceSid string) *ListMediaRecordingParams { - params.SourceSid = &SourceSid - return params -} -func (params *ListMediaRecordingParams) SetPageSize(PageSize int) *ListMediaRecordingParams { - params.PageSize = &PageSize - return params -} -func (params *ListMediaRecordingParams) SetLimit(Limit int) *ListMediaRecordingParams { - params.Limit = &Limit - return params -} - -// Retrieve a single page of MediaRecording records from the API. Request is executed immediately. -func (c *ApiService) PageMediaRecording(params *ListMediaRecordingParams, pageToken, pageNumber string) (*ListMediaRecordingResponse, error) { - path := "/v1/MediaRecordings" - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Order != nil { - data.Set("Order", *params.Order) - } - if params != nil && params.Status != nil { - data.Set("Status", *params.Status) - } - if params != nil && params.ProcessorSid != nil { - data.Set("ProcessorSid", *params.ProcessorSid) - } - if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) - } - 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 := &ListMediaRecordingResponse{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Lists MediaRecording records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning. -func (c *ApiService) ListMediaRecording(params *ListMediaRecordingParams) ([]MediaV1MediaRecording, error) { - response, errors := c.StreamMediaRecording(params) - - records := make([]MediaV1MediaRecording, 0) - for record := range response { - records = append(records, record) - } - - if err := <-errors; err != nil { - return nil, err - } - - return records, nil -} - -// Streams MediaRecording records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached. -func (c *ApiService) StreamMediaRecording(params *ListMediaRecordingParams) (chan MediaV1MediaRecording, chan error) { - if params == nil { - params = &ListMediaRecordingParams{} - } - params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit)) - - recordChannel := make(chan MediaV1MediaRecording, 1) - errorChannel := make(chan error, 1) - - response, err := c.PageMediaRecording(params, "", "") - if err != nil { - errorChannel <- err - close(recordChannel) - close(errorChannel) - } else { - go c.streamMediaRecording(response, params, recordChannel, errorChannel) - } - - return recordChannel, errorChannel -} - -func (c *ApiService) streamMediaRecording(response *ListMediaRecordingResponse, params *ListMediaRecordingParams, recordChannel chan MediaV1MediaRecording, errorChannel chan error) { - curRecord := 1 - - for response != nil { - responseRecords := response.MediaRecordings - for item := range responseRecords { - recordChannel <- responseRecords[item] - curRecord += 1 - if params.Limit != nil && *params.Limit < curRecord { - close(recordChannel) - close(errorChannel) - return - } - } - - record, err := client.GetNext(c.baseURL, response, c.getNextListMediaRecordingResponse) - if err != nil { - errorChannel <- err - break - } else if record == nil { - break - } - - response = record.(*ListMediaRecordingResponse) - } - - close(recordChannel) - close(errorChannel) -} - -func (c *ApiService) getNextListMediaRecordingResponse(nextPageUrl string) (interface{}, error) { - if nextPageUrl == "" { - return nil, nil - } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &ListMediaRecordingResponse{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - return ps, nil -} diff --git a/rest/media/v1/model_list_media_processor_response.go b/rest/media/v1/model_list_media_processor_response.go deleted file mode 100644 index bee5083ae..000000000 --- a/rest/media/v1/model_list_media_processor_response.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -// ListMediaProcessorResponse struct for ListMediaProcessorResponse -type ListMediaProcessorResponse struct { - MediaProcessors []MediaV1MediaProcessor `json:"media_processors,omitempty"` - Meta ListMediaProcessorResponseMeta `json:"meta,omitempty"` -} diff --git a/rest/media/v1/model_list_media_processor_response_meta.go b/rest/media/v1/model_list_media_processor_response_meta.go deleted file mode 100644 index 16c6f90b4..000000000 --- a/rest/media/v1/model_list_media_processor_response_meta.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -// ListMediaProcessorResponseMeta struct for 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"` -} diff --git a/rest/media/v1/model_list_media_recording_response.go b/rest/media/v1/model_list_media_recording_response.go deleted file mode 100644 index 4d2bcee7b..000000000 --- a/rest/media/v1/model_list_media_recording_response.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -// ListMediaRecordingResponse struct for ListMediaRecordingResponse -type ListMediaRecordingResponse struct { - MediaRecordings []MediaV1MediaRecording `json:"media_recordings,omitempty"` - Meta ListMediaProcessorResponseMeta `json:"meta,omitempty"` -} diff --git a/rest/media/v1/model_list_player_streamer_response.go b/rest/media/v1/model_list_player_streamer_response.go deleted file mode 100644 index 6fe094163..000000000 --- a/rest/media/v1/model_list_player_streamer_response.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -// ListPlayerStreamerResponse struct for ListPlayerStreamerResponse -type ListPlayerStreamerResponse struct { - PlayerStreamers []MediaV1PlayerStreamer `json:"player_streamers,omitempty"` - Meta ListMediaProcessorResponseMeta `json:"meta,omitempty"` -} diff --git a/rest/media/v1/model_media_v1_media_processor.go b/rest/media/v1/model_media_v1_media_processor.go deleted file mode 100644 index df058aca7..000000000 --- a/rest/media/v1/model_media_v1_media_processor.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "time" -) - -// MediaV1MediaProcessor struct for MediaV1MediaProcessor -type MediaV1MediaProcessor struct { - // The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaProcessor resource. - AccountSid *string `json:"account_sid,omitempty"` - // The unique string generated to identify the MediaProcessor resource. - Sid *string `json:"sid,omitempty"` - // The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateCreated *time.Time `json:"date_created,omitempty"` - // The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateUpdated *time.Time `json:"date_updated,omitempty"` - // The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` - 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/media-extensions-overview) you are using for more information about the context to send. - ExtensionContext *string `json:"extension_context,omitempty"` - Status *string `json:"status,omitempty"` - // The absolute URL of the resource. - Url *string `json:"url,omitempty"` - // The reason why a MediaProcessor ended. When a MediaProcessor is in progress, will be `null`. When a MediaProcessor is completed, can be `ended-via-api`, `max-duration-exceeded`, `error-loading-extension`, `error-streaming-media` or `internal-service-error`. See [ended reasons](/docs/live/api/mediaprocessors#mediaprocessor-ended-reason-values) for more details. - EndedReason *string `json:"ended_reason,omitempty"` - // The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. - StatusCallback *string `json:"status_callback,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:"status_callback_method,omitempty"` - // The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. - MaxDuration *int `json:"max_duration,omitempty"` -} diff --git a/rest/media/v1/model_media_v1_media_recording.go b/rest/media/v1/model_media_v1_media_recording.go deleted file mode 100644 index 163c4d5ef..000000000 --- a/rest/media/v1/model_media_v1_media_recording.go +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "time" -) - -// MediaV1MediaRecording struct for MediaV1MediaRecording -type MediaV1MediaRecording struct { - // The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaRecording resource. - AccountSid *string `json:"account_sid,omitempty"` - // The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateCreated *time.Time `json:"date_created,omitempty"` - // The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateUpdated *time.Time `json:"date_updated,omitempty"` - // The duration of the MediaRecording in seconds. - Duration *int `json:"duration,omitempty"` - Format *string `json:"format,omitempty"` - // The URLs of related resources. - Links *map[string]interface{} `json:"links,omitempty"` - // The SID of the MediaProcessor resource which produced the MediaRecording. - ProcessorSid *string `json:"processor_sid,omitempty"` - // The dimensions of the video image in pixels expressed as columns (width) and rows (height). - Resolution *string `json:"resolution,omitempty"` - // The SID of the resource that generated the original media track(s) of the MediaRecording. - SourceSid *string `json:"source_sid,omitempty"` - // The unique string generated to identify the MediaRecording resource. - Sid *string `json:"sid,omitempty"` - // The size of the recording media in bytes. - MediaSize *int64 `json:"media_size,omitempty"` - Status *string `json:"status,omitempty"` - // The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. - StatusCallback *string `json:"status_callback,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:"status_callback_method,omitempty"` - // The absolute URL of the resource. - Url *string `json:"url,omitempty"` -} diff --git a/rest/media/v1/model_media_v1_player_streamer.go b/rest/media/v1/model_media_v1_player_streamer.go deleted file mode 100644 index 3c40ca5d2..000000000 --- a/rest/media/v1/model_media_v1_player_streamer.go +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "time" -) - -// MediaV1PlayerStreamer struct for MediaV1PlayerStreamer -type MediaV1PlayerStreamer struct { - // The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource. - AccountSid *string `json:"account_sid,omitempty"` - // The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateCreated *time.Time `json:"date_created,omitempty"` - // The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateUpdated *time.Time `json:"date_updated,omitempty"` - // Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. - Video *bool `json:"video,omitempty"` - // The URLs of related resources. - Links *map[string]interface{} `json:"links,omitempty"` - // The unique string generated to identify the PlayerStreamer resource. - Sid *string `json:"sid,omitempty"` - Status *string `json:"status,omitempty"` - // The absolute URL of the resource. - Url *string `json:"url,omitempty"` - // The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. - StatusCallback *string `json:"status_callback,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:"status_callback_method,omitempty"` - EndedReason *string `json:"ended_reason,omitempty"` - // The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. - MaxDuration *int `json:"max_duration,omitempty"` -} diff --git a/rest/media/v1/model_media_v1_player_streamer_playback_grant.go b/rest/media/v1/model_media_v1_player_streamer_playback_grant.go deleted file mode 100644 index d195887b9..000000000 --- a/rest/media/v1/model_media_v1_player_streamer_playback_grant.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "time" -) - -// MediaV1PlayerStreamerPlaybackGrant struct for MediaV1PlayerStreamerPlaybackGrant -type MediaV1PlayerStreamerPlaybackGrant struct { - // The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for. - Sid *string `json:"sid,omitempty"` - // The absolute URL of the resource. - Url *string `json:"url,omitempty"` - // The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this resource. - AccountSid *string `json:"account_sid,omitempty"` - // The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - DateCreated *time.Time `json:"date_created,omitempty"` - // The grant that authorizes the player sdk to connect to the livestream - Grant *interface{} `json:"grant,omitempty"` -} diff --git a/rest/media/v1/player_streamers.go b/rest/media/v1/player_streamers.go deleted file mode 100644 index 24146e238..000000000 --- a/rest/media/v1/player_streamers.go +++ /dev/null @@ -1,302 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" - - "github.com/twilio/twilio-go/client" -) - -// Optional parameters for the method 'CreatePlayerStreamer' -type CreatePlayerStreamerParams struct { - // Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. - Video *bool `json:"Video,omitempty"` - // The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/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"` - // The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. - MaxDuration *int `json:"MaxDuration,omitempty"` -} - -func (params *CreatePlayerStreamerParams) SetVideo(Video bool) *CreatePlayerStreamerParams { - params.Video = &Video - return params -} -func (params *CreatePlayerStreamerParams) SetStatusCallback(StatusCallback string) *CreatePlayerStreamerParams { - params.StatusCallback = &StatusCallback - return params -} -func (params *CreatePlayerStreamerParams) SetStatusCallbackMethod(StatusCallbackMethod string) *CreatePlayerStreamerParams { - params.StatusCallbackMethod = &StatusCallbackMethod - return params -} -func (params *CreatePlayerStreamerParams) SetMaxDuration(MaxDuration int) *CreatePlayerStreamerParams { - params.MaxDuration = &MaxDuration - return params -} - -func (c *ApiService) CreatePlayerStreamer(params *CreatePlayerStreamerParams) (*MediaV1PlayerStreamer, error) { - path := "/v1/PlayerStreamers" - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Video != nil { - data.Set("Video", fmt.Sprint(*params.Video)) - } - if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) - } - if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) - } - if params != nil && params.MaxDuration != nil { - data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) - } - - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &MediaV1PlayerStreamer{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Returns a single PlayerStreamer resource identified by a SID. -func (c *ApiService) FetchPlayerStreamer(Sid string) (*MediaV1PlayerStreamer, error) { - path := "/v1/PlayerStreamers/{Sid}" - 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 := &MediaV1PlayerStreamer{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Optional parameters for the method 'ListPlayerStreamer' -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"` -} - -func (params *ListPlayerStreamerParams) SetOrder(Order string) *ListPlayerStreamerParams { - params.Order = &Order - return params -} -func (params *ListPlayerStreamerParams) SetStatus(Status string) *ListPlayerStreamerParams { - params.Status = &Status - return params -} -func (params *ListPlayerStreamerParams) SetPageSize(PageSize int) *ListPlayerStreamerParams { - params.PageSize = &PageSize - return params -} -func (params *ListPlayerStreamerParams) SetLimit(Limit int) *ListPlayerStreamerParams { - params.Limit = &Limit - return params -} - -// Retrieve a single page of PlayerStreamer records from the API. Request is executed immediately. -func (c *ApiService) PagePlayerStreamer(params *ListPlayerStreamerParams, pageToken, pageNumber string) (*ListPlayerStreamerResponse, error) { - path := "/v1/PlayerStreamers" - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Order != nil { - data.Set("Order", *params.Order) - } - if params != nil && params.Status != nil { - data.Set("Status", *params.Status) - } - 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 := &ListPlayerStreamerResponse{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// Lists PlayerStreamer records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning. -func (c *ApiService) ListPlayerStreamer(params *ListPlayerStreamerParams) ([]MediaV1PlayerStreamer, error) { - response, errors := c.StreamPlayerStreamer(params) - - records := make([]MediaV1PlayerStreamer, 0) - for record := range response { - records = append(records, record) - } - - if err := <-errors; err != nil { - return nil, err - } - - return records, nil -} - -// 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 (c *ApiService) StreamPlayerStreamer(params *ListPlayerStreamerParams) (chan MediaV1PlayerStreamer, chan error) { - if params == nil { - params = &ListPlayerStreamerParams{} - } - params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit)) - - recordChannel := make(chan MediaV1PlayerStreamer, 1) - errorChannel := make(chan error, 1) - - response, err := c.PagePlayerStreamer(params, "", "") - if err != nil { - errorChannel <- err - close(recordChannel) - close(errorChannel) - } else { - go c.streamPlayerStreamer(response, params, recordChannel, errorChannel) - } - - return recordChannel, errorChannel -} - -func (c *ApiService) streamPlayerStreamer(response *ListPlayerStreamerResponse, params *ListPlayerStreamerParams, recordChannel chan MediaV1PlayerStreamer, errorChannel chan error) { - curRecord := 1 - - for response != nil { - responseRecords := response.PlayerStreamers - for item := range responseRecords { - recordChannel <- responseRecords[item] - curRecord += 1 - if params.Limit != nil && *params.Limit < curRecord { - close(recordChannel) - close(errorChannel) - return - } - } - - record, err := client.GetNext(c.baseURL, response, c.getNextListPlayerStreamerResponse) - if err != nil { - errorChannel <- err - break - } else if record == nil { - break - } - - response = record.(*ListPlayerStreamerResponse) - } - - close(recordChannel) - close(errorChannel) -} - -func (c *ApiService) getNextListPlayerStreamerResponse(nextPageUrl string) (interface{}, error) { - if nextPageUrl == "" { - return nil, nil - } - resp, err := c.requestHandler.Get(nextPageUrl, nil, nil) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &ListPlayerStreamerResponse{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - return ps, nil -} - -// Optional parameters for the method 'UpdatePlayerStreamer' -type UpdatePlayerStreamerParams struct { - // - Status *string `json:"Status,omitempty"` -} - -func (params *UpdatePlayerStreamerParams) SetStatus(Status string) *UpdatePlayerStreamerParams { - params.Status = &Status - return params -} - -// Updates a PlayerStreamer resource identified by a SID. -func (c *ApiService) UpdatePlayerStreamer(Sid string, params *UpdatePlayerStreamerParams) (*MediaV1PlayerStreamer, error) { - path := "/v1/PlayerStreamers/{Sid}" - path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Status != nil { - data.Set("Status", *params.Status) - } - - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &MediaV1PlayerStreamer{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} diff --git a/rest/media/v1/player_streamers_playback_grant.go b/rest/media/v1/player_streamers_playback_grant.go deleted file mode 100644 index ece852082..000000000 --- a/rest/media/v1/player_streamers_playback_grant.go +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Media - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" -) - -// Optional parameters for the method 'CreatePlayerStreamerPlaybackGrant' -type CreatePlayerStreamerPlaybackGrantParams struct { - // The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. - Ttl *int `json:"Ttl,omitempty"` - // 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"` -} - -func (params *CreatePlayerStreamerPlaybackGrantParams) SetTtl(Ttl int) *CreatePlayerStreamerPlaybackGrantParams { - params.Ttl = &Ttl - return params -} -func (params *CreatePlayerStreamerPlaybackGrantParams) SetAccessControlAllowOrigin(AccessControlAllowOrigin string) *CreatePlayerStreamerPlaybackGrantParams { - params.AccessControlAllowOrigin = &AccessControlAllowOrigin - return params -} - -func (c *ApiService) CreatePlayerStreamerPlaybackGrant(Sid string, params *CreatePlayerStreamerPlaybackGrantParams) (*MediaV1PlayerStreamerPlaybackGrant, error) { - path := "/v1/PlayerStreamers/{Sid}/PlaybackGrant" - path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) - - data := url.Values{} - headers := make(map[string]interface{}) - - if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) - } - if params != nil && params.AccessControlAllowOrigin != nil { - data.Set("AccessControlAllowOrigin", *params.AccessControlAllowOrigin) - } - - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - ps := &MediaV1PlayerStreamerPlaybackGrant{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} - -// **This method is not enabled.** Returns a single PlaybackGrant resource identified by a SID. -func (c *ApiService) FetchPlayerStreamerPlaybackGrant(Sid string) (*MediaV1PlayerStreamerPlaybackGrant, error) { - path := "/v1/PlayerStreamers/{Sid}/PlaybackGrant" - 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 := &MediaV1PlayerStreamerPlaybackGrant{} - if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { - return nil, err - } - - return ps, err -} diff --git a/twilio.go b/twilio.go index c0ee450dc..2134ad77e 100644 --- a/twilio.go +++ b/twilio.go @@ -34,13 +34,13 @@ import ( IpMessagingV2 "github.com/twilio/twilio-go/rest/ip_messaging/v2" LookupsV1 "github.com/twilio/twilio-go/rest/lookups/v1" LookupsV2 "github.com/twilio/twilio-go/rest/lookups/v2" - MediaV1 "github.com/twilio/twilio-go/rest/media/v1" MessagingV1 "github.com/twilio/twilio-go/rest/messaging/v1" MicrovisorV1 "github.com/twilio/twilio-go/rest/microvisor/v1" MonitorV1 "github.com/twilio/twilio-go/rest/monitor/v1" NotifyV1 "github.com/twilio/twilio-go/rest/notify/v1" NumbersV1 "github.com/twilio/twilio-go/rest/numbers/v1" NumbersV2 "github.com/twilio/twilio-go/rest/numbers/v2" + OauthV1 "github.com/twilio/twilio-go/rest/oauth/v1" PreviewMessagingV1 "github.com/twilio/twilio-go/rest/preview_messaging/v1" PricingV1 "github.com/twilio/twilio-go/rest/pricing/v1" PricingV2 "github.com/twilio/twilio-go/rest/pricing/v2" @@ -81,7 +81,6 @@ type RestClient struct { IpMessagingV2 *IpMessagingV2.ApiService LookupsV1 *LookupsV1.ApiService LookupsV2 *LookupsV2.ApiService - MediaV1 *MediaV1.ApiService PreviewMessagingV1 *PreviewMessagingV1.ApiService MessagingV1 *MessagingV1.ApiService MicrovisorV1 *MicrovisorV1.ApiService @@ -89,6 +88,7 @@ type RestClient struct { NotifyV1 *NotifyV1.ApiService NumbersV1 *NumbersV1.ApiService NumbersV2 *NumbersV2.ApiService + OauthV1 *OauthV1.ApiService PricingV1 *PricingV1.ApiService PricingV2 *PricingV2.ApiService ProxyV1 *ProxyV1.ApiService @@ -175,7 +175,6 @@ func NewRestClientWithParams(params ClientParams) *RestClient { c.IpMessagingV2 = IpMessagingV2.NewApiService(c.RequestHandler) c.LookupsV1 = LookupsV1.NewApiService(c.RequestHandler) c.LookupsV2 = LookupsV2.NewApiService(c.RequestHandler) - c.MediaV1 = MediaV1.NewApiService(c.RequestHandler) c.PreviewMessagingV1 = PreviewMessagingV1.NewApiService(c.RequestHandler) c.MessagingV1 = MessagingV1.NewApiService(c.RequestHandler) c.MicrovisorV1 = MicrovisorV1.NewApiService(c.RequestHandler) @@ -183,6 +182,7 @@ func NewRestClientWithParams(params ClientParams) *RestClient { c.NotifyV1 = NotifyV1.NewApiService(c.RequestHandler) c.NumbersV1 = NumbersV1.NewApiService(c.RequestHandler) c.NumbersV2 = NumbersV2.NewApiService(c.RequestHandler) + c.OauthV1 = OauthV1.NewApiService(c.RequestHandler) c.PricingV1 = PricingV1.NewApiService(c.RequestHandler) c.PricingV2 = PricingV2.NewApiService(c.RequestHandler) c.ProxyV1 = ProxyV1.NewApiService(c.RequestHandler)