From a1ecc1677b68e758aaf3706b3d3ae9dac68cc5e0 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Tue, 8 Oct 2024 10:26:53 +0000 Subject: [PATCH] Add transcript feature --- CHANGELOG.md | 3 + api/openapi.yaml | 179 +++++++++++++++++++++++++++++++- client.go | 4 +- docs/Video.md | 62 +++++++++++ docs/VideoCreationPayload.md | 52 ++++++++++ docs/VideoUpdatePayload.md | 52 ++++++++++ model_video.go | 79 ++++++++++++++ model_video_creation_payload.go | 68 ++++++++++++ model_video_update_payload.go | 68 ++++++++++++ 9 files changed, 563 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bb7526..bc522a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.4] - 2024-10-08 +- Add transcript feature + ## [1.4.3] - 2024-09-30 - Add /tags API endpoint diff --git a/api/openapi.yaml b/api/openapi.yaml index 7335f0d..edeac3d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -284,6 +284,8 @@ paths: playerId: pl45KFKdlddgk654dspkze title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api public: false panoramic: false mp4Support: true @@ -314,6 +316,8 @@ paths: - videoId: vi4blUQJFrYWbaG44NChkH27 title: Video Title description: A description for your video. + language: en + languageOrigin: api public: false panoramic: false mp4Support: true @@ -346,6 +350,8 @@ paths: playerId: pl45KFKdlddgk654dspkze title: My Video Title description: A brief description of the video. + language: fr + languageOrigin: api public: false panoramic: false mp4Support: true @@ -611,6 +617,8 @@ paths: videoId: vi4blUQJFrYWbaG44NChkH27 title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api public: false panoramic: false mp4Support: true @@ -693,7 +701,7 @@ paths: content: application/json: examples: - response: + Arttribute required: value: type: https://docs.api.video/reference/attribute-required title: This attribute is required. @@ -712,6 +720,25 @@ paths: - type: https://docs.api.video/reference/invalid-attribute title: This attribute must be an array. name: metadata + Invalid language formatting: + description: This error occurs when the language tag you provided + contains characters other than letters and dashes. + value: + 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 + Invalid language: + description: This error occurs when the language tag you provided + does not match any supported language. + value: + type: https://docs.api.video/reference/invalid-attribute + title: An attribute is invalid. + status: 400 + detail: The "language" attribute is not valid. + name: language schema: $ref: '#/components/schemas/bad-request' description: Bad Request @@ -2958,6 +2985,8 @@ paths: playerId: pl45KFKdlddgk654dspkze title: Maths video description: An amazing video explaining string theory + language: en + languageOrigin: api public: false panoramic: false mp4Support: true @@ -3211,6 +3240,8 @@ paths: playerId: pl45KFKdlddgk654dspkze title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api public: false panoramic: false mp4Support: true @@ -3266,7 +3297,7 @@ paths: content: application/json: examples: - response: + Invalid attribute: value: type: https://docs.api.video/reference/invalid-attribute title: This attribute must be a ISO-8601 date. @@ -3282,6 +3313,25 @@ paths: - type: https://docs.api.video/reference/invalid-attribute title: This attribute must be an array. name: metadata + Invalid language formatting: + description: This error occurs when the language tag you provided + contains characters other than letters and dashes. + value: + 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 + Invalid language: + description: This error occurs when the language tag you provided + does not match any supported language. + value: + type: https://docs.api.video/reference/invalid-attribute + title: An attribute is invalid. + status: 400 + detail: The "language" attribute is not valid. + name: language schema: $ref: '#/components/schemas/bad-request' description: Bad Request @@ -5575,6 +5625,7 @@ paths: playerId: pl45KFKdlddgk654dspkze title: Maths video description: An amazing video explaining the string theory + language: en public: false panoramic: false tags: @@ -14811,6 +14862,8 @@ components: videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api tags: - maths - string theory @@ -14882,6 +14935,22 @@ components: description: Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. type: boolean + language: + description: Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) + format. You can set the language during video creation via the API, otherwise + it is detected automatically. + type: string + languageOrigin: + description: |- + Returns the origin of the last update on the video's `language` attribute. + + - `api` means that the last update was requested from the API. + - `auto` means that the last update was done automatically by the API. + enum: + - api + - auto + nullable: true + type: string tags: description: "One array of tags (each tag is a string) in order to categorize\ \ a video. Tags may include spaces. \n" @@ -15630,6 +15699,8 @@ components: - videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api tags: - maths - string theory @@ -15651,6 +15722,8 @@ components: - videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api tags: - maths - string theory @@ -15702,6 +15775,8 @@ components: panoramic: false mp4Support: true playerId: pl45KFKdlddgk654dspkze + language: en + transcript: true tags: - maths - string theory @@ -15772,6 +15847,55 @@ components: $ref: '#/components/schemas/video-clip' watermark: $ref: '#/components/schemas/video-watermark' + language: + description: |- + Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. + + `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. + enum: + - ar + - ca + - cs + - da + - de + - el + - en + - es + - fa + - fi + - fr + - he + - hi + - hr + - hu + - it + - ja + - ko + - ml + - nl + - nn + - "false" + - pl + - pt + - ru + - sk + - sl + - te + - tr + - uk + - ur + - vi + - zh + example: fr + type: string + transcript: + description: "Use this parameter to enable transcription. \n\n- When `true`,\ + \ the API generates a transcript for the video.\n- The default value is\ + \ `false`.\n- If you define a video language using the `language` parameter,\ + \ the API uses that language to transcribe the video. If you do not define\ + \ a language, the API detects it based on the video. \n- When the API\ + \ generates a transcript, it will be available as a caption for the video." + type: boolean required: - title title: VideoCreationPayload @@ -15822,6 +15946,8 @@ components: title: String theory description: An amazing video explaining the string theory public: false + language: en + transcript: true panoramic: false mp4Support: true tags: @@ -15876,6 +16002,55 @@ components: items: $ref: '#/components/schemas/metadata' type: array + language: + description: |- + Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. + + `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. + enum: + - ar + - ca + - cs + - da + - de + - el + - en + - es + - fa + - fi + - fr + - he + - hi + - hr + - hu + - it + - ja + - ko + - ml + - nl + - nn + - "false" + - pl + - pt + - ru + - sk + - sl + - te + - tr + - uk + - ur + - vi + - zh + example: fr + type: string + transcript: + description: "Use this parameter to enable transcription. \n\n- When `true`,\ + \ the API generates a transcript for the video.\n- The default value is\ + \ `false`.\n- If you define a video language using the `language` parameter,\ + \ the API uses that language to transcribe the video. If you do not define\ + \ a language, the API detects it based on the video. \n- When the API\ + \ generates a transcript, it will be available as a caption for the video." + type: boolean title: VideoUpdatePayload type: object discarded-video-update-payload: diff --git a/client.go b/client.go index 707b21b..978cb7f 100644 --- a/client.go +++ b/client.go @@ -257,7 +257,7 @@ func (c *Client) prepareRequest( req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.4.3") + req.Header.Set("AV-Origin-Client", "go:1.4.4") for headerName := range headerParams { req.Header.Set(headerName, headerParams[headerName]) @@ -532,7 +532,7 @@ func (c *Client) auth(req *http.Request) (*http.Request, error) { req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.4.3") + req.Header.Set("AV-Origin-Client", "go:1.4.4") resp, err := c.httpClient.Do(req) diff --git a/docs/Video.md b/docs/Video.md index 37c541a..bb3a52f 100644 --- a/docs/Video.md +++ b/docs/Video.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DiscardedAt** | Pointer to **NullableString** | The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format. | [optional] **DeletesAt** | Pointer to **NullableString** | The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format. | [optional] **Discarded** | Pointer to **bool** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional] +**Language** | Pointer to **string** | Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. You can set the language during video creation via the API, otherwise it is detected automatically. | [optional] +**LanguageOrigin** | Pointer to **NullableString** | Returns the origin of the last update on the video's `language` attribute. - `api` means that the last update was requested from the API. - `auto` means that the last update was done automatically by the API. | [optional] **Tags** | Pointer to **[]string** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional] **Metadata** | Pointer to [**[]Metadata**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. | [optional] **Source** | Pointer to [**VideoSource**](VideoSource.md) | | [optional] @@ -281,6 +283,66 @@ SetDiscarded sets Discarded field to given value. HasDiscarded returns a boolean if a field has been set. +### GetLanguage + +`func (o *Video) GetLanguage() string` + +GetLanguage returns the Language field if non-nil, zero value otherwise. + +### GetLanguageOk + +`func (o *Video) GetLanguageOk() (*string, bool)` + +GetLanguageOk returns a tuple with the Language field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanguage + +`func (o *Video) SetLanguage(v string)` + +SetLanguage sets Language field to given value. + +### HasLanguage + +`func (o *Video) HasLanguage() bool` + +HasLanguage returns a boolean if a field has been set. + +### GetLanguageOrigin + +`func (o *Video) GetLanguageOrigin() string` + +GetLanguageOrigin returns the LanguageOrigin field if non-nil, zero value otherwise. + +### GetLanguageOriginOk + +`func (o *Video) GetLanguageOriginOk() (*string, bool)` + +GetLanguageOriginOk returns a tuple with the LanguageOrigin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanguageOrigin + +`func (o *Video) SetLanguageOrigin(v string)` + +SetLanguageOrigin sets LanguageOrigin field to given value. + +### HasLanguageOrigin + +`func (o *Video) HasLanguageOrigin() bool` + +HasLanguageOrigin returns a boolean if a field has been set. + +### SetLanguageOriginNil + +`func (o *Video) SetLanguageOriginNil(b bool)` + + SetLanguageOriginNil sets the value for LanguageOrigin to be an explicit nil + +### UnsetLanguageOrigin +`func (o *Video) UnsetLanguageOrigin()` + +UnsetLanguageOrigin ensures that no value is present for LanguageOrigin, not even an explicit nil ### GetTags `func (o *Video) GetTags() []string` diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index fd8b5ba..98f1e03 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **Metadata** | Pointer to [**[]Metadata**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. | [optional] **Clip** | Pointer to [**VideoClip**](VideoClip.md) | | [optional] **Watermark** | Pointer to [**VideoWatermark**](VideoWatermark.md) | | [optional] +**Language** | Pointer to **string** | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional] +**Transcript** | Pointer to **bool** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional] ## Methods @@ -305,6 +307,56 @@ SetWatermark sets Watermark field to given value. HasWatermark returns a boolean if a field has been set. +### GetLanguage + +`func (o *VideoCreationPayload) GetLanguage() string` + +GetLanguage returns the Language field if non-nil, zero value otherwise. + +### GetLanguageOk + +`func (o *VideoCreationPayload) GetLanguageOk() (*string, bool)` + +GetLanguageOk returns a tuple with the Language field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanguage + +`func (o *VideoCreationPayload) SetLanguage(v string)` + +SetLanguage sets Language field to given value. + +### HasLanguage + +`func (o *VideoCreationPayload) HasLanguage() bool` + +HasLanguage returns a boolean if a field has been set. + +### GetTranscript + +`func (o *VideoCreationPayload) GetTranscript() bool` + +GetTranscript returns the Transcript field if non-nil, zero value otherwise. + +### GetTranscriptOk + +`func (o *VideoCreationPayload) GetTranscriptOk() (*bool, bool)` + +GetTranscriptOk returns a tuple with the Transcript field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTranscript + +`func (o *VideoCreationPayload) SetTranscript(v bool)` + +SetTranscript sets Transcript field to given value. + +### HasTranscript + +`func (o *VideoCreationPayload) HasTranscript() bool` + +HasTranscript returns a boolean if a field has been set. + [[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/docs/VideoUpdatePayload.md b/docs/VideoUpdatePayload.md index b3efaad..52019d1 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -12,6 +12,8 @@ Name | Type | Description | Notes **Mp4Support** | Pointer to **bool** | Whether the player supports the mp4 format. | [optional] **Tags** | Pointer to **[]string** | A list of terms or words you want to tag the video with. Make sure the list includes all the tags you want as whatever you send in this list will overwrite the existing list for the video. | [optional] **Metadata** | Pointer to [**[]Metadata**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [optional] +**Language** | Pointer to **string** | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional] +**Transcript** | Pointer to **bool** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional] ## Methods @@ -242,6 +244,56 @@ SetMetadata sets Metadata field to given value. HasMetadata returns a boolean if a field has been set. +### GetLanguage + +`func (o *VideoUpdatePayload) GetLanguage() string` + +GetLanguage returns the Language field if non-nil, zero value otherwise. + +### GetLanguageOk + +`func (o *VideoUpdatePayload) GetLanguageOk() (*string, bool)` + +GetLanguageOk returns a tuple with the Language field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanguage + +`func (o *VideoUpdatePayload) SetLanguage(v string)` + +SetLanguage sets Language field to given value. + +### HasLanguage + +`func (o *VideoUpdatePayload) HasLanguage() bool` + +HasLanguage returns a boolean if a field has been set. + +### GetTranscript + +`func (o *VideoUpdatePayload) GetTranscript() bool` + +GetTranscript returns the Transcript field if non-nil, zero value otherwise. + +### GetTranscriptOk + +`func (o *VideoUpdatePayload) GetTranscriptOk() (*bool, bool)` + +GetTranscriptOk returns a tuple with the Transcript field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTranscript + +`func (o *VideoUpdatePayload) SetTranscript(v bool)` + +SetTranscript sets Transcript field to given value. + +### HasTranscript + +`func (o *VideoUpdatePayload) HasTranscript() bool` + +HasTranscript returns a boolean if a field has been set. + [[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/model_video.go b/model_video.go index 48d2e37..3d30181 100644 --- a/model_video.go +++ b/model_video.go @@ -34,6 +34,10 @@ type Video struct { DeletesAt *NullableString `json:"deletesAt,omitempty"` // Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. Discarded *bool `json:"discarded,omitempty"` + // Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. You can set the language during video creation via the API, otherwise it is detected automatically. + Language *string `json:"language,omitempty"` + // Returns the origin of the last update on the video's `language` attribute. - `api` means that the last update was requested from the API. - `auto` means that the last update was done automatically by the API. + LanguageOrigin *NullableString `json:"languageOrigin,omitempty"` // One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. Tags *[]string `json:"tags,omitempty"` // Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. @@ -370,6 +374,81 @@ func (o *Video) SetDiscarded(v bool) { o.Discarded = &v } +// GetLanguage returns the Language field value if set, zero value otherwise. +func (o *Video) GetLanguage() string { + if o == nil || o.Language == nil { + var ret string + return ret + } + return *o.Language +} + +// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Video) GetLanguageOk() (*string, bool) { + if o == nil || o.Language == nil { + return nil, false + } + return o.Language, true +} + +// HasLanguage returns a boolean if a field has been set. +func (o *Video) HasLanguage() bool { + if o != nil && o.Language != nil { + return true + } + + return false +} + +// SetLanguage gets a reference to the given string and assigns it to the Language field. +func (o *Video) SetLanguage(v string) { + o.Language = &v +} + +// GetLanguageOrigin returns the LanguageOrigin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Video) GetLanguageOrigin() string { + if o == nil || o.LanguageOrigin.Get() == nil { + var ret string + return ret + } + return *o.LanguageOrigin.Get() +} + +// GetLanguageOriginOk returns a tuple with the LanguageOrigin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Video) GetLanguageOriginOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LanguageOrigin.Get(), o.LanguageOrigin.IsSet() +} + +// HasLanguageOrigin returns a boolean if a field has been set. +func (o *Video) HasLanguageOrigin() bool { + if o != nil && o.LanguageOrigin.IsSet() { + return true + } + + return false +} + +// SetLanguageOrigin gets a reference to the given NullableString and assigns it to the LanguageOrigin field. +func (o *Video) SetLanguageOrigin(v string) { + o.LanguageOrigin.Set(&v) +} + +// SetLanguageOriginNil sets the value for LanguageOrigin to be an explicit nil +func (o *Video) SetLanguageOriginNil() { + o.LanguageOrigin.Set(nil) +} + +// UnsetLanguageOrigin ensures that no value is present for LanguageOrigin, not even an explicit nil +func (o *Video) UnsetLanguageOrigin() { + o.LanguageOrigin.Unset() +} + // GetTags returns the Tags field value if set, zero value otherwise. func (o *Video) GetTags() []string { if o == nil || o.Tags == nil { diff --git a/model_video_creation_payload.go b/model_video_creation_payload.go index ce6d281..f84d8a2 100644 --- a/model_video_creation_payload.go +++ b/model_video_creation_payload.go @@ -36,6 +36,10 @@ type VideoCreationPayload struct { Metadata *[]Metadata `json:"metadata,omitempty"` Clip *VideoClip `json:"clip,omitempty"` Watermark *VideoWatermark `json:"watermark,omitempty"` + // Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. + Language *string `json:"language,omitempty"` + // Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. + Transcript *bool `json:"transcript,omitempty"` } // NewVideoCreationPayload instantiates a new VideoCreationPayload object @@ -412,6 +416,70 @@ func (o *VideoCreationPayload) SetWatermark(v VideoWatermark) { o.Watermark = &v } +// GetLanguage returns the Language field value if set, zero value otherwise. +func (o *VideoCreationPayload) GetLanguage() string { + if o == nil || o.Language == nil { + var ret string + return ret + } + return *o.Language +} + +// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VideoCreationPayload) GetLanguageOk() (*string, bool) { + if o == nil || o.Language == nil { + return nil, false + } + return o.Language, true +} + +// HasLanguage returns a boolean if a field has been set. +func (o *VideoCreationPayload) HasLanguage() bool { + if o != nil && o.Language != nil { + return true + } + + return false +} + +// SetLanguage gets a reference to the given string and assigns it to the Language field. +func (o *VideoCreationPayload) SetLanguage(v string) { + o.Language = &v +} + +// GetTranscript returns the Transcript field value if set, zero value otherwise. +func (o *VideoCreationPayload) GetTranscript() bool { + if o == nil || o.Transcript == nil { + var ret bool + return ret + } + return *o.Transcript +} + +// GetTranscriptOk returns a tuple with the Transcript field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VideoCreationPayload) GetTranscriptOk() (*bool, bool) { + if o == nil || o.Transcript == nil { + return nil, false + } + return o.Transcript, true +} + +// HasTranscript returns a boolean if a field has been set. +func (o *VideoCreationPayload) HasTranscript() bool { + if o != nil && o.Transcript != nil { + return true + } + + return false +} + +// SetTranscript gets a reference to the given bool and assigns it to the Transcript field. +func (o *VideoCreationPayload) SetTranscript(v bool) { + o.Transcript = &v +} + type NullableVideoCreationPayload struct { value *VideoCreationPayload isSet bool diff --git a/model_video_update_payload.go b/model_video_update_payload.go index 05b8b21..8366164 100644 --- a/model_video_update_payload.go +++ b/model_video_update_payload.go @@ -32,6 +32,10 @@ type VideoUpdatePayload struct { Tags *[]string `json:"tags,omitempty"` // A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. Metadata *[]Metadata `json:"metadata,omitempty"` + // Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. + Language *string `json:"language,omitempty"` + // Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. + Transcript *bool `json:"transcript,omitempty"` } // NewVideoUpdatePayload instantiates a new VideoUpdatePayload object @@ -318,6 +322,70 @@ func (o *VideoUpdatePayload) SetMetadata(v []Metadata) { o.Metadata = &v } +// GetLanguage returns the Language field value if set, zero value otherwise. +func (o *VideoUpdatePayload) GetLanguage() string { + if o == nil || o.Language == nil { + var ret string + return ret + } + return *o.Language +} + +// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VideoUpdatePayload) GetLanguageOk() (*string, bool) { + if o == nil || o.Language == nil { + return nil, false + } + return o.Language, true +} + +// HasLanguage returns a boolean if a field has been set. +func (o *VideoUpdatePayload) HasLanguage() bool { + if o != nil && o.Language != nil { + return true + } + + return false +} + +// SetLanguage gets a reference to the given string and assigns it to the Language field. +func (o *VideoUpdatePayload) SetLanguage(v string) { + o.Language = &v +} + +// GetTranscript returns the Transcript field value if set, zero value otherwise. +func (o *VideoUpdatePayload) GetTranscript() bool { + if o == nil || o.Transcript == nil { + var ret bool + return ret + } + return *o.Transcript +} + +// GetTranscriptOk returns a tuple with the Transcript field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VideoUpdatePayload) GetTranscriptOk() (*bool, bool) { + if o == nil || o.Transcript == nil { + return nil, false + } + return o.Transcript, true +} + +// HasTranscript returns a boolean if a field has been set. +func (o *VideoUpdatePayload) HasTranscript() bool { + if o != nil && o.Transcript != nil { + return true + } + + return false +} + +// SetTranscript gets a reference to the given bool and assigns it to the Transcript field. +func (o *VideoUpdatePayload) SetTranscript(v bool) { + o.Transcript = &v +} + type NullableVideoUpdatePayload struct { value *VideoUpdatePayload isSet bool