Skip to content

Commit

Permalink
Merge pull request #79 from apivideo/caption-language-update
Browse files Browse the repository at this point in the history
Update Captions in the API reference
  • Loading branch information
bot-api-video authored Nov 27, 2023
2 parents 0f9f65c + 394c148 commit 7184abf
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 19 deletions.
8 changes: 4 additions & 4 deletions docs/Api/CaptionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |


Expand Down Expand Up @@ -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). |



Expand All @@ -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)| |


Expand All @@ -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). |



Expand Down
7 changes: 4 additions & 3 deletions docs/Model/Caption.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 9 additions & 9 deletions src/Api/CaptionsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
{
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
37 changes: 34 additions & 3 deletions src/Model/Caption.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand All @@ -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
*/
Expand All @@ -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
*
Expand Down

0 comments on commit 7184abf

Please sign in to comment.