From a86f2e554eee49c55f77bd0e8a71160712e0559b Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Tue, 8 Oct 2024 10:16:47 +0000 Subject: [PATCH] Add transcript feature --- CHANGELOG.md | 3 + README.md | 6 +- api/openapi.yaml | 19 +++ build.gradle | 2 +- docs/Video.md | 11 ++ maven-push.gradle | 4 +- pom.xml | 2 +- .../video/api/uploader/api/ApiClient.java | 2 +- .../video/api/uploader/api/models/Video.java | 117 +++++++++++++++++- 9 files changed, 153 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 289c6e0..0332ce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.3.7] - 2024-10-08 +- Add transcript feature + ## [1.3.6] - 2024-04-25 - Add API to get rate limiting headers diff --git a/README.md b/README.md index 880e8cf..6f6eb9f 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Add this dependency to your project's POM: video.api android-video-uploader - 1.3.6 + 1.3.7 compile ``` @@ -72,7 +72,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -implementation "video.api:android-video-uploader:1.3.6" +implementation "video.api:android-video-uploader:1.3.7" ``` #### Others @@ -85,7 +85,7 @@ mvn clean package Then manually install the following JARs: -* `target/android-video-uploader-1.3.6.jar` +* `target/android-video-uploader-1.3.7.jar` * `target/lib/*.jar` ### Code sample diff --git a/api/openapi.yaml b/api/openapi.yaml index 1469927..293afd4 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -613,6 +613,7 @@ paths: playerId: pl45KFKdlddgk654dspkze title: Maths video description: An amazing video explaining the string theory + language: en public: false panoramic: false tags: @@ -1049,6 +1050,8 @@ components: videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz title: Maths video description: An amazing video explaining the string theory + language: en + languageOrigin: api tags: - maths - string theory @@ -1120,6 +1123,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" diff --git a/build.gradle b/build.gradle index 2bbbffd..d5d3293 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'maven-publish' apply plugin: 'kotlin-android' group = 'video.api' -version = '1.3.6' +version = '1.3.7' buildscript { repositories { diff --git a/docs/Video.md b/docs/Video.md index 2b080eb..511ff99 100644 --- a/docs/Video.md +++ b/docs/Video.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **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] **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] **discarded** | **Boolean** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional] +**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] +**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] **tags** | **List<String>** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional] **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] **source** | [**VideoSource**](VideoSource.md) | | [optional] @@ -25,6 +27,15 @@ Name | Type | Description | Notes **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] + +## Enum: LanguageOriginEnum + +Name | Value +---- | ----- +API | "api" +AUTO | "auto" + + ## Implemented Interfaces * Serializable diff --git a/maven-push.gradle b/maven-push.gradle index b8981c2..9b79441 100644 --- a/maven-push.gradle +++ b/maven-push.gradle @@ -18,7 +18,7 @@ apply plugin: 'maven-publish' apply plugin: 'signing' def isReleaseBuild() { - return !"1.3.6".contains("SNAPSHOT") + return !"1.3.7".contains("SNAPSHOT") } def getReleaseRepositoryUrl() { @@ -57,7 +57,7 @@ afterEvaluate { groupId = "video.api" artifactId = "android-video-uploader" - version = "1.3.6" + version = "1.3.7" pom { name = "video.api:android-video-uploader" diff --git a/pom.xml b/pom.xml index 2cfe5eb..6736506 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ android-video-uploader jar ${project.groupId}:${project.artifactId} - 1.3.6 + 1.3.7 https://github.com/apivideo/api.video-android-uploader The official Android api.video uploader diff --git a/src/main/java/video/api/uploader/api/ApiClient.java b/src/main/java/video/api/uploader/api/ApiClient.java index 5a17cc9..3e32d4f 100644 --- a/src/main/java/video/api/uploader/api/ApiClient.java +++ b/src/main/java/video/api/uploader/api/ApiClient.java @@ -120,7 +120,7 @@ private OkHttpClient initHttpClient(List interceptors) { private void init() { verifyingSsl = true; json = new JSON(); - addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.6"); + addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.7"); } private boolean isValid(String regex, String field) { diff --git a/src/main/java/video/api/uploader/api/models/Video.java b/src/main/java/video/api/uploader/api/models/Video.java index 4244df3..abc08f1 100644 --- a/src/main/java/video/api/uploader/api/models/Video.java +++ b/src/main/java/video/api/uploader/api/models/Video.java @@ -72,6 +72,63 @@ public class Video implements Serializable, DeepObject { @SerializedName(SERIALIZED_NAME_DISCARDED) private Boolean discarded; + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + private String language; + + /** + * 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. + */ + @JsonAdapter(LanguageOriginEnum.Adapter.class) + public enum LanguageOriginEnum { + API("api"), + + AUTO("auto"); + + private String value; + + LanguageOriginEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LanguageOriginEnum fromValue(String value) { + for (LanguageOriginEnum b : LanguageOriginEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LanguageOriginEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LanguageOriginEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LanguageOriginEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_LANGUAGE_ORIGIN = "languageOrigin"; + @SerializedName(SERIALIZED_NAME_LANGUAGE_ORIGIN) + private LanguageOriginEnum languageOrigin; + public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) private List tags = null; @@ -296,6 +353,51 @@ public void setDiscarded(Boolean discarded) { this.discarded = discarded; } + public Video language(String language) { + this.language = language; + return this; + } + + /** + * 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. + * + * @return language + **/ + @javax.annotation.Nullable + @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.") + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public Video languageOrigin(LanguageOriginEnum languageOrigin) { + this.languageOrigin = languageOrigin; + return this; + } + + /** + * 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. + * + * @return languageOrigin + **/ + @javax.annotation.Nullable + @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.") + + public LanguageOriginEnum getLanguageOrigin() { + return languageOrigin; + } + + public void setLanguageOrigin(LanguageOriginEnum languageOrigin) { + this.languageOrigin = languageOrigin; + } + public Video tags(List tags) { this.tags = tags; return this; @@ -498,16 +600,19 @@ public boolean equals(Object o) { && Objects.equals(this.updatedAt, video.updatedAt) && Objects.equals(this.discardedAt, video.discardedAt) && Objects.equals(this.deletesAt, video.deletesAt) && Objects.equals(this.discarded, video.discarded) - && Objects.equals(this.tags, video.tags) && Objects.equals(this.metadata, video.metadata) - && Objects.equals(this.source, video.source) && Objects.equals(this.assets, video.assets) - && Objects.equals(this.playerId, video.playerId) && Objects.equals(this._public, video._public) - && Objects.equals(this.panoramic, video.panoramic) && Objects.equals(this.mp4Support, video.mp4Support); + && Objects.equals(this.language, video.language) + && Objects.equals(this.languageOrigin, video.languageOrigin) && Objects.equals(this.tags, video.tags) + && Objects.equals(this.metadata, video.metadata) && Objects.equals(this.source, video.source) + && Objects.equals(this.assets, video.assets) && Objects.equals(this.playerId, video.playerId) + && Objects.equals(this._public, video._public) && Objects.equals(this.panoramic, video.panoramic) + && Objects.equals(this.mp4Support, video.mp4Support); } @Override public int hashCode() { return Objects.hash(videoId, createdAt, title, description, publishedAt, updatedAt, discardedAt, deletesAt, - discarded, tags, metadata, source, assets, playerId, _public, panoramic, mp4Support); + discarded, language, languageOrigin, tags, metadata, source, assets, playerId, _public, panoramic, + mp4Support); } @Override @@ -523,6 +628,8 @@ public String toString() { sb.append(" discardedAt: ").append(toIndentedString(discardedAt)).append("\n"); sb.append(" deletesAt: ").append(toIndentedString(deletesAt)).append("\n"); sb.append(" discarded: ").append(toIndentedString(discarded)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" languageOrigin: ").append(toIndentedString(languageOrigin)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n");