Skip to content

Commit 3504e0a

Browse files
author
olivierapivideo
authored
Add transcript feature
1 parent 6fbc14b commit 3504e0a

File tree

3 files changed

+141
-5
lines changed

3 files changed

+141
-5
lines changed

api/openapi.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ paths:
613613
playerId: pl45KFKdlddgk654dspkze
614614
title: Maths video
615615
description: An amazing video explaining the string theory
616+
language: en
616617
public: false
617618
panoramic: false
618619
tags:
@@ -1049,6 +1050,8 @@ components:
10491050
videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz
10501051
title: Maths video
10511052
description: An amazing video explaining the string theory
1053+
language: en
1054+
languageOrigin: api
10521055
tags:
10531056
- maths
10541057
- string theory
@@ -1120,6 +1123,21 @@ components:
11201123
description: Returns `true` for videos you discarded when you have the Video
11211124
Restore feature enabled. Returns `false` for every other video.
11221125
type: boolean
1126+
language:
1127+
description: Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag)
1128+
format. You can set the language during video creation via the API, otherwise
1129+
it is detected automatically.
1130+
type: string
1131+
languageOrigin:
1132+
description: |-
1133+
Returns the origin of the last update on the video's `language` attribute.
1134+
1135+
- `api` means that the last update was requested from the API.
1136+
- `auto` means that the last update was done automatically by the API.
1137+
enum:
1138+
- api
1139+
- auto
1140+
type: string
11231141
tags:
11241142
description: "One array of tags (each tag is a string) in order to categorize\
11251143
\ a video. Tags may include spaces. \n"

docs/Video.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Name | Type | Description | Notes
1515
**discardedAt** | **OffsetDateTime** | 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]
1616
**deletesAt** | **OffsetDateTime** | 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]
1717
**discarded** | **Boolean** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional]
18+
**language** | **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]
19+
**languageOrigin** | [**LanguageOriginEnum**](#LanguageOriginEnum) | 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]
1820
**tags** | **List<String>** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional]
1921
**metadata** | [**List<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]
2022
**source** | [**VideoSource**](VideoSource.md) | | [optional]
@@ -25,6 +27,15 @@ Name | Type | Description | Notes
2527
**mp4Support** | **Boolean** | This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video. | [optional]
2628

2729

30+
31+
## Enum: LanguageOriginEnum
32+
33+
Name | Value
34+
---- | -----
35+
API | "api"
36+
AUTO | "auto"
37+
38+
2839
## Implemented Interfaces
2940

3041
* Serializable

src/main/java/video/api/uploader/api/models/Video.java

Lines changed: 112 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,63 @@ public class Video implements Serializable, DeepObject {
7272
@SerializedName(SERIALIZED_NAME_DISCARDED)
7373
private Boolean discarded;
7474

75+
public static final String SERIALIZED_NAME_LANGUAGE = "language";
76+
@SerializedName(SERIALIZED_NAME_LANGUAGE)
77+
private String language;
78+
79+
/**
80+
* Returns the origin of the last update on the video's `language` attribute. - `api` means
81+
* that the last update was requested from the API. - `auto` means that the last update was done
82+
* automatically by the API.
83+
*/
84+
@JsonAdapter(LanguageOriginEnum.Adapter.class)
85+
public enum LanguageOriginEnum {
86+
API("api"),
87+
88+
AUTO("auto");
89+
90+
private String value;
91+
92+
LanguageOriginEnum(String value) {
93+
this.value = value;
94+
}
95+
96+
public String getValue() {
97+
return value;
98+
}
99+
100+
@Override
101+
public String toString() {
102+
return String.valueOf(value);
103+
}
104+
105+
public static LanguageOriginEnum fromValue(String value) {
106+
for (LanguageOriginEnum b : LanguageOriginEnum.values()) {
107+
if (b.value.equals(value)) {
108+
return b;
109+
}
110+
}
111+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
112+
}
113+
114+
public static class Adapter extends TypeAdapter<LanguageOriginEnum> {
115+
@Override
116+
public void write(final JsonWriter jsonWriter, final LanguageOriginEnum enumeration) throws IOException {
117+
jsonWriter.value(enumeration.getValue());
118+
}
119+
120+
@Override
121+
public LanguageOriginEnum read(final JsonReader jsonReader) throws IOException {
122+
String value = jsonReader.nextString();
123+
return LanguageOriginEnum.fromValue(value);
124+
}
125+
}
126+
}
127+
128+
public static final String SERIALIZED_NAME_LANGUAGE_ORIGIN = "languageOrigin";
129+
@SerializedName(SERIALIZED_NAME_LANGUAGE_ORIGIN)
130+
private LanguageOriginEnum languageOrigin;
131+
75132
public static final String SERIALIZED_NAME_TAGS = "tags";
76133
@SerializedName(SERIALIZED_NAME_TAGS)
77134
private List<String> tags = null;
@@ -296,6 +353,51 @@ public void setDiscarded(Boolean discarded) {
296353
this.discarded = discarded;
297354
}
298355

356+
public Video language(String language) {
357+
this.language = language;
358+
return this;
359+
}
360+
361+
/**
362+
* Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
363+
* You can set the language during video creation via the API, otherwise it is detected automatically.
364+
*
365+
* @return language
366+
**/
367+
@javax.annotation.Nullable
368+
@ApiModelProperty(value = "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.")
369+
370+
public String getLanguage() {
371+
return language;
372+
}
373+
374+
public void setLanguage(String language) {
375+
this.language = language;
376+
}
377+
378+
public Video languageOrigin(LanguageOriginEnum languageOrigin) {
379+
this.languageOrigin = languageOrigin;
380+
return this;
381+
}
382+
383+
/**
384+
* Returns the origin of the last update on the video&#39;s &#x60;language&#x60; attribute. - &#x60;api&#x60; means
385+
* that the last update was requested from the API. - &#x60;auto&#x60; means that the last update was done
386+
* automatically by the API.
387+
*
388+
* @return languageOrigin
389+
**/
390+
@javax.annotation.Nullable
391+
@ApiModelProperty(value = "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.")
392+
393+
public LanguageOriginEnum getLanguageOrigin() {
394+
return languageOrigin;
395+
}
396+
397+
public void setLanguageOrigin(LanguageOriginEnum languageOrigin) {
398+
this.languageOrigin = languageOrigin;
399+
}
400+
299401
public Video tags(List<String> tags) {
300402
this.tags = tags;
301403
return this;
@@ -498,16 +600,19 @@ public boolean equals(Object o) {
498600
&& Objects.equals(this.updatedAt, video.updatedAt)
499601
&& Objects.equals(this.discardedAt, video.discardedAt)
500602
&& Objects.equals(this.deletesAt, video.deletesAt) && Objects.equals(this.discarded, video.discarded)
501-
&& Objects.equals(this.tags, video.tags) && Objects.equals(this.metadata, video.metadata)
502-
&& Objects.equals(this.source, video.source) && Objects.equals(this.assets, video.assets)
503-
&& Objects.equals(this.playerId, video.playerId) && Objects.equals(this._public, video._public)
504-
&& Objects.equals(this.panoramic, video.panoramic) && Objects.equals(this.mp4Support, video.mp4Support);
603+
&& Objects.equals(this.language, video.language)
604+
&& Objects.equals(this.languageOrigin, video.languageOrigin) && Objects.equals(this.tags, video.tags)
605+
&& Objects.equals(this.metadata, video.metadata) && Objects.equals(this.source, video.source)
606+
&& Objects.equals(this.assets, video.assets) && Objects.equals(this.playerId, video.playerId)
607+
&& Objects.equals(this._public, video._public) && Objects.equals(this.panoramic, video.panoramic)
608+
&& Objects.equals(this.mp4Support, video.mp4Support);
505609
}
506610

507611
@Override
508612
public int hashCode() {
509613
return Objects.hash(videoId, createdAt, title, description, publishedAt, updatedAt, discardedAt, deletesAt,
510-
discarded, tags, metadata, source, assets, playerId, _public, panoramic, mp4Support);
614+
discarded, language, languageOrigin, tags, metadata, source, assets, playerId, _public, panoramic,
615+
mp4Support);
511616
}
512617

513618
@Override
@@ -523,6 +628,8 @@ public String toString() {
523628
sb.append(" discardedAt: ").append(toIndentedString(discardedAt)).append("\n");
524629
sb.append(" deletesAt: ").append(toIndentedString(deletesAt)).append("\n");
525630
sb.append(" discarded: ").append(toIndentedString(discarded)).append("\n");
631+
sb.append(" language: ").append(toIndentedString(language)).append("\n");
632+
sb.append(" languageOrigin: ").append(toIndentedString(languageOrigin)).append("\n");
526633
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
527634
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
528635
sb.append(" source: ").append(toIndentedString(source)).append("\n");

0 commit comments

Comments
 (0)