Skip to content

Commit

Permalink
Update Captions in the API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
szekelyzol authored Nov 27, 2023
1 parent 9fd9a3f commit 1f57452
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 27 deletions.
8 changes: 4 additions & 4 deletions apivideo/api/captions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def upload(
Args:
video_id (str): The unique identifier for the video you want to add a caption to.
language (str): A valid BCP 47 language representation.
language (str): 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 (file_type): The video text track (VTT) you want to upload.
Keyword Args:
Expand Down Expand Up @@ -201,7 +201,7 @@ def get(
Args:
video_id (str): The unique identifier for the video you want captions for.
language (str): A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
language (str): 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).
Keyword Args:
_return_http_data_only (bool): response data without head status
Expand Down Expand Up @@ -340,7 +340,7 @@ def update(
Args:
video_id (str): The unique identifier for the video you want to have automatic captions for.
language (str): A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
language (str): 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).
captions_update_payload (CaptionsUpdatePayload):
Keyword Args:
Expand Down Expand Up @@ -486,7 +486,7 @@ def delete(
Args:
video_id (str): The unique identifier for the video you want to delete a caption from.
language (str): A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
language (str): 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).
Keyword Args:
_return_http_data_only (bool): response data without head status
Expand Down
9 changes: 6 additions & 3 deletions apivideo/model/caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def openapi_types():
'uri': (str,), # noqa: E501
'src': (str,), # noqa: E501
'srclang': (str,), # noqa: E501
'language_name': (str,), # noqa: E501
'default': (bool,), # noqa: E501
}

Expand All @@ -86,6 +87,7 @@ def discriminator():
'uri': 'uri', # noqa: E501
'src': 'src', # noqa: E501
'srclang': 'srclang', # noqa: E501
'language_name': 'languageName', # noqa: E501
'default': 'default', # noqa: E501
}

Expand Down Expand Up @@ -135,9 +137,10 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
uri (str): [optional] # noqa: E501
src (str): [optional] # noqa: E501
srclang (str): [optional] # noqa: E501
uri (str): The unique resource identifier of the uploaded caption.. [optional] # noqa: E501
src (str): A direct URL to the uploaded caption file.. [optional] # noqa: E501
srclang (str): Indicates the language of the uploaded caption file using IETF language tags.. [optional] # noqa: E501
language_name (str): Returns the native name of the caption language in UTF-8 encoding.. [optional] # noqa: E501
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] if omitted the server will use the default value of False # noqa: E501
"""

Expand Down
7 changes: 4 additions & 3 deletions docs/Caption.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uri** | **str** | | [optional]
**src** | **str** | | [optional]
**srclang** | **str** | | [optional]
**uri** | **str** | The unique resource identifier of the uploaded caption. | [optional]
**src** | **str** | A direct URL to the uploaded caption file. | [optional]
**srclang** | **str** | Indicates the language of the uploaded caption file using IETF language tags. | [optional]
**language_name** | **str** | 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] if omitted the server will use the default value of False

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
24 changes: 14 additions & 10 deletions docs/CaptionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = captions_api.CaptionsApi(api_client)
video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want to add a caption to.
language = "en" # str | A valid BCP 47 language representation.
language = "en" # str | 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 = open('/path/to/file', 'rb') # file_type | The video text track (VTT) you want to upload.

# example passing only required values which don't have defaults set
Expand All @@ -51,7 +51,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**video_id** | **str**| The unique identifier for the video you want to add a caption to. |
**language** | **str**| A valid BCP 47 language representation. |
**language** | **str**| 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** | **file_type**| The video text track (VTT) you want to upload. |

### Return type
Expand All @@ -69,7 +69,7 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Success | - |
**400** | Bad Request | - |
**400** | Bad request error | - |
**404** | Not Found | - |

[[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)
Expand All @@ -88,6 +88,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
```python
import apivideo
from apivideo.api import captions_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.not_found import NotFound
from apivideo.model.caption import Caption
from pprint import pprint
Expand All @@ -97,7 +98,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = captions_api.CaptionsApi(api_client)
video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want captions for.
language = "en" # str | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
language = "en" # str | 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).

# example passing only required values which don't have defaults set
try:
Expand All @@ -114,7 +115,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**video_id** | **str**| The unique identifier for the video you want captions for. |
**language** | **str**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation |
**language** | **str**| 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). |

### Return type

Expand All @@ -131,6 +132,7 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Success | - |
**400** | Bad request error | - |
**404** | Not Found | - |

[[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)
Expand Down Expand Up @@ -158,7 +160,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = captions_api.CaptionsApi(api_client)
video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want to have automatic captions for.
language = "en" # str | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
language = "en" # str | 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).
captions_update_payload = CaptionsUpdatePayload(
default=True,
) # CaptionsUpdatePayload |
Expand All @@ -178,7 +180,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**video_id** | **str**| The unique identifier for the video you want to have automatic captions for. |
**language** | **str**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. |
**language** | **str**| 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). |
**captions_update_payload** | [**CaptionsUpdatePayload**](CaptionsUpdatePayload.md)| |

### Return type
Expand All @@ -196,7 +198,7 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Success | - |
**400** | Bad Request | - |
**400** | Bad request error | - |
**404** | Not Found | - |

[[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)
Expand All @@ -213,6 +215,7 @@ Delete a caption in a specific language by by video id.
```python
import apivideo
from apivideo.api import captions_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.not_found import NotFound
from pprint import pprint

Expand All @@ -221,7 +224,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = captions_api.CaptionsApi(api_client)
video_id = "vi4k0jvEUuaTdRAEjQ4Prklgc" # str | The unique identifier for the video you want to delete a caption from.
language = "en" # str | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
language = "en" # str | 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).

# example passing only required values which don't have defaults set
try:
Expand All @@ -237,7 +240,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**video_id** | **str**| The unique identifier for the video you want to delete a caption from. |
**language** | **str**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. |
**language** | **str**| 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). |

### Return type

Expand All @@ -254,6 +257,7 @@ void (empty response body)
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No Content | - |
**400** | Bad request error | - |
**404** | Not Found | - |

[[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)
Expand Down
7 changes: 7 additions & 0 deletions test/payloads/captions/delete/responses/400-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type" : "https://docs.api.video/reference/invalid-attribute",
"title" : "An attribute is invalid.",
"status" : 400,
"detail" : "The \"language\" attribute must contain only letters and dashes (for example \"fr\", \"fr-BE\").",
"name" : "language"
}
Loading

0 comments on commit 1f57452

Please sign in to comment.