From 394c148bf2d52386002cdeac2dbe89140ea5b2bc Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Mon, 27 Nov 2023 15:57:37 +0000 Subject: [PATCH] Update Captions in the API reference --- docs/Api/CaptionsApi.md | 8 ++++---- docs/Model/Caption.md | 7 ++++--- src/Api/CaptionsApi.php | 18 +++++++++--------- src/Model/Caption.php | 37 ++++++++++++++++++++++++++++++++++--- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/docs/Api/CaptionsApi.md b/docs/Api/CaptionsApi.md index 813c4a8..a06b09b 100644 --- a/docs/Api/CaptionsApi.md +++ b/docs/Api/CaptionsApi.md @@ -24,7 +24,7 @@ Upload a VTT file to add captions to your video. More information can be found [ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- `videoId` | **string**| The unique identifier for the video you want to add a caption to. | - `language` | **string**| A valid BCP 47 language representation. | + `language` | **string**| A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). | `file` | **\SplFileObject**| The video text track (VTT) you want to upload. | @@ -53,7 +53,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- `videoId` | **string**| The unique identifier for the video you want captions for. | - `language` | **string**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation | + `language` | **string**| A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). | @@ -79,7 +79,7 @@ To have the captions on automatically, use this method to set default: true. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- `videoId` | **string**| The unique identifier for the video you want to have automatic captions for. | - `language` | **string**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. | + `language` | **string**| A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). | `captionsUpdatePayload` | [**\ApiVideo\Client\Model\CaptionsUpdatePayload**](../Model/CaptionsUpdatePayload.md)| | @@ -106,7 +106,7 @@ Delete a caption in a specific language by by video id. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- `videoId` | **string**| The unique identifier for the video you want to delete a caption from. | - `language` | **string**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. | + `language` | **string**| A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). | diff --git a/docs/Model/Caption.md b/docs/Model/Caption.md index dc5b695..107f5f5 100644 --- a/docs/Model/Caption.md +++ b/docs/Model/Caption.md @@ -4,9 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uri** | **string** | | [optional] -**src** | **string** | | [optional] -**srclang** | **string** | | [optional] +**uri** | **string** | The unique resource identifier of the uploaded caption. | [optional] +**src** | **string** | A direct URL to the uploaded caption file. | [optional] +**srclang** | **string** | Indicates the language of the uploaded caption file using IETF language tags. | [optional] +**languageName** | **string** | Returns the native name of the caption language in UTF-8 encoding. | [optional] **default** | **bool** | Whether you will have subtitles or not. True for yes you will have subtitles, false for no you will not have subtitles. | [optional] [default to false] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/CaptionsApi.php b/src/Api/CaptionsApi.php index b39fe63..084bb85 100644 --- a/src/Api/CaptionsApi.php +++ b/src/Api/CaptionsApi.php @@ -46,7 +46,7 @@ public function __construct(BaseClient $client) * Upload a caption * * @param string $videoId The unique identifier for the video you want to add a caption to. (required) - * @param string $language A valid BCP 47 language representation. (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * @param \SplFileObject $file The video text track (VTT) you want to upload. (required) * * @throws \ApiVideo\Client\ApiException on non-2xx response @@ -66,7 +66,7 @@ public function upload(string $videoId, string $language, \SplFileObject $file): * Create request for operation 'upload' * * @param string $videoId The unique identifier for the video you want to add a caption to. (required) - * @param string $language A valid BCP 47 language representation. (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * @param \SplFileObject $file The video text track (VTT) you want to upload. (required) * * @throws \InvalidArgumentException @@ -153,11 +153,11 @@ private function buildUploadRequest(string $videoId, string $language, \SplFileO * Retrieve a caption * * @param string $videoId The unique identifier for the video you want captions for. (required) - * @param string $language A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\NotFound + * @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound */ public function get(string $videoId, string $language): \ApiVideo\Client\Model\Caption { @@ -172,7 +172,7 @@ public function get(string $videoId, string $language): \ApiVideo\Client\Model\C * Create request for operation 'get' * * @param string $videoId The unique identifier for the video you want captions for. (required) - * @param string $language A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * * @throws \InvalidArgumentException * @return Request @@ -233,7 +233,7 @@ private function buildGetRequest(string $videoId, string $language): Request * Update a caption * * @param string $videoId The unique identifier for the video you want to have automatic captions for. (required) - * @param string $language A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * @param \ApiVideo\Client\Model\CaptionsUpdatePayload $captionsUpdatePayload captionsUpdatePayload (required) * * @throws \ApiVideo\Client\ApiException on non-2xx response @@ -253,7 +253,7 @@ public function update(string $videoId, string $language, \ApiVideo\Client\Model * Create request for operation 'update' * * @param string $videoId The unique identifier for the video you want to have automatic captions for. (required) - * @param string $language A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * @param \ApiVideo\Client\Model\CaptionsUpdatePayload $captionsUpdatePayload (required) * * @throws \InvalidArgumentException @@ -324,7 +324,7 @@ private function buildUpdateRequest(string $videoId, string $language, \ApiVideo * Delete a caption * * @param string $videoId The unique identifier for the video you want to delete a caption from. (required) - * @param string $language A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -341,7 +341,7 @@ public function delete(string $videoId, string $language): void * Create request for operation 'delete' * * @param string $videoId The unique identifier for the video you want to delete a caption from. (required) - * @param string $language A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. (required) + * @param string $language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - This endpoint uses [Symfony](https://symfony.com) to reference the list of supported language tags. You can find the list of supported tags [here](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Intl/Resources/data/locales/meta.php). (required) * * @throws \InvalidArgumentException * @return Request diff --git a/src/Model/Caption.php b/src/Model/Caption.php index 71a4ce7..dd9ff86 100644 --- a/src/Model/Caption.php +++ b/src/Model/Caption.php @@ -34,36 +34,42 @@ public static function getDefinition(): ModelDefinition 'uri' => 'string', 'src' => 'string', 'srclang' => 'string', + 'languageName' => 'string', 'default' => 'bool' ], [ 'uri' => null, 'src' => null, 'srclang' => null, + 'languageName' => null, 'default' => null ], [ 'uri' => 'uri', 'src' => 'src', 'srclang' => 'srclang', + 'languageName' => 'languageName', 'default' => 'default' ], [ 'uri' => 'setUri', 'src' => 'setSrc', 'srclang' => 'setSrclang', + 'languageName' => 'setLanguageName', 'default' => 'setDefault' ], [ 'uri' => 'getUri', 'src' => 'getSrc', 'srclang' => 'getSrclang', + 'languageName' => 'getLanguageName', 'default' => 'getDefault' ], [ 'uri' => null, 'src' => null, 'srclang' => null, + 'languageName' => null, 'default' => null ], null @@ -89,6 +95,7 @@ public function __construct(array $data = null) $this->container['uri'] = $data['uri'] ?? null; $this->container['src'] = $data['src'] ?? null; $this->container['srclang'] = $data['srclang'] ?? null; + $this->container['languageName'] = $data['languageName'] ?? null; $this->container['default'] = $data['default'] ?? false; } @@ -129,7 +136,7 @@ public function getUri() /** * Sets uri * - * @param string|null $uri uri + * @param string|null $uri The unique resource identifier of the uploaded caption. * * @return self */ @@ -153,7 +160,7 @@ public function getSrc() /** * Sets src * - * @param string|null $src src + * @param string|null $src A direct URL to the uploaded caption file. * * @return self */ @@ -177,7 +184,7 @@ public function getSrclang() /** * Sets srclang * - * @param string|null $srclang srclang + * @param string|null $srclang Indicates the language of the uploaded caption file using IETF language tags. * * @return self */ @@ -188,6 +195,30 @@ public function setSrclang($srclang) return $this; } + /** + * Gets languageName + * + * @return string|null + */ + public function getLanguageName() + { + return $this->container['languageName']; + } + + /** + * Sets languageName + * + * @param string|null $languageName Returns the native name of the caption language in UTF-8 encoding. + * + * @return self + */ + public function setLanguageName($languageName) + { + $this->container['languageName'] = $languageName; + + return $this; + } + /** * Gets default *