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 fc956f5 commit 44c9afa
Show file tree
Hide file tree
Showing 18 changed files with 91 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/oas_apivideo.yaml-defaut-cli.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1d4d58267d0aabd2f6d0cc27edace1a106ca7a51c9059dbfb1b196ec098aee44
20b55cdf69d53ef2d692c059cb3ffd7b8856b3965f52947e63fa25cdb7425f8f
16 changes: 8 additions & 8 deletions Sources/APIs/CaptionsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ open class CaptionsAPI {
Upload a caption

- parameter videoId: (path) The unique identifier for the video you want to add a caption to.
- parameter language: (path) A valid BCP 47 language representation.
- parameter language: (path) 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).
- parameter file: (form) The video text track (VTT) you want to upload.
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects.
Expand All @@ -39,7 +39,7 @@ open class CaptionsAPI {
- POST /videos/{videoId}/captions/{language}
- Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions)
- parameter videoId: (path) The unique identifier for the video you want to add a caption to.
- parameter language: (path) A valid BCP 47 language representation.
- parameter language: (path) 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).
- parameter file: (form) The video text track (VTT) you want to upload.
- returns: RequestBuilder<Caption>
*/
Expand Down Expand Up @@ -76,7 +76,7 @@ open class CaptionsAPI {
Retrieve a caption

- parameter videoId: (path) The unique identifier for the video you want captions for.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. 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).
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects.
*/
Expand All @@ -100,7 +100,7 @@ open class CaptionsAPI {

Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions).
- parameter videoId: (path) The unique identifier for the video you want captions for.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. 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).
- returns: RequestBuilder<Caption>
*/
open class func getWithRequestBuilder(videoId: String, language: String) -> RequestBuilder<Caption> {
Expand Down Expand Up @@ -132,7 +132,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
Update a caption

- parameter videoId: (path) The unique identifier for the video you want to have automatic captions for.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. 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).
- parameter captionsUpdatePayload: (body)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects.
Expand All @@ -155,7 +155,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
- PATCH /videos/{videoId}/captions/{language}
- To have the captions on automatically, use this method to set default: true.
- parameter videoId: (path) The unique identifier for the video you want to have automatic captions for.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. 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).
- parameter captionsUpdatePayload: (body)
- returns: RequestBuilder<Caption>
*/
Expand Down Expand Up @@ -188,7 +188,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
Delete a caption

- parameter videoId: (path) The unique identifier for the video you want to delete a caption from.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. 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).
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects.
*/
Expand All @@ -210,7 +210,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
- DELETE /videos/{videoId}/captions/{language}
- Delete a caption in a specific language by by video id.
- parameter videoId: (path) The unique identifier for the video you want to delete a caption from.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. 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).
- returns: RequestBuilder<Void>
*/
open class func deleteWithRequestBuilder(videoId: String, language: String) -> RequestBuilder<Void> {
Expand Down
10 changes: 9 additions & 1 deletion Sources/Models/Caption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,30 @@ import AnyCodable

public struct Caption: Codable, Hashable {

/** The unique resource identifier of the uploaded caption. */
public var uri: String?
/** A direct URL to the uploaded caption file. */
public var src: String?
/** Indicates the language of the uploaded caption file using IETF language tags. */
public var srclang: String?
/** Returns the native name of the caption language in UTF-8 encoding. */
public var languageName: String?
/** Whether you will have subtitles or not. True for yes you will have subtitles, false for no you will not have subtitles. */
public var _default: Bool? = false

public init(uri: String? = nil, src: String? = nil, srclang: String? = nil, _default: Bool? = false) {
public init(uri: String? = nil, src: String? = nil, srclang: String? = nil, languageName: String? = nil, _default: Bool? = false) {
self.uri = uri
self.src = src
self.srclang = srclang
self.languageName = languageName
self._default = _default
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case uri
case src
case srclang
case languageName
case _default = "default"
}

Expand All @@ -39,6 +46,7 @@ public struct Caption: Codable, Hashable {
try container.encodeIfPresent(uri, forKey: .uri)
try container.encodeIfPresent(src, forKey: .src)
try container.encodeIfPresent(srclang, forKey: .srclang)
try container.encodeIfPresent(languageName, forKey: .languageName)
try container.encodeIfPresent(_default, forKey: ._default)
}
}
Expand Down
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"
}
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 is not valid.",
"name" : "language"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"uri" : "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
"src" : "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
"srclang" : "en",
"languageName" : "English",
"default" : false
}
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"
}
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 is not valid.",
"name" : "language"
}
2 changes: 2 additions & 0 deletions Tests/TestResources/payloads/captions/list/responses/200.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"uri" : "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
"src" : "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
"srclang" : "en",
"languageName" : "English",
"default" : false
}, {
"uri" : "/videos/vi3N6cDinStg3oBbN79GklWS/captions/fr",
"src" : "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/fr.vtt",
"srclang" : "fr",
"languageName" : "Française",
"default" : false
} ],
"pagination" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"uri" : "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
"src" : "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
"srclang" : "en",
"languageName" : "English",
"default" : true
}
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"
}
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 is not valid.",
"name" : "language"
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"uri" : "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
"src" : "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
"srclang" : "en",
"languageName" : "English",
"default" : false
}
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"
}
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 is not valid.",
"name" : "language"
}
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** | **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#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
Loading

0 comments on commit 44c9afa

Please sign in to comment.