diff --git a/build.gradle b/build.gradle index 748905c1..d21f63a1 100644 --- a/build.gradle +++ b/build.gradle @@ -13,9 +13,9 @@ repositories { dependencies { api 'com.squareup.okhttp3:okhttp:4.12.0' - api 'com.fasterxml.jackson.core:jackson-databind:2.17.2' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' + api 'com.fasterxml.jackson.core:jackson-databind:2.13.0' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.3' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3' implementation 'javax.websocket:javax.websocket-api:1.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2' @@ -47,7 +47,7 @@ publishing { maven(MavenPublication) { groupId = 'com.assemblyai' artifactId = 'assemblyai-java' - version = '3.0.0' + version = '4.0.0' from components.java pom { scm { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index a4b76b95..2c352119 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0aaefbca..09523c0e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/assemblyai/api/core/FileStream.java b/src/main/java/com/assemblyai/api/core/FileStream.java deleted file mode 100644 index f9eed113..00000000 --- a/src/main/java/com/assemblyai/api/core/FileStream.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.assemblyai.api.core; - -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import org.jetbrains.annotations.Nullable; - -/** - * Represents a file stream with associated metadata for file uploads. - */ -public class FileStream { - private final InputStream inputStream; - private final String fileName; - private final MediaType contentType; - - /** - * Constructs a FileStream with the given input stream and optional metadata. - * - * @param inputStream The input stream of the file content. Must not be null. - * @param fileName The name of the file, or null if unknown. - * @param contentType The MIME type of the file content, or null if unknown. - * @throws NullPointerException if inputStream is null - */ - public FileStream(InputStream inputStream, @Nullable String fileName, @Nullable MediaType contentType) { - this.inputStream = Objects.requireNonNull(inputStream, "Input stream cannot be null"); - this.fileName = fileName; - this.contentType = contentType; - } - - public FileStream(InputStream inputStream) { - this(inputStream, null, null); - } - - public InputStream getInputStream() { - return inputStream; - } - - @Nullable - public String getFileName() { - return fileName; - } - - @Nullable - public MediaType getContentType() { - return contentType; - } - - /** - * Creates a RequestBody suitable for use with OkHttp client. - * - * @return A RequestBody instance representing this file stream. - */ - public RequestBody toRequestBody() { - return new InputStreamRequestBody(contentType, inputStream); - } -} diff --git a/src/main/java/com/assemblyai/api/core/InputStreamRequestBody.java b/src/main/java/com/assemblyai/api/core/InputStreamRequestBody.java deleted file mode 100644 index 1182fa44..00000000 --- a/src/main/java/com/assemblyai/api/core/InputStreamRequestBody.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.assemblyai.api.core; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okhttp3.internal.Util; -import okio.BufferedSink; -import okio.Okio; -import okio.Source; -import org.jetbrains.annotations.Nullable; - -/** - * A custom implementation of OkHttp's RequestBody that wraps an InputStream. - * This class allows streaming of data from an InputStream directly to an HTTP request body, - * which is useful for file uploads or sending large amounts of data without loading it all into memory. - */ -public class InputStreamRequestBody extends RequestBody { - private final InputStream inputStream; - private final MediaType contentType; - - /** - * Constructs an InputStreamRequestBody with the specified content type and input stream. - * - * @param contentType the MediaType of the content, or null if not known - * @param inputStream the InputStream containing the data to be sent - * @throws NullPointerException if inputStream is null - */ - public InputStreamRequestBody(@Nullable MediaType contentType, InputStream inputStream) { - this.contentType = contentType; - this.inputStream = Objects.requireNonNull(inputStream, "inputStream == null"); - } - - /** - * Returns the content type of this request body. - * - * @return the MediaType of the content, or null if not specified - */ - @Nullable - @Override - public MediaType contentType() { - return contentType; - } - - /** - * Returns the content length of this request body, if known. - * This method attempts to determine the length using the InputStream's available() method, - * which may not always accurately reflect the total length of the stream. - * - * @return the content length, or -1 if the length is unknown - * @throws IOException if an I/O error occurs - */ - @Override - public long contentLength() throws IOException { - return inputStream.available() == 0 ? -1 : inputStream.available(); - } - - /** - * Writes the content of the InputStream to the given BufferedSink. - * This method is responsible for transferring the data from the InputStream to the network request. - * - * @param sink the BufferedSink to write the content to - * @throws IOException if an I/O error occurs during writing - */ - @Override - public void writeTo(BufferedSink sink) throws IOException { - Source source = null; - try { - source = Okio.source(inputStream); - sink.writeAll(source); - } finally { - Util.closeQuietly(Objects.requireNonNull(source)); - } - } -} diff --git a/src/main/java/com/assemblyai/api/resources/files/FilesClient.java b/src/main/java/com/assemblyai/api/resources/files/FilesClient.java index d7f73bcb..16650166 100644 --- a/src/main/java/com/assemblyai/api/resources/files/FilesClient.java +++ b/src/main/java/com/assemblyai/api/resources/files/FilesClient.java @@ -6,7 +6,6 @@ import com.assemblyai.api.core.AssemblyAIApiException; import com.assemblyai.api.core.AssemblyAIException; import com.assemblyai.api.core.ClientOptions; -import com.assemblyai.api.core.InputStreamRequestBody; import com.assemblyai.api.core.ObjectMappers; import com.assemblyai.api.core.RequestOptions; import com.assemblyai.api.errors.BadRequestError; @@ -19,12 +18,9 @@ import com.assemblyai.api.resources.files.types.UploadedFile; import com.assemblyai.api.types.Error; import com.fasterxml.jackson.core.JsonProcessingException; -import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; @@ -41,23 +37,24 @@ public FilesClient(ClientOptions clientOptions) { /** * Upload a media file to AssemblyAI's servers. */ - public UploadedFile upload(InputStream request) { + public UploadedFile upload(byte[] request) { return upload(request, null); } /** * Upload a media file to AssemblyAI's servers. */ - public UploadedFile upload(InputStream request, RequestOptions requestOptions) { + public UploadedFile upload(byte[] request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v2/upload") .build(); - RequestBody body = new InputStreamRequestBody(MediaType.parse("application/octet-stream"), request); + RequestBody body = RequestBody.create(request); Request okhttpRequest = new Request.Builder() .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/octet-stream") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -102,18 +99,4 @@ public UploadedFile upload(InputStream request, RequestOptions requestOptions) { throw new AssemblyAIException("Network error executing HTTP request", e); } } - - /** - * Upload a media file to AssemblyAI's servers. - */ - public UploadedFile upload(byte[] request) { - return upload(new ByteArrayInputStream(request)); - } - - /** - * Upload a media file to AssemblyAI's servers. - */ - public UploadedFile upload(byte[] request, RequestOptions requestOptions) { - return upload(new ByteArrayInputStream(request), requestOptions); - } } diff --git a/src/main/java/com/assemblyai/api/resources/files/types/UploadedFile.java b/src/main/java/com/assemblyai/api/resources/files/types/UploadedFile.java index 1a48822d..0b6ae036 100644 --- a/src/main/java/com/assemblyai/api/resources/files/types/UploadedFile.java +++ b/src/main/java/com/assemblyai/api/resources/files/types/UploadedFile.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = UploadedFile.Builder.class) @@ -66,7 +65,7 @@ public static UploadUrlStage builder() { } public interface UploadUrlStage { - _FinalStage uploadUrl(@NotNull String uploadUrl); + _FinalStage uploadUrl(String uploadUrl); Builder from(UploadedFile other); } @@ -96,8 +95,8 @@ public Builder from(UploadedFile other) { */ @java.lang.Override @JsonSetter("upload_url") - public _FinalStage uploadUrl(@NotNull String uploadUrl) { - this.uploadUrl = Objects.requireNonNull(uploadUrl, "uploadUrl must not be null"); + public _FinalStage uploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/requests/LemurTaskParams.java b/src/main/java/com/assemblyai/api/resources/lemur/requests/LemurTaskParams.java index 64abdb12..7a5d6116 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/requests/LemurTaskParams.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/requests/LemurTaskParams.java @@ -20,7 +20,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurTaskParams.Builder.class) @@ -169,7 +168,7 @@ public static PromptStage builder() { } public interface PromptStage { - _FinalStage prompt(@NotNull String prompt); + _FinalStage prompt(String prompt); Builder from(LemurTaskParams other); } @@ -241,8 +240,8 @@ public Builder from(LemurTaskParams other) { */ @java.lang.Override @JsonSetter("prompt") - public _FinalStage prompt(@NotNull String prompt) { - this.prompt = Objects.requireNonNull(prompt, "prompt must not be null"); + public _FinalStage prompt(String prompt) { + this.prompt = prompt; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurActionItemsResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurActionItemsResponse.java index cc797436..9aed7930 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurActionItemsResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurActionItemsResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurActionItemsResponse.Builder.class) @@ -92,17 +91,17 @@ public static ResponseStage builder() { } public interface ResponseStage { - RequestIdStage response(@NotNull String response); + RequestIdStage response(String response); Builder from(LemurActionItemsResponse other); } public interface RequestIdStage { - UsageStage requestId(@NotNull String requestId); + UsageStage requestId(String requestId); } public interface UsageStage { - _FinalStage usage(@NotNull LemurUsage usage); + _FinalStage usage(LemurUsage usage); } public interface _FinalStage { @@ -136,8 +135,8 @@ public Builder from(LemurActionItemsResponse other) { */ @java.lang.Override @JsonSetter("response") - public RequestIdStage response(@NotNull String response) { - this.response = Objects.requireNonNull(response, "response must not be null"); + public RequestIdStage response(String response) { + this.response = response; return this; } @@ -147,8 +146,8 @@ public RequestIdStage response(@NotNull String response) { */ @java.lang.Override @JsonSetter("request_id") - public UsageStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public UsageStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -158,8 +157,8 @@ public UsageStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("usage") - public _FinalStage usage(@NotNull LemurUsage usage) { - this.usage = Objects.requireNonNull(usage, "usage must not be null"); + public _FinalStage usage(LemurUsage usage) { + this.usage = usage; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurBaseResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurBaseResponse.java index e439a3ea..899f4fb4 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurBaseResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurBaseResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurBaseResponse.Builder.class) @@ -79,13 +78,13 @@ public static RequestIdStage builder() { } public interface RequestIdStage { - UsageStage requestId(@NotNull String requestId); + UsageStage requestId(String requestId); Builder from(LemurBaseResponse other); } public interface UsageStage { - _FinalStage usage(@NotNull LemurUsage usage); + _FinalStage usage(LemurUsage usage); } public interface _FinalStage { @@ -116,8 +115,8 @@ public Builder from(LemurBaseResponse other) { */ @java.lang.Override @JsonSetter("request_id") - public UsageStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public UsageStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -127,8 +126,8 @@ public UsageStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("usage") - public _FinalStage usage(@NotNull LemurUsage usage) { - this.usage = Objects.requireNonNull(usage, "usage must not be null"); + public _FinalStage usage(LemurUsage usage) { + this.usage = usage; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestion.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestion.java index c8d10f24..ac1857ce 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestion.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestion.java @@ -17,7 +17,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurQuestion.Builder.class) @@ -110,7 +109,7 @@ public static QuestionStage builder() { } public interface QuestionStage { - _FinalStage question(@NotNull String question); + _FinalStage question(String question); Builder from(LemurQuestion other); } @@ -161,8 +160,8 @@ public Builder from(LemurQuestion other) { */ @java.lang.Override @JsonSetter("question") - public _FinalStage question(@NotNull String question) { - this.question = Objects.requireNonNull(question, "question must not be null"); + public _FinalStage question(String question) { + this.question = question; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswer.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswer.java index 0d2068f2..565657b0 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswer.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswer.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurQuestionAnswer.Builder.class) @@ -77,13 +76,13 @@ public static QuestionStage builder() { } public interface QuestionStage { - AnswerStage question(@NotNull String question); + AnswerStage question(String question); Builder from(LemurQuestionAnswer other); } public interface AnswerStage { - _FinalStage answer(@NotNull String answer); + _FinalStage answer(String answer); } public interface _FinalStage { @@ -114,8 +113,8 @@ public Builder from(LemurQuestionAnswer other) { */ @java.lang.Override @JsonSetter("question") - public AnswerStage question(@NotNull String question) { - this.question = Objects.requireNonNull(question, "question must not be null"); + public AnswerStage question(String question) { + this.question = question; return this; } @@ -125,8 +124,8 @@ public AnswerStage question(@NotNull String question) { */ @java.lang.Override @JsonSetter("answer") - public _FinalStage answer(@NotNull String answer) { - this.answer = Objects.requireNonNull(answer, "answer must not be null"); + public _FinalStage answer(String answer) { + this.answer = answer; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswerResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswerResponse.java index 400c027d..e4a51a1d 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswerResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurQuestionAnswerResponse.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurQuestionAnswerResponse.Builder.class) @@ -97,13 +96,13 @@ public static RequestIdStage builder() { } public interface RequestIdStage { - UsageStage requestId(@NotNull String requestId); + UsageStage requestId(String requestId); Builder from(LemurQuestionAnswerResponse other); } public interface UsageStage { - _FinalStage usage(@NotNull LemurUsage usage); + _FinalStage usage(LemurUsage usage); } public interface _FinalStage { @@ -143,8 +142,8 @@ public Builder from(LemurQuestionAnswerResponse other) { */ @java.lang.Override @JsonSetter("request_id") - public UsageStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public UsageStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -154,8 +153,8 @@ public UsageStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("usage") - public _FinalStage usage(@NotNull LemurUsage usage) { - this.usage = Objects.requireNonNull(usage, "usage must not be null"); + public _FinalStage usage(LemurUsage usage) { + this.usage = usage; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurStringResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurStringResponse.java index 5368b46d..9090064d 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurStringResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurStringResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurStringResponse.Builder.class) @@ -92,17 +91,17 @@ public static ResponseStage builder() { } public interface ResponseStage { - RequestIdStage response(@NotNull String response); + RequestIdStage response(String response); Builder from(LemurStringResponse other); } public interface RequestIdStage { - UsageStage requestId(@NotNull String requestId); + UsageStage requestId(String requestId); } public interface UsageStage { - _FinalStage usage(@NotNull LemurUsage usage); + _FinalStage usage(LemurUsage usage); } public interface _FinalStage { @@ -136,8 +135,8 @@ public Builder from(LemurStringResponse other) { */ @java.lang.Override @JsonSetter("response") - public RequestIdStage response(@NotNull String response) { - this.response = Objects.requireNonNull(response, "response must not be null"); + public RequestIdStage response(String response) { + this.response = response; return this; } @@ -147,8 +146,8 @@ public RequestIdStage response(@NotNull String response) { */ @java.lang.Override @JsonSetter("request_id") - public UsageStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public UsageStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -158,8 +157,8 @@ public UsageStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("usage") - public _FinalStage usage(@NotNull LemurUsage usage) { - this.usage = Objects.requireNonNull(usage, "usage must not be null"); + public _FinalStage usage(LemurUsage usage) { + this.usage = usage; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurSummaryResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurSummaryResponse.java index c679168f..c778ea4a 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurSummaryResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurSummaryResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurSummaryResponse.Builder.class) @@ -92,17 +91,17 @@ public static ResponseStage builder() { } public interface ResponseStage { - RequestIdStage response(@NotNull String response); + RequestIdStage response(String response); Builder from(LemurSummaryResponse other); } public interface RequestIdStage { - UsageStage requestId(@NotNull String requestId); + UsageStage requestId(String requestId); } public interface UsageStage { - _FinalStage usage(@NotNull LemurUsage usage); + _FinalStage usage(LemurUsage usage); } public interface _FinalStage { @@ -136,8 +135,8 @@ public Builder from(LemurSummaryResponse other) { */ @java.lang.Override @JsonSetter("response") - public RequestIdStage response(@NotNull String response) { - this.response = Objects.requireNonNull(response, "response must not be null"); + public RequestIdStage response(String response) { + this.response = response; return this; } @@ -147,8 +146,8 @@ public RequestIdStage response(@NotNull String response) { */ @java.lang.Override @JsonSetter("request_id") - public UsageStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public UsageStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -158,8 +157,8 @@ public UsageStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("usage") - public _FinalStage usage(@NotNull LemurUsage usage) { - this.usage = Objects.requireNonNull(usage, "usage must not be null"); + public _FinalStage usage(LemurUsage usage) { + this.usage = usage; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurTaskResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurTaskResponse.java index c3aaf143..b1c6d0b1 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/LemurTaskResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/LemurTaskResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LemurTaskResponse.Builder.class) @@ -92,17 +91,17 @@ public static ResponseStage builder() { } public interface ResponseStage { - RequestIdStage response(@NotNull String response); + RequestIdStage response(String response); Builder from(LemurTaskResponse other); } public interface RequestIdStage { - UsageStage requestId(@NotNull String requestId); + UsageStage requestId(String requestId); } public interface UsageStage { - _FinalStage usage(@NotNull LemurUsage usage); + _FinalStage usage(LemurUsage usage); } public interface _FinalStage { @@ -136,8 +135,8 @@ public Builder from(LemurTaskResponse other) { */ @java.lang.Override @JsonSetter("response") - public RequestIdStage response(@NotNull String response) { - this.response = Objects.requireNonNull(response, "response must not be null"); + public RequestIdStage response(String response) { + this.response = response; return this; } @@ -147,8 +146,8 @@ public RequestIdStage response(@NotNull String response) { */ @java.lang.Override @JsonSetter("request_id") - public UsageStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public UsageStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -158,8 +157,8 @@ public UsageStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("usage") - public _FinalStage usage(@NotNull LemurUsage usage) { - this.usage = Objects.requireNonNull(usage, "usage must not be null"); + public _FinalStage usage(LemurUsage usage) { + this.usage = usage; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/lemur/types/PurgeLemurRequestDataResponse.java b/src/main/java/com/assemblyai/api/resources/lemur/types/PurgeLemurRequestDataResponse.java index 39c2fcfe..0a58bd96 100644 --- a/src/main/java/com/assemblyai/api/resources/lemur/types/PurgeLemurRequestDataResponse.java +++ b/src/main/java/com/assemblyai/api/resources/lemur/types/PurgeLemurRequestDataResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PurgeLemurRequestDataResponse.Builder.class) @@ -91,13 +90,13 @@ public static RequestIdStage builder() { } public interface RequestIdStage { - RequestIdToPurgeStage requestId(@NotNull String requestId); + RequestIdToPurgeStage requestId(String requestId); Builder from(PurgeLemurRequestDataResponse other); } public interface RequestIdToPurgeStage { - DeletedStage requestIdToPurge(@NotNull String requestIdToPurge); + DeletedStage requestIdToPurge(String requestIdToPurge); } public interface DeletedStage { @@ -135,8 +134,8 @@ public Builder from(PurgeLemurRequestDataResponse other) { */ @java.lang.Override @JsonSetter("request_id") - public RequestIdToPurgeStage requestId(@NotNull String requestId) { - this.requestId = Objects.requireNonNull(requestId, "requestId must not be null"); + public RequestIdToPurgeStage requestId(String requestId) { + this.requestId = requestId; return this; } @@ -146,8 +145,8 @@ public RequestIdToPurgeStage requestId(@NotNull String requestId) { */ @java.lang.Override @JsonSetter("request_id_to_purge") - public DeletedStage requestIdToPurge(@NotNull String requestIdToPurge) { - this.requestIdToPurge = Objects.requireNonNull(requestIdToPurge, "requestIdToPurge must not be null"); + public DeletedStage requestIdToPurge(String requestIdToPurge) { + this.requestIdToPurge = requestIdToPurge; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseMessage.java b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseMessage.java index 7d7d70fe..72eb0333 100644 --- a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseMessage.java +++ b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseMessage.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RealtimeBaseMessage.Builder.class) @@ -66,7 +65,7 @@ public static MessageTypeStage builder() { } public interface MessageTypeStage { - _FinalStage messageType(@NotNull MessageType messageType); + _FinalStage messageType(MessageType messageType); Builder from(RealtimeBaseMessage other); } @@ -96,8 +95,8 @@ public Builder from(RealtimeBaseMessage other) { */ @java.lang.Override @JsonSetter("message_type") - public _FinalStage messageType(@NotNull MessageType messageType) { - this.messageType = Objects.requireNonNull(messageType, "messageType must not be null"); + public _FinalStage messageType(MessageType messageType) { + this.messageType = messageType; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseTranscript.java b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseTranscript.java index 773965ac..d1f43b2e 100644 --- a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseTranscript.java +++ b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeBaseTranscript.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RealtimeBaseTranscript.Builder.class) @@ -158,11 +157,11 @@ public interface ConfidenceStage { } public interface TextStage { - CreatedStage text(@NotNull String text); + CreatedStage text(String text); } public interface CreatedStage { - _FinalStage created(@NotNull OffsetDateTime created); + _FinalStage created(OffsetDateTime created); } public interface _FinalStage { @@ -245,8 +244,8 @@ public TextStage confidence(double confidence) { */ @java.lang.Override @JsonSetter("text") - public CreatedStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public CreatedStage text(String text) { + this.text = text; return this; } @@ -256,8 +255,8 @@ public CreatedStage text(@NotNull String text) { */ @java.lang.Override @JsonSetter("created") - public _FinalStage created(@NotNull OffsetDateTime created) { - this.created = Objects.requireNonNull(created, "created must not be null"); + public _FinalStage created(OffsetDateTime created) { + this.created = created; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeError.java b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeError.java index eb1e2a29..4ff09b97 100644 --- a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeError.java +++ b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeError.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RealtimeError.Builder.class) @@ -63,7 +62,7 @@ public static ErrorStage builder() { } public interface ErrorStage { - _FinalStage error(@NotNull String error); + _FinalStage error(String error); Builder from(RealtimeError other); } @@ -89,8 +88,8 @@ public Builder from(RealtimeError other) { @java.lang.Override @JsonSetter("error") - public _FinalStage error(@NotNull String error) { - this.error = Objects.requireNonNull(error, "error must not be null"); + public _FinalStage error(String error) { + this.error = error; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeTemporaryTokenResponse.java b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeTemporaryTokenResponse.java index 7cdcf605..50d58c56 100644 --- a/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeTemporaryTokenResponse.java +++ b/src/main/java/com/assemblyai/api/resources/realtime/types/RealtimeTemporaryTokenResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RealtimeTemporaryTokenResponse.Builder.class) @@ -66,7 +65,7 @@ public static TokenStage builder() { } public interface TokenStage { - _FinalStage token(@NotNull String token); + _FinalStage token(String token); Builder from(RealtimeTemporaryTokenResponse other); } @@ -96,8 +95,8 @@ public Builder from(RealtimeTemporaryTokenResponse other) { */ @java.lang.Override @JsonSetter("token") - public _FinalStage token(@NotNull String token) { - this.token = Objects.requireNonNull(token, "token must not be null"); + public _FinalStage token(String token) { + this.token = token; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/realtime/types/Word.java b/src/main/java/com/assemblyai/api/resources/realtime/types/Word.java index 7745db0e..d35a00c0 100644 --- a/src/main/java/com/assemblyai/api/resources/realtime/types/Word.java +++ b/src/main/java/com/assemblyai/api/resources/realtime/types/Word.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Word.Builder.class) @@ -113,7 +112,7 @@ public interface ConfidenceStage { } public interface TextStage { - _FinalStage text(@NotNull String text); + _FinalStage text(String text); } public interface _FinalStage { @@ -183,8 +182,8 @@ public TextStage confidence(double confidence) { */ @java.lang.Override @JsonSetter("text") - public _FinalStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public _FinalStage text(String text) { + this.text = text; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/requests/ListTranscriptParams.java b/src/main/java/com/assemblyai/api/resources/transcripts/requests/ListTranscriptParams.java index 48c7a2b9..39191237 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/requests/ListTranscriptParams.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/requests/ListTranscriptParams.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListTranscriptParams.Builder.class) public final class ListTranscriptParams { - private final Optional limit; + private final Optional limit; private final Optional status; @@ -36,7 +36,7 @@ public final class ListTranscriptParams { private final Map additionalProperties; private ListTranscriptParams( - Optional limit, + Optional limit, Optional status, Optional createdOn, Optional beforeId, @@ -56,7 +56,7 @@ private ListTranscriptParams( * @return Maximum amount of transcripts to retrieve */ @JsonProperty("limit") - public Optional getLimit() { + public Optional getLimit() { return limit; } @@ -136,7 +136,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional limit = Optional.empty(); + private Optional limit = Optional.empty(); private Optional status = Optional.empty(); @@ -164,12 +164,12 @@ public Builder from(ListTranscriptParams other) { } @JsonSetter(value = "limit", nulls = Nulls.SKIP) - public Builder limit(Optional limit) { + public Builder limit(Optional limit) { this.limit = limit; return this; } - public Builder limit(Long limit) { + public Builder limit(Integer limit) { this.limit = Optional.ofNullable(limit); return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/requests/TranscriptParams.java b/src/main/java/com/assemblyai/api/resources/transcripts/requests/TranscriptParams.java index 4be2637f..d333ae5a 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/requests/TranscriptParams.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/requests/TranscriptParams.java @@ -27,7 +27,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptParams.Builder.class) @@ -46,6 +45,8 @@ public final class TranscriptParams implements ITranscriptOptionalParams { private final Optional disfluencies; + private final Optional multichannel; + private final Optional dualChannel; private final Optional webhookUrl; @@ -118,6 +119,7 @@ private TranscriptParams( Optional punctuate, Optional formatText, Optional disfluencies, + Optional multichannel, Optional dualChannel, Optional webhookUrl, Optional webhookAuthHeaderName, @@ -157,6 +159,7 @@ private TranscriptParams( this.punctuate = punctuate; this.formatText = formatText; this.disfluencies = disfluencies; + this.multichannel = multichannel; this.dualChannel = dualChannel; this.webhookUrl = webhookUrl; this.webhookAuthHeaderName = webhookAuthHeaderName; @@ -250,6 +253,15 @@ public Optional getDisfluencies() { return disfluencies; } + /** + * @return Enable Multichannel transcription, can be true or false. + */ + @JsonProperty("multichannel") + @java.lang.Override + public Optional getMultichannel() { + return multichannel; + } + /** * @return Enable Dual Channel transcription, can be true or false. */ @@ -547,6 +559,7 @@ private boolean equalTo(TranscriptParams other) { && punctuate.equals(other.punctuate) && formatText.equals(other.formatText) && disfluencies.equals(other.disfluencies) + && multichannel.equals(other.multichannel) && dualChannel.equals(other.dualChannel) && webhookUrl.equals(other.webhookUrl) && webhookAuthHeaderName.equals(other.webhookAuthHeaderName) @@ -590,6 +603,7 @@ public int hashCode() { this.punctuate, this.formatText, this.disfluencies, + this.multichannel, this.dualChannel, this.webhookUrl, this.webhookAuthHeaderName, @@ -633,7 +647,7 @@ public static AudioUrlStage builder() { } public interface AudioUrlStage { - _FinalStage audioUrl(@NotNull String audioUrl); + _FinalStage audioUrl(String audioUrl); Builder from(TranscriptParams other); } @@ -669,6 +683,10 @@ public interface _FinalStage { _FinalStage disfluencies(Boolean disfluencies); + _FinalStage multichannel(Optional multichannel); + + _FinalStage multichannel(Boolean multichannel); + _FinalStage dualChannel(Optional dualChannel); _FinalStage dualChannel(Boolean dualChannel); @@ -854,6 +872,8 @@ public static final class Builder implements AudioUrlStage, _FinalStage { private Optional dualChannel = Optional.empty(); + private Optional multichannel = Optional.empty(); + private Optional disfluencies = Optional.empty(); private Optional formatText = Optional.empty(); @@ -882,6 +902,7 @@ public Builder from(TranscriptParams other) { punctuate(other.getPunctuate()); formatText(other.getFormatText()); disfluencies(other.getDisfluencies()); + multichannel(other.getMultichannel()); dualChannel(other.getDualChannel()); webhookUrl(other.getWebhookUrl()); webhookAuthHeaderName(other.getWebhookAuthHeaderName()); @@ -922,8 +943,8 @@ public Builder from(TranscriptParams other) { */ @java.lang.Override @JsonSetter("audio_url") - public _FinalStage audioUrl(@NotNull String audioUrl) { - this.audioUrl = Objects.requireNonNull(audioUrl, "audioUrl must not be null"); + public _FinalStage audioUrl(String audioUrl) { + this.audioUrl = audioUrl; return this; } @@ -1436,6 +1457,23 @@ public _FinalStage dualChannel(Optional dualChannel) { return this; } + /** + *

Enable Multichannel transcription, can be true or false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multichannel(Boolean multichannel) { + this.multichannel = Optional.ofNullable(multichannel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multichannel", nulls = Nulls.SKIP) + public _FinalStage multichannel(Optional multichannel) { + this.multichannel = multichannel; + return this; + } + /** *

Transcribe Filler Words, like "umm", in your media file; can be true or false

* @return Reference to {@code this} so that method calls can be chained together. @@ -1559,6 +1597,7 @@ public TranscriptParams build() { punctuate, formatText, disfluencies, + multichannel, dualChannel, webhookUrl, webhookAuthHeaderName, diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightResult.java index 070aeb8e..3d1de8e8 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightResult.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AutoHighlightResult.Builder.class) @@ -116,7 +115,7 @@ public interface RankStage { } public interface TextStage { - _FinalStage text(@NotNull String text); + _FinalStage text(String text); } public interface _FinalStage { @@ -181,8 +180,8 @@ public TextStage rank(double rank) { */ @java.lang.Override @JsonSetter("text") - public _FinalStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public _FinalStage text(String text) { + this.text = text; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightsResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightsResult.java index f59f439d..18966b5e 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightsResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/AutoHighlightsResult.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AutoHighlightsResult.Builder.class) @@ -83,7 +82,7 @@ public static StatusStage builder() { } public interface StatusStage { - _FinalStage status(@NotNull AudioIntelligenceModelStatus status); + _FinalStage status(AudioIntelligenceModelStatus status); Builder from(AutoHighlightsResult other); } @@ -122,8 +121,8 @@ public Builder from(AutoHighlightsResult other) { */ @java.lang.Override @JsonSetter("status") - public _FinalStage status(@NotNull AudioIntelligenceModelStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public _FinalStage status(AudioIntelligenceModelStatus status) { + this.status = status; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/Chapter.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/Chapter.java index d91024c4..c5ac605a 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/Chapter.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/Chapter.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Chapter.Builder.class) @@ -120,17 +119,17 @@ public static GistStage builder() { } public interface GistStage { - HeadlineStage gist(@NotNull String gist); + HeadlineStage gist(String gist); Builder from(Chapter other); } public interface HeadlineStage { - SummaryStage headline(@NotNull String headline); + SummaryStage headline(String headline); } public interface SummaryStage { - StartStage summary(@NotNull String summary); + StartStage summary(String summary); } public interface StartStage { @@ -179,8 +178,8 @@ public Builder from(Chapter other) { */ @java.lang.Override @JsonSetter("gist") - public HeadlineStage gist(@NotNull String gist) { - this.gist = Objects.requireNonNull(gist, "gist must not be null"); + public HeadlineStage gist(String gist) { + this.gist = gist; return this; } @@ -190,8 +189,8 @@ public HeadlineStage gist(@NotNull String gist) { */ @java.lang.Override @JsonSetter("headline") - public SummaryStage headline(@NotNull String headline) { - this.headline = Objects.requireNonNull(headline, "headline must not be null"); + public SummaryStage headline(String headline) { + this.headline = headline; return this; } @@ -201,8 +200,8 @@ public SummaryStage headline(@NotNull String headline) { */ @java.lang.Override @JsonSetter("summary") - public StartStage summary(@NotNull String summary) { - this.summary = Objects.requireNonNull(summary, "summary must not be null"); + public StartStage summary(String summary) { + this.summary = summary; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabel.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabel.java index d701e425..ac64e0cb 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabel.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabel.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ContentSafetyLabel.Builder.class) @@ -89,7 +88,7 @@ public static LabelStage builder() { } public interface LabelStage { - ConfidenceStage label(@NotNull String label); + ConfidenceStage label(String label); Builder from(ContentSafetyLabel other); } @@ -133,8 +132,8 @@ public Builder from(ContentSafetyLabel other) { */ @java.lang.Override @JsonSetter("label") - public ConfidenceStage label(@NotNull String label) { - this.label = Objects.requireNonNull(label, "label must not be null"); + public ConfidenceStage label(String label) { + this.label = label; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelResult.java index 1e0a445a..7e5239c1 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelResult.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ContentSafetyLabelResult.Builder.class) @@ -123,7 +122,7 @@ public static TextStage builder() { } public interface TextStage { - SentencesIdxStartStage text(@NotNull String text); + SentencesIdxStartStage text(String text); Builder from(ContentSafetyLabelResult other); } @@ -137,7 +136,7 @@ public interface SentencesIdxEndStage { } public interface TimestampStage { - _FinalStage timestamp(@NotNull Timestamp timestamp); + _FinalStage timestamp(Timestamp timestamp); } public interface _FinalStage { @@ -184,8 +183,8 @@ public Builder from(ContentSafetyLabelResult other) { */ @java.lang.Override @JsonSetter("text") - public SentencesIdxStartStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public SentencesIdxStartStage text(String text) { + this.text = text; return this; } @@ -217,8 +216,8 @@ public TimestampStage sentencesIdxEnd(int sentencesIdxEnd) { */ @java.lang.Override @JsonSetter("timestamp") - public _FinalStage timestamp(@NotNull Timestamp timestamp) { - this.timestamp = Objects.requireNonNull(timestamp, "timestamp must not be null"); + public _FinalStage timestamp(Timestamp timestamp) { + this.timestamp = timestamp; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelsResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelsResult.java index 0ce23a23..83d02f0f 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelsResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/ContentSafetyLabelsResult.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ContentSafetyLabelsResult.Builder.class) @@ -54,6 +53,9 @@ public AudioIntelligenceModelStatus getStatus() { return status; } + /** + * @return An array of results for the Content Moderation model + */ @JsonProperty("results") public List getResults() { return results; @@ -108,7 +110,7 @@ public static StatusStage builder() { } public interface StatusStage { - _FinalStage status(@NotNull AudioIntelligenceModelStatus status); + _FinalStage status(AudioIntelligenceModelStatus status); Builder from(ContentSafetyLabelsResult other); } @@ -165,8 +167,8 @@ public Builder from(ContentSafetyLabelsResult other) { */ @java.lang.Override @JsonSetter("status") - public _FinalStage status(@NotNull AudioIntelligenceModelStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public _FinalStage status(AudioIntelligenceModelStatus status) { + this.status = status; return this; } @@ -226,12 +228,20 @@ public _FinalStage summary(Map summary) { return this; } + /** + *

An array of results for the Content Moderation model

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addAllResults(List results) { this.results.addAll(results); return this; } + /** + *

An array of results for the Content Moderation model

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addResults(ContentSafetyLabelResult results) { this.results.add(results); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/Entity.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/Entity.java index 2a1fdd5c..e0363a32 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/Entity.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/Entity.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Entity.Builder.class) @@ -102,13 +101,13 @@ public static EntityTypeStage builder() { } public interface EntityTypeStage { - TextStage entityType(@NotNull EntityType entityType); + TextStage entityType(EntityType entityType); Builder from(Entity other); } public interface TextStage { - StartStage text(@NotNull String text); + StartStage text(String text); } public interface StartStage { @@ -153,8 +152,8 @@ public Builder from(Entity other) { */ @java.lang.Override @JsonSetter("entity_type") - public TextStage entityType(@NotNull EntityType entityType) { - this.entityType = Objects.requireNonNull(entityType, "entityType must not be null"); + public TextStage entityType(EntityType entityType) { + this.entityType = entityType; return this; } @@ -164,8 +163,8 @@ public TextStage entityType(@NotNull EntityType entityType) { */ @java.lang.Override @JsonSetter("text") - public StartStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public StartStage text(String text) { + this.text = text; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/ITranscriptOptionalParams.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/ITranscriptOptionalParams.java index 06684f10..b130e029 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/ITranscriptOptionalParams.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/ITranscriptOptionalParams.java @@ -21,6 +21,8 @@ public interface ITranscriptOptionalParams { Optional getDisfluencies(); + Optional getMultichannel(); + Optional getDualChannel(); Optional getWebhookUrl(); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/PageDetails.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/PageDetails.java index 99fcd7ba..a32f3c77 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/PageDetails.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/PageDetails.java @@ -16,7 +16,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PageDetails.Builder.class) @@ -132,7 +131,7 @@ public interface ResultCountStage { } public interface CurrentUrlStage { - _FinalStage currentUrl(@NotNull String currentUrl); + _FinalStage currentUrl(String currentUrl); } public interface _FinalStage { @@ -202,8 +201,8 @@ public CurrentUrlStage resultCount(int resultCount) { */ @java.lang.Override @JsonSetter("current_url") - public _FinalStage currentUrl(@NotNull String currentUrl) { - this.currentUrl = Objects.requireNonNull(currentUrl, "currentUrl must not be null"); + public _FinalStage currentUrl(String currentUrl) { + this.currentUrl = currentUrl; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/ParagraphsResponse.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/ParagraphsResponse.java index c7b09a34..da1ce0d3 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/ParagraphsResponse.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/ParagraphsResponse.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ParagraphsResponse.Builder.class) @@ -45,21 +44,33 @@ private ParagraphsResponse( this.additionalProperties = additionalProperties; } + /** + * @return The unique identifier of your transcript + */ @JsonProperty("id") public String getId() { return id; } + /** + * @return The confidence score for the transcript + */ @JsonProperty("confidence") public double getConfidence() { return confidence; } + /** + * @return The duration of the audio file in seconds + */ @JsonProperty("audio_duration") public double getAudioDuration() { return audioDuration; } + /** + * @return An array of paragraphs in the transcript + */ @JsonProperty("paragraphs") public List getParagraphs() { return paragraphs; @@ -98,7 +109,7 @@ public static IdStage builder() { } public interface IdStage { - ConfidenceStage id(@NotNull String id); + ConfidenceStage id(String id); Builder from(ParagraphsResponse other); } @@ -145,13 +156,21 @@ public Builder from(ParagraphsResponse other) { return this; } + /** + *

The unique identifier of your transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("id") - public ConfidenceStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); + public ConfidenceStage id(String id) { + this.id = id; return this; } + /** + *

The confidence score for the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("confidence") public AudioDurationStage confidence(double confidence) { @@ -159,6 +178,10 @@ public AudioDurationStage confidence(double confidence) { return this; } + /** + *

The duration of the audio file in seconds

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("audio_duration") public _FinalStage audioDuration(double audioDuration) { @@ -166,12 +189,20 @@ public _FinalStage audioDuration(double audioDuration) { return this; } + /** + *

An array of paragraphs in the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addAllParagraphs(List paragraphs) { this.paragraphs.addAll(paragraphs); return this; } + /** + *

An array of paragraphs in the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addParagraphs(TranscriptParagraph paragraphs) { this.paragraphs.add(paragraphs); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/RedactedAudioResponse.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/RedactedAudioResponse.java index affaf542..0e7d0028 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/RedactedAudioResponse.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/RedactedAudioResponse.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RedactedAudioResponse.Builder.class) @@ -77,13 +76,13 @@ public static StatusStage builder() { } public interface StatusStage { - RedactedAudioUrlStage status(@NotNull String status); + RedactedAudioUrlStage status(String status); Builder from(RedactedAudioResponse other); } public interface RedactedAudioUrlStage { - _FinalStage redactedAudioUrl(@NotNull String redactedAudioUrl); + _FinalStage redactedAudioUrl(String redactedAudioUrl); } public interface _FinalStage { @@ -114,8 +113,8 @@ public Builder from(RedactedAudioResponse other) { */ @java.lang.Override @JsonSetter("status") - public RedactedAudioUrlStage status(@NotNull String status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public RedactedAudioUrlStage status(String status) { + this.status = status; return this; } @@ -125,8 +124,8 @@ public RedactedAudioUrlStage status(@NotNull String status) { */ @java.lang.Override @JsonSetter("redacted_audio_url") - public _FinalStage redactedAudioUrl(@NotNull String redactedAudioUrl) { - this.redactedAudioUrl = Objects.requireNonNull(redactedAudioUrl, "redactedAudioUrl must not be null"); + public _FinalStage redactedAudioUrl(String redactedAudioUrl) { + this.redactedAudioUrl = redactedAudioUrl; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/SentencesResponse.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/SentencesResponse.java index d1c9ef7b..667e95aa 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/SentencesResponse.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/SentencesResponse.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = SentencesResponse.Builder.class) @@ -45,21 +44,33 @@ private SentencesResponse( this.additionalProperties = additionalProperties; } + /** + * @return The unique identifier for the transcript + */ @JsonProperty("id") public String getId() { return id; } + /** + * @return The confidence score for the transcript + */ @JsonProperty("confidence") public double getConfidence() { return confidence; } + /** + * @return The duration of the audio file in seconds + */ @JsonProperty("audio_duration") public double getAudioDuration() { return audioDuration; } + /** + * @return An array of sentences in the transcript + */ @JsonProperty("sentences") public List getSentences() { return sentences; @@ -98,7 +109,7 @@ public static IdStage builder() { } public interface IdStage { - ConfidenceStage id(@NotNull String id); + ConfidenceStage id(String id); Builder from(SentencesResponse other); } @@ -145,13 +156,21 @@ public Builder from(SentencesResponse other) { return this; } + /** + *

The unique identifier for the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("id") - public ConfidenceStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); + public ConfidenceStage id(String id) { + this.id = id; return this; } + /** + *

The confidence score for the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("confidence") public AudioDurationStage confidence(double confidence) { @@ -159,6 +178,10 @@ public AudioDurationStage confidence(double confidence) { return this; } + /** + *

The duration of the audio file in seconds

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("audio_duration") public _FinalStage audioDuration(double audioDuration) { @@ -166,12 +189,20 @@ public _FinalStage audioDuration(double audioDuration) { return this; } + /** + *

An array of sentences in the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addAllSentences(List sentences) { this.sentences.addAll(sentences); return this; } + /** + *

An array of sentences in the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addSentences(TranscriptSentence sentences) { this.sentences.add(sentences); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/SentimentAnalysisResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/SentimentAnalysisResult.java index 7e413349..108a9971 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/SentimentAnalysisResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/SentimentAnalysisResult.java @@ -16,7 +16,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = SentimentAnalysisResult.Builder.class) @@ -31,6 +30,8 @@ public final class SentimentAnalysisResult { private final double confidence; + private final Optional channel; + private final Optional speaker; private final Map additionalProperties; @@ -41,6 +42,7 @@ private SentimentAnalysisResult( int end, Sentiment sentiment, double confidence, + Optional channel, Optional speaker, Map additionalProperties) { this.text = text; @@ -48,6 +50,7 @@ private SentimentAnalysisResult( this.end = end; this.sentiment = sentiment; this.confidence = confidence; + this.channel = channel; this.speaker = speaker; this.additionalProperties = additionalProperties; } @@ -92,6 +95,14 @@ public double getConfidence() { return confidence; } + /** + * @return The channel of this utterance. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + /** * @return The speaker of the sentence if Speaker Diarization is enabled, else null */ @@ -117,12 +128,14 @@ private boolean equalTo(SentimentAnalysisResult other) { && end == other.end && sentiment.equals(other.sentiment) && confidence == other.confidence + && channel.equals(other.channel) && speaker.equals(other.speaker); } @java.lang.Override public int hashCode() { - return Objects.hash(this.text, this.start, this.end, this.sentiment, this.confidence, this.speaker); + return Objects.hash( + this.text, this.start, this.end, this.sentiment, this.confidence, this.channel, this.speaker); } @java.lang.Override @@ -135,7 +148,7 @@ public static TextStage builder() { } public interface TextStage { - StartStage text(@NotNull String text); + StartStage text(String text); Builder from(SentimentAnalysisResult other); } @@ -149,7 +162,7 @@ public interface EndStage { } public interface SentimentStage { - ConfidenceStage sentiment(@NotNull Sentiment sentiment); + ConfidenceStage sentiment(Sentiment sentiment); } public interface ConfidenceStage { @@ -159,6 +172,10 @@ public interface ConfidenceStage { public interface _FinalStage { SentimentAnalysisResult build(); + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + _FinalStage speaker(Optional speaker); _FinalStage speaker(String speaker); @@ -179,6 +196,8 @@ public static final class Builder private Optional speaker = Optional.empty(); + private Optional channel = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -191,6 +210,7 @@ public Builder from(SentimentAnalysisResult other) { end(other.getEnd()); sentiment(other.getSentiment()); confidence(other.getConfidence()); + channel(other.getChannel()); speaker(other.getSpeaker()); return this; } @@ -201,8 +221,8 @@ public Builder from(SentimentAnalysisResult other) { */ @java.lang.Override @JsonSetter("text") - public StartStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public StartStage text(String text) { + this.text = text; return this; } @@ -234,8 +254,8 @@ public SentimentStage end(int end) { */ @java.lang.Override @JsonSetter("sentiment") - public ConfidenceStage sentiment(@NotNull Sentiment sentiment) { - this.sentiment = Objects.requireNonNull(sentiment, "sentiment must not be null"); + public ConfidenceStage sentiment(Sentiment sentiment) { + this.sentiment = sentiment; return this; } @@ -267,9 +287,27 @@ public _FinalStage speaker(Optional speaker) { return this; } + /** + *

The channel of this utterance. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + @java.lang.Override public SentimentAnalysisResult build() { - return new SentimentAnalysisResult(text, start, end, sentiment, confidence, speaker, additionalProperties); + return new SentimentAnalysisResult( + text, start, end, sentiment, confidence, channel, speaker, additionalProperties); } } } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionModelResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionModelResult.java index cb5d28e5..6dc59595 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionModelResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionModelResult.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TopicDetectionModelResult.Builder.class) @@ -96,7 +95,7 @@ public static StatusStage builder() { } public interface StatusStage { - _FinalStage status(@NotNull AudioIntelligenceModelStatus status); + _FinalStage status(AudioIntelligenceModelStatus status); Builder from(TopicDetectionModelResult other); } @@ -144,8 +143,8 @@ public Builder from(TopicDetectionModelResult other) { */ @java.lang.Override @JsonSetter("status") - public _FinalStage status(@NotNull AudioIntelligenceModelStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public _FinalStage status(AudioIntelligenceModelStatus status) { + this.status = status; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResult.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResult.java index df39ebc5..31c6f1d8 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResult.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResult.java @@ -17,7 +17,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TopicDetectionResult.Builder.class) @@ -49,6 +48,9 @@ public String getText() { return text; } + /** + * @return An array of detected topics in the text + */ @JsonProperty("labels") public Optional> getLabels() { return labels; @@ -89,7 +91,7 @@ public static TextStage builder() { } public interface TextStage { - _FinalStage text(@NotNull String text); + _FinalStage text(String text); Builder from(TopicDetectionResult other); } @@ -133,8 +135,8 @@ public Builder from(TopicDetectionResult other) { */ @java.lang.Override @JsonSetter("text") - public _FinalStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public _FinalStage text(String text) { + this.text = text; return this; } @@ -151,6 +153,10 @@ public _FinalStage timestamp(Optional timestamp) { return this; } + /** + *

An array of detected topics in the text

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage labels(List labels) { this.labels = Optional.ofNullable(labels); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResultLabelsItem.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResultLabelsItem.java index dc8a6a2a..ecf37434 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResultLabelsItem.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TopicDetectionResultLabelsItem.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TopicDetectionResultLabelsItem.Builder.class) @@ -83,7 +82,7 @@ public interface RelevanceStage { } public interface LabelStage { - _FinalStage label(@NotNull String label); + _FinalStage label(String label); } public interface _FinalStage { @@ -125,8 +124,8 @@ public LabelStage relevance(double relevance) { */ @java.lang.Override @JsonSetter("label") - public _FinalStage label(@NotNull String label) { - this.label = Objects.requireNonNull(label, "label must not be null"); + public _FinalStage label(String label) { + this.label = label; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/Transcript.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/Transcript.java index 1a44e3f1..7efd9b07 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/Transcript.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/Transcript.java @@ -17,7 +17,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Transcript.Builder.class) @@ -54,6 +53,10 @@ public final class Transcript { private final Optional disfluencies; + private final Optional multichannel; + + private final Optional audioChannels; + private final Optional dualChannel; private final Optional webhookUrl; @@ -157,6 +160,8 @@ private Transcript( Optional punctuate, Optional formatText, Optional disfluencies, + Optional multichannel, + Optional audioChannels, Optional dualChannel, Optional webhookUrl, Optional webhookStatusCode, @@ -216,6 +221,8 @@ private Transcript( this.punctuate = punctuate; this.formatText = formatText; this.disfluencies = disfluencies; + this.multichannel = multichannel; + this.audioChannels = audioChannels; this.dualChannel = dualChannel; this.webhookUrl = webhookUrl; this.webhookStatusCode = webhookStatusCode; @@ -391,6 +398,22 @@ public Optional getDisfluencies() { return disfluencies; } + /** + * @return Whether Multichannel transcription was enabled in the transcription request, either true or false + */ + @JsonProperty("multichannel") + public Optional getMultichannel() { + return multichannel; + } + + /** + * @return The number of audio channels in the audio file. This is only present when multichannel is enabled. + */ + @JsonProperty("audio_channels") + public Optional getAudioChannels() { + return audioChannels; + } + /** * @return Whether Dual channel transcription was enabled in the transcription request, either true or false */ @@ -751,6 +774,8 @@ private boolean equalTo(Transcript other) { && punctuate.equals(other.punctuate) && formatText.equals(other.formatText) && disfluencies.equals(other.disfluencies) + && multichannel.equals(other.multichannel) + && audioChannels.equals(other.audioChannels) && dualChannel.equals(other.dualChannel) && webhookUrl.equals(other.webhookUrl) && webhookStatusCode.equals(other.webhookStatusCode) @@ -814,6 +839,8 @@ public int hashCode() { this.punctuate, this.formatText, this.disfluencies, + this.multichannel, + this.audioChannels, this.dualChannel, this.webhookUrl, this.webhookStatusCode, @@ -868,17 +895,17 @@ public static IdStage builder() { } public interface IdStage { - AudioUrlStage id(@NotNull String id); + AudioUrlStage id(String id); Builder from(Transcript other); } public interface AudioUrlStage { - StatusStage audioUrl(@NotNull String audioUrl); + StatusStage audioUrl(String audioUrl); } public interface StatusStage { - WebhookAuthStage status(@NotNull TranscriptStatus status); + WebhookAuthStage status(TranscriptStatus status); } public interface WebhookAuthStage { @@ -898,11 +925,11 @@ public interface SummarizationStage { } public interface LanguageModelStage { - AcousticModelStage languageModel(@NotNull String languageModel); + AcousticModelStage languageModel(String languageModel); } public interface AcousticModelStage { - _FinalStage acousticModel(@NotNull String acousticModel); + _FinalStage acousticModel(String acousticModel); } public interface _FinalStage { @@ -960,6 +987,14 @@ public interface _FinalStage { _FinalStage disfluencies(Boolean disfluencies); + _FinalStage multichannel(Optional multichannel); + + _FinalStage multichannel(Boolean multichannel); + + _FinalStage audioChannels(Optional audioChannels); + + _FinalStage audioChannels(Integer audioChannels); + _FinalStage dualChannel(Optional dualChannel); _FinalStage dualChannel(Boolean dualChannel); @@ -1207,6 +1242,10 @@ public static final class Builder private Optional dualChannel = Optional.empty(); + private Optional audioChannels = Optional.empty(); + + private Optional multichannel = Optional.empty(); + private Optional disfluencies = Optional.empty(); private Optional formatText = Optional.empty(); @@ -1256,6 +1295,8 @@ public Builder from(Transcript other) { punctuate(other.getPunctuate()); formatText(other.getFormatText()); disfluencies(other.getDisfluencies()); + multichannel(other.getMultichannel()); + audioChannels(other.getAudioChannels()); dualChannel(other.getDualChannel()); webhookUrl(other.getWebhookUrl()); webhookStatusCode(other.getWebhookStatusCode()); @@ -1307,8 +1348,8 @@ public Builder from(Transcript other) { */ @java.lang.Override @JsonSetter("id") - public AudioUrlStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); + public AudioUrlStage id(String id) { + this.id = id; return this; } @@ -1318,8 +1359,8 @@ public AudioUrlStage id(@NotNull String id) { */ @java.lang.Override @JsonSetter("audio_url") - public StatusStage audioUrl(@NotNull String audioUrl) { - this.audioUrl = Objects.requireNonNull(audioUrl, "audioUrl must not be null"); + public StatusStage audioUrl(String audioUrl) { + this.audioUrl = audioUrl; return this; } @@ -1329,8 +1370,8 @@ public StatusStage audioUrl(@NotNull String audioUrl) { */ @java.lang.Override @JsonSetter("status") - public WebhookAuthStage status(@NotNull TranscriptStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public WebhookAuthStage status(TranscriptStatus status) { + this.status = status; return this; } @@ -1384,8 +1425,8 @@ public LanguageModelStage summarization(boolean summarization) { */ @java.lang.Override @JsonSetter("language_model") - public AcousticModelStage languageModel(@NotNull String languageModel) { - this.languageModel = Objects.requireNonNull(languageModel, "languageModel must not be null"); + public AcousticModelStage languageModel(String languageModel) { + this.languageModel = languageModel; return this; } @@ -1395,8 +1436,8 @@ public AcousticModelStage languageModel(@NotNull String languageModel) { */ @java.lang.Override @JsonSetter("acoustic_model") - public _FinalStage acousticModel(@NotNull String acousticModel) { - this.acousticModel = Objects.requireNonNull(acousticModel, "acousticModel must not be null"); + public _FinalStage acousticModel(String acousticModel) { + this.acousticModel = acousticModel; return this; } @@ -2004,6 +2045,40 @@ public _FinalStage dualChannel(Optional dualChannel) { return this; } + /** + *

The number of audio channels in the audio file. This is only present when multichannel is enabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage audioChannels(Integer audioChannels) { + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "audio_channels", nulls = Nulls.SKIP) + public _FinalStage audioChannels(Optional audioChannels) { + this.audioChannels = audioChannels; + return this; + } + + /** + *

Whether Multichannel transcription was enabled in the transcription request, either true or false

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multichannel(Boolean multichannel) { + this.multichannel = Optional.ofNullable(multichannel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multichannel", nulls = Nulls.SKIP) + public _FinalStage multichannel(Optional multichannel) { + this.multichannel = multichannel; + return this; + } + /** *

Transcribe Filler Words, like "umm", in your media file; can be true or false

* @return Reference to {@code this} so that method calls can be chained together. @@ -2245,6 +2320,8 @@ public Transcript build() { punctuate, formatText, disfluencies, + multichannel, + audioChannels, dualChannel, webhookUrl, webhookStatusCode, diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptCustomSpelling.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptCustomSpelling.java index 71d08e1f..78fc5b7b 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptCustomSpelling.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptCustomSpelling.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptCustomSpelling.Builder.class) @@ -80,7 +79,7 @@ public static ToStage builder() { } public interface ToStage { - _FinalStage to(@NotNull String to); + _FinalStage to(String to); Builder from(TranscriptCustomSpelling other); } @@ -119,8 +118,8 @@ public Builder from(TranscriptCustomSpelling other) { */ @java.lang.Override @JsonSetter("to") - public _FinalStage to(@NotNull String to) { - this.to = Objects.requireNonNull(to, "to must not be null"); + public _FinalStage to(String to) { + this.to = to; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptList.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptList.java index a1f9f84f..c6698452 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptList.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptList.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptList.Builder.class) @@ -35,11 +34,17 @@ private TranscriptList( this.additionalProperties = additionalProperties; } + /** + * @return Details of the transcript page + */ @JsonProperty("page_details") public PageDetails getPageDetails() { return pageDetails; } + /** + * @return An array of transcripts + */ @JsonProperty("transcripts") public List getTranscripts() { return transcripts; @@ -75,7 +80,7 @@ public static PageDetailsStage builder() { } public interface PageDetailsStage { - _FinalStage pageDetails(@NotNull PageDetails pageDetails); + _FinalStage pageDetails(PageDetails pageDetails); Builder from(TranscriptList other); } @@ -108,19 +113,31 @@ public Builder from(TranscriptList other) { return this; } + /** + *

Details of the transcript page

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("page_details") - public _FinalStage pageDetails(@NotNull PageDetails pageDetails) { - this.pageDetails = Objects.requireNonNull(pageDetails, "pageDetails must not be null"); + public _FinalStage pageDetails(PageDetails pageDetails) { + this.pageDetails = pageDetails; return this; } + /** + *

An array of transcripts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addAllTranscripts(List transcripts) { this.transcripts.addAll(transcripts); return this; } + /** + *

An array of transcripts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addTranscripts(TranscriptListItem transcripts) { this.transcripts.add(transcripts); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptListItem.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptListItem.java index 6cf42e21..4880a6f2 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptListItem.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptListItem.java @@ -17,7 +17,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptListItem.Builder.class) @@ -57,31 +56,49 @@ private TranscriptListItem( this.additionalProperties = additionalProperties; } + /** + * @return The unique identifier for the transcript + */ @JsonProperty("id") public String getId() { return id; } + /** + * @return The URL to retrieve the transcript + */ @JsonProperty("resource_url") public String getResourceUrl() { return resourceUrl; } + /** + * @return The status of the transcript + */ @JsonProperty("status") public TranscriptStatus getStatus() { return status; } + /** + * @return The date and time the transcript was created + */ @JsonProperty("created") public OffsetDateTime getCreated() { return created; } + /** + * @return The date and time the transcript was completed + */ @JsonProperty("completed") public Optional getCompleted() { return completed; } + /** + * @return The URL to the audio file + */ @JsonProperty("audio_url") public String getAudioUrl() { return audioUrl; @@ -132,25 +149,25 @@ public static IdStage builder() { } public interface IdStage { - ResourceUrlStage id(@NotNull String id); + ResourceUrlStage id(String id); Builder from(TranscriptListItem other); } public interface ResourceUrlStage { - StatusStage resourceUrl(@NotNull String resourceUrl); + StatusStage resourceUrl(String resourceUrl); } public interface StatusStage { - CreatedStage status(@NotNull TranscriptStatus status); + CreatedStage status(TranscriptStatus status); } public interface CreatedStage { - AudioUrlStage created(@NotNull OffsetDateTime created); + AudioUrlStage created(OffsetDateTime created); } public interface AudioUrlStage { - _FinalStage audioUrl(@NotNull String audioUrl); + _FinalStage audioUrl(String audioUrl); } public interface _FinalStage { @@ -199,38 +216,58 @@ public Builder from(TranscriptListItem other) { return this; } + /** + *

The unique identifier for the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("id") - public ResourceUrlStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); + public ResourceUrlStage id(String id) { + this.id = id; return this; } + /** + *

The URL to retrieve the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("resource_url") - public StatusStage resourceUrl(@NotNull String resourceUrl) { - this.resourceUrl = Objects.requireNonNull(resourceUrl, "resourceUrl must not be null"); + public StatusStage resourceUrl(String resourceUrl) { + this.resourceUrl = resourceUrl; return this; } + /** + *

The status of the transcript

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("status") - public CreatedStage status(@NotNull TranscriptStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public CreatedStage status(TranscriptStatus status) { + this.status = status; return this; } + /** + *

The date and time the transcript was created

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("created") - public AudioUrlStage created(@NotNull OffsetDateTime created) { - this.created = Objects.requireNonNull(created, "created must not be null"); + public AudioUrlStage created(OffsetDateTime created) { + this.created = created; return this; } + /** + *

The URL to the audio file

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("audio_url") - public _FinalStage audioUrl(@NotNull String audioUrl) { - this.audioUrl = Objects.requireNonNull(audioUrl, "audioUrl must not be null"); + public _FinalStage audioUrl(String audioUrl) { + this.audioUrl = audioUrl; return this; } @@ -251,6 +288,10 @@ public _FinalStage error(Optional error) { return this; } + /** + *

The date and time the transcript was completed

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage completed(OffsetDateTime completed) { this.completed = Optional.ofNullable(completed); diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptOptionalParams.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptOptionalParams.java index bd2f691b..fc66ec91 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptOptionalParams.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptOptionalParams.java @@ -35,6 +35,8 @@ public final class TranscriptOptionalParams implements ITranscriptOptionalParams private final Optional disfluencies; + private final Optional multichannel; + private final Optional dualChannel; private final Optional webhookUrl; @@ -105,6 +107,7 @@ private TranscriptOptionalParams( Optional punctuate, Optional formatText, Optional disfluencies, + Optional multichannel, Optional dualChannel, Optional webhookUrl, Optional webhookAuthHeaderName, @@ -143,6 +146,7 @@ private TranscriptOptionalParams( this.punctuate = punctuate; this.formatText = formatText; this.disfluencies = disfluencies; + this.multichannel = multichannel; this.dualChannel = dualChannel; this.webhookUrl = webhookUrl; this.webhookAuthHeaderName = webhookAuthHeaderName; @@ -235,6 +239,15 @@ public Optional getDisfluencies() { return disfluencies; } + /** + * @return Enable Multichannel transcription, can be true or false. + */ + @JsonProperty("multichannel") + @java.lang.Override + public Optional getMultichannel() { + return multichannel; + } + /** * @return Enable Dual Channel transcription, can be true or false. */ @@ -524,6 +537,7 @@ private boolean equalTo(TranscriptOptionalParams other) { && punctuate.equals(other.punctuate) && formatText.equals(other.formatText) && disfluencies.equals(other.disfluencies) + && multichannel.equals(other.multichannel) && dualChannel.equals(other.dualChannel) && webhookUrl.equals(other.webhookUrl) && webhookAuthHeaderName.equals(other.webhookAuthHeaderName) @@ -566,6 +580,7 @@ public int hashCode() { this.punctuate, this.formatText, this.disfluencies, + this.multichannel, this.dualChannel, this.webhookUrl, this.webhookAuthHeaderName, @@ -623,6 +638,8 @@ public static final class Builder { private Optional disfluencies = Optional.empty(); + private Optional multichannel = Optional.empty(); + private Optional dualChannel = Optional.empty(); private Optional webhookUrl = Optional.empty(); @@ -696,6 +713,7 @@ public Builder from(TranscriptOptionalParams other) { punctuate(other.getPunctuate()); formatText(other.getFormatText()); disfluencies(other.getDisfluencies()); + multichannel(other.getMultichannel()); dualChannel(other.getDualChannel()); webhookUrl(other.getWebhookUrl()); webhookAuthHeaderName(other.getWebhookAuthHeaderName()); @@ -806,6 +824,17 @@ public Builder disfluencies(Boolean disfluencies) { return this; } + @JsonSetter(value = "multichannel", nulls = Nulls.SKIP) + public Builder multichannel(Optional multichannel) { + this.multichannel = multichannel; + return this; + } + + public Builder multichannel(Boolean multichannel) { + this.multichannel = Optional.ofNullable(multichannel); + return this; + } + @JsonSetter(value = "dual_channel", nulls = Nulls.SKIP) public Builder dualChannel(Optional dualChannel) { this.dualChannel = dualChannel; @@ -1145,6 +1174,7 @@ public TranscriptOptionalParams build() { punctuate, formatText, disfluencies, + multichannel, dualChannel, webhookUrl, webhookAuthHeaderName, diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptParagraph.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptParagraph.java index 4e32ce73..00d50dd8 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptParagraph.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptParagraph.java @@ -17,8 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptParagraph.Builder.class) @@ -33,8 +31,6 @@ public final class TranscriptParagraph { private final List words; - private final Optional speaker; - private final Map additionalProperties; private TranscriptParagraph( @@ -43,50 +39,55 @@ private TranscriptParagraph( int end, double confidence, List words, - Optional speaker, Map additionalProperties) { this.text = text; this.start = start; this.end = end; this.confidence = confidence; this.words = words; - this.speaker = speaker; this.additionalProperties = additionalProperties; } + /** + * @return The transcript of the paragraph + */ @JsonProperty("text") public String getText() { return text; } + /** + * @return The starting time, in milliseconds, of the paragraph + */ @JsonProperty("start") public int getStart() { return start; } + /** + * @return The ending time, in milliseconds, of the paragraph + */ @JsonProperty("end") public int getEnd() { return end; } + /** + * @return The confidence score for the transcript of this paragraph + */ @JsonProperty("confidence") public double getConfidence() { return confidence; } + /** + * @return An array of words in the paragraph + */ @JsonProperty("words") public List getWords() { return words; } - /** - * @return The speaker of the sentence if Speaker Diarization is enabled, else null - */ - @JsonProperty("speaker") - public Optional getSpeaker() { - return speaker; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -103,13 +104,12 @@ private boolean equalTo(TranscriptParagraph other) { && start == other.start && end == other.end && confidence == other.confidence - && words.equals(other.words) - && speaker.equals(other.speaker); + && words.equals(other.words); } @java.lang.Override public int hashCode() { - return Objects.hash(this.text, this.start, this.end, this.confidence, this.words, this.speaker); + return Objects.hash(this.text, this.start, this.end, this.confidence, this.words); } @java.lang.Override @@ -122,7 +122,7 @@ public static TextStage builder() { } public interface TextStage { - StartStage text(@NotNull String text); + StartStage text(String text); Builder from(TranscriptParagraph other); } @@ -147,10 +147,6 @@ public interface _FinalStage { _FinalStage addWords(TranscriptWord words); _FinalStage addAllWords(List words); - - _FinalStage speaker(Optional speaker); - - _FinalStage speaker(String speaker); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -163,8 +159,6 @@ public static final class Builder implements TextStage, StartStage, EndStage, Co private double confidence; - private Optional speaker = Optional.empty(); - private List words = new ArrayList<>(); @JsonAnySetter @@ -179,17 +173,24 @@ public Builder from(TranscriptParagraph other) { end(other.getEnd()); confidence(other.getConfidence()); words(other.getWords()); - speaker(other.getSpeaker()); return this; } + /** + *

The transcript of the paragraph

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("text") - public StartStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public StartStage text(String text) { + this.text = text; return this; } + /** + *

The starting time, in milliseconds, of the paragraph

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("start") public EndStage start(int start) { @@ -197,6 +198,10 @@ public EndStage start(int start) { return this; } + /** + *

The ending time, in milliseconds, of the paragraph

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("end") public ConfidenceStage end(int end) { @@ -204,6 +209,10 @@ public ConfidenceStage end(int end) { return this; } + /** + *

The confidence score for the transcript of this paragraph

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("confidence") public _FinalStage confidence(double confidence) { @@ -212,28 +221,19 @@ public _FinalStage confidence(double confidence) { } /** - *

The speaker of the sentence if Speaker Diarization is enabled, else null

+ *

An array of words in the paragraph

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage speaker(String speaker) { - this.speaker = Optional.ofNullable(speaker); - return this; - } - - @java.lang.Override - @JsonSetter(value = "speaker", nulls = Nulls.SKIP) - public _FinalStage speaker(Optional speaker) { - this.speaker = speaker; - return this; - } - @java.lang.Override public _FinalStage addAllWords(List words) { this.words.addAll(words); return this; } + /** + *

An array of words in the paragraph

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addWords(TranscriptWord words) { this.words.add(words); @@ -250,7 +250,7 @@ public _FinalStage words(List words) { @java.lang.Override public TranscriptParagraph build() { - return new TranscriptParagraph(text, start, end, confidence, words, speaker, additionalProperties); + return new TranscriptParagraph(text, start, end, confidence, words, additionalProperties); } } } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptReadyNotification.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptReadyNotification.java index 772c8d07..dc87ec8f 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptReadyNotification.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptReadyNotification.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptReadyNotification.Builder.class) @@ -78,13 +77,13 @@ public static TranscriptIdStage builder() { } public interface TranscriptIdStage { - StatusStage transcriptId(@NotNull String transcriptId); + StatusStage transcriptId(String transcriptId); Builder from(TranscriptReadyNotification other); } public interface StatusStage { - _FinalStage status(@NotNull TranscriptReadyStatus status); + _FinalStage status(TranscriptReadyStatus status); } public interface _FinalStage { @@ -115,8 +114,8 @@ public Builder from(TranscriptReadyNotification other) { */ @java.lang.Override @JsonSetter("transcript_id") - public StatusStage transcriptId(@NotNull String transcriptId) { - this.transcriptId = Objects.requireNonNull(transcriptId, "transcriptId must not be null"); + public StatusStage transcriptId(String transcriptId) { + this.transcriptId = transcriptId; return this; } @@ -126,8 +125,8 @@ public StatusStage transcriptId(@NotNull String transcriptId) { */ @java.lang.Override @JsonSetter("status") - public _FinalStage status(@NotNull TranscriptReadyStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + public _FinalStage status(TranscriptReadyStatus status) { + this.status = status; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptSentence.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptSentence.java index b9fca84c..1dc110de 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptSentence.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptSentence.java @@ -18,7 +18,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptSentence.Builder.class) @@ -33,6 +32,8 @@ public final class TranscriptSentence { private final List words; + private final Optional channel; + private final Optional speaker; private final Map additionalProperties; @@ -43,6 +44,7 @@ private TranscriptSentence( int end, double confidence, List words, + Optional channel, Optional speaker, Map additionalProperties) { this.text = text; @@ -50,35 +52,59 @@ private TranscriptSentence( this.end = end; this.confidence = confidence; this.words = words; + this.channel = channel; this.speaker = speaker; this.additionalProperties = additionalProperties; } + /** + * @return The transcript of the sentence + */ @JsonProperty("text") public String getText() { return text; } + /** + * @return The starting time, in milliseconds, for the sentence + */ @JsonProperty("start") public int getStart() { return start; } + /** + * @return The ending time, in milliseconds, for the sentence + */ @JsonProperty("end") public int getEnd() { return end; } + /** + * @return The confidence score for the transcript of this sentence + */ @JsonProperty("confidence") public double getConfidence() { return confidence; } + /** + * @return An array of words in the sentence + */ @JsonProperty("words") public List getWords() { return words; } + /** + * @return The channel of the sentence. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + /** * @return The speaker of the sentence if Speaker Diarization is enabled, else null */ @@ -104,12 +130,13 @@ private boolean equalTo(TranscriptSentence other) { && end == other.end && confidence == other.confidence && words.equals(other.words) + && channel.equals(other.channel) && speaker.equals(other.speaker); } @java.lang.Override public int hashCode() { - return Objects.hash(this.text, this.start, this.end, this.confidence, this.words, this.speaker); + return Objects.hash(this.text, this.start, this.end, this.confidence, this.words, this.channel, this.speaker); } @java.lang.Override @@ -122,7 +149,7 @@ public static TextStage builder() { } public interface TextStage { - StartStage text(@NotNull String text); + StartStage text(String text); Builder from(TranscriptSentence other); } @@ -148,6 +175,10 @@ public interface _FinalStage { _FinalStage addAllWords(List words); + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + _FinalStage speaker(Optional speaker); _FinalStage speaker(String speaker); @@ -165,6 +196,8 @@ public static final class Builder implements TextStage, StartStage, EndStage, Co private Optional speaker = Optional.empty(); + private Optional channel = Optional.empty(); + private List words = new ArrayList<>(); @JsonAnySetter @@ -179,17 +212,26 @@ public Builder from(TranscriptSentence other) { end(other.getEnd()); confidence(other.getConfidence()); words(other.getWords()); + channel(other.getChannel()); speaker(other.getSpeaker()); return this; } + /** + *

The transcript of the sentence

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("text") - public StartStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public StartStage text(String text) { + this.text = text; return this; } + /** + *

The starting time, in milliseconds, for the sentence

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("start") public EndStage start(int start) { @@ -197,6 +239,10 @@ public EndStage start(int start) { return this; } + /** + *

The ending time, in milliseconds, for the sentence

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("end") public ConfidenceStage end(int end) { @@ -204,6 +250,10 @@ public ConfidenceStage end(int end) { return this; } + /** + *

The confidence score for the transcript of this sentence

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("confidence") public _FinalStage confidence(double confidence) { @@ -228,12 +278,37 @@ public _FinalStage speaker(Optional speaker) { return this; } + /** + *

The channel of the sentence. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + /** + *

An array of words in the sentence

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addAllWords(List words) { this.words.addAll(words); return this; } + /** + *

An array of words in the sentence

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage addWords(TranscriptWord words) { this.words.add(words); @@ -250,7 +325,7 @@ public _FinalStage words(List words) { @java.lang.Override public TranscriptSentence build() { - return new TranscriptSentence(text, start, end, confidence, words, speaker, additionalProperties); + return new TranscriptSentence(text, start, end, confidence, words, channel, speaker, additionalProperties); } } } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptUtterance.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptUtterance.java index fe1153a9..585de323 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptUtterance.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptUtterance.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptUtterance.Builder.class) @@ -32,6 +32,8 @@ public final class TranscriptUtterance { private final List words; + private final Optional channel; + private final String speaker; private final Map additionalProperties; @@ -42,6 +44,7 @@ private TranscriptUtterance( int end, String text, List words, + Optional channel, String speaker, Map additionalProperties) { this.confidence = confidence; @@ -49,6 +52,7 @@ private TranscriptUtterance( this.end = end; this.text = text; this.words = words; + this.channel = channel; this.speaker = speaker; this.additionalProperties = additionalProperties; } @@ -93,6 +97,14 @@ public List getWords() { return words; } + /** + * @return The channel of this utterance. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + /** * @return The speaker of this utterance, where each speaker is assigned a sequential capital letter - e.g. "A" for Speaker A, "B" for Speaker B, etc. */ @@ -118,12 +130,13 @@ private boolean equalTo(TranscriptUtterance other) { && end == other.end && text.equals(other.text) && words.equals(other.words) + && channel.equals(other.channel) && speaker.equals(other.speaker); } @java.lang.Override public int hashCode() { - return Objects.hash(this.confidence, this.start, this.end, this.text, this.words, this.speaker); + return Objects.hash(this.confidence, this.start, this.end, this.text, this.words, this.channel, this.speaker); } @java.lang.Override @@ -150,11 +163,11 @@ public interface EndStage { } public interface TextStage { - SpeakerStage text(@NotNull String text); + SpeakerStage text(String text); } public interface SpeakerStage { - _FinalStage speaker(@NotNull String speaker); + _FinalStage speaker(String speaker); } public interface _FinalStage { @@ -165,6 +178,10 @@ public interface _FinalStage { _FinalStage addWords(TranscriptWord words); _FinalStage addAllWords(List words); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -180,6 +197,8 @@ public static final class Builder private String speaker; + private Optional channel = Optional.empty(); + private List words = new ArrayList<>(); @JsonAnySetter @@ -194,6 +213,7 @@ public Builder from(TranscriptUtterance other) { end(other.getEnd()); text(other.getText()); words(other.getWords()); + channel(other.getChannel()); speaker(other.getSpeaker()); return this; } @@ -237,8 +257,8 @@ public TextStage end(int end) { */ @java.lang.Override @JsonSetter("text") - public SpeakerStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public SpeakerStage text(String text) { + this.text = text; return this; } @@ -248,8 +268,25 @@ public SpeakerStage text(@NotNull String text) { */ @java.lang.Override @JsonSetter("speaker") - public _FinalStage speaker(@NotNull String speaker) { - this.speaker = Objects.requireNonNull(speaker, "speaker must not be null"); + public _FinalStage speaker(String speaker) { + this.speaker = speaker; + return this; + } + + /** + *

The channel of this utterance. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; return this; } @@ -283,7 +320,7 @@ public _FinalStage words(List words) { @java.lang.Override public TranscriptUtterance build() { - return new TranscriptUtterance(confidence, start, end, text, words, speaker, additionalProperties); + return new TranscriptUtterance(confidence, start, end, text, words, channel, speaker, additionalProperties); } } } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptWord.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptWord.java index 33796ddc..1a5c0eaa 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptWord.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/TranscriptWord.java @@ -16,7 +16,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TranscriptWord.Builder.class) @@ -29,6 +28,8 @@ public final class TranscriptWord { private final String text; + private final Optional channel; + private final Optional speaker; private final Map additionalProperties; @@ -38,38 +39,60 @@ private TranscriptWord( int start, int end, String text, + Optional channel, Optional speaker, Map additionalProperties) { this.confidence = confidence; this.start = start; this.end = end; this.text = text; + this.channel = channel; this.speaker = speaker; this.additionalProperties = additionalProperties; } + /** + * @return The confidence score for the transcript of this word + */ @JsonProperty("confidence") public double getConfidence() { return confidence; } + /** + * @return The starting time, in milliseconds, for the word + */ @JsonProperty("start") public int getStart() { return start; } + /** + * @return The ending time, in milliseconds, for the word + */ @JsonProperty("end") public int getEnd() { return end; } + /** + * @return The text of the word + */ @JsonProperty("text") public String getText() { return text; } /** - * @return The speaker of the sentence if Speaker Diarization is enabled, else null + * @return The channel of the word. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + /** + * @return The speaker of the word if Speaker Diarization is enabled, else null */ @JsonProperty("speaker") public Optional getSpeaker() { @@ -92,12 +115,13 @@ private boolean equalTo(TranscriptWord other) { && start == other.start && end == other.end && text.equals(other.text) + && channel.equals(other.channel) && speaker.equals(other.speaker); } @java.lang.Override public int hashCode() { - return Objects.hash(this.confidence, this.start, this.end, this.text, this.speaker); + return Objects.hash(this.confidence, this.start, this.end, this.text, this.channel, this.speaker); } @java.lang.Override @@ -124,12 +148,16 @@ public interface EndStage { } public interface TextStage { - _FinalStage text(@NotNull String text); + _FinalStage text(String text); } public interface _FinalStage { TranscriptWord build(); + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + _FinalStage speaker(Optional speaker); _FinalStage speaker(String speaker); @@ -147,6 +175,8 @@ public static final class Builder implements ConfidenceStage, StartStage, EndSta private Optional speaker = Optional.empty(); + private Optional channel = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -158,10 +188,15 @@ public Builder from(TranscriptWord other) { start(other.getStart()); end(other.getEnd()); text(other.getText()); + channel(other.getChannel()); speaker(other.getSpeaker()); return this; } + /** + *

The confidence score for the transcript of this word

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("confidence") public StartStage confidence(double confidence) { @@ -169,6 +204,10 @@ public StartStage confidence(double confidence) { return this; } + /** + *

The starting time, in milliseconds, for the word

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("start") public EndStage start(int start) { @@ -176,6 +215,10 @@ public EndStage start(int start) { return this; } + /** + *

The ending time, in milliseconds, for the word

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("end") public TextStage end(int end) { @@ -183,15 +226,19 @@ public TextStage end(int end) { return this; } + /** + *

The text of the word

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("text") - public _FinalStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public _FinalStage text(String text) { + this.text = text; return this; } /** - *

The speaker of the sentence if Speaker Diarization is enabled, else null

+ *

The speaker of the word if Speaker Diarization is enabled, else null

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -207,9 +254,26 @@ public _FinalStage speaker(Optional speaker) { return this; } + /** + *

The channel of the word. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + @java.lang.Override public TranscriptWord build() { - return new TranscriptWord(confidence, start, end, text, speaker, additionalProperties); + return new TranscriptWord(confidence, start, end, text, channel, speaker, additionalProperties); } } } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchMatch.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchMatch.java index c6146fae..d158dfce 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchMatch.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchMatch.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WordSearchMatch.Builder.class) @@ -110,7 +109,7 @@ public static TextStage builder() { } public interface TextStage { - CountStage text(@NotNull String text); + CountStage text(String text); Builder from(WordSearchMatch other); } @@ -165,8 +164,8 @@ public Builder from(WordSearchMatch other) { */ @java.lang.Override @JsonSetter("text") - public CountStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + public CountStage text(String text) { + this.text = text; return this; } diff --git a/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchResponse.java b/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchResponse.java index a5cbb640..208692ba 100644 --- a/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchResponse.java +++ b/src/main/java/com/assemblyai/api/resources/transcripts/types/WordSearchResponse.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WordSearchResponse.Builder.class) @@ -92,7 +91,7 @@ public static IdStage builder() { } public interface IdStage { - TotalCountStage id(@NotNull String id); + TotalCountStage id(String id); Builder from(WordSearchResponse other); } @@ -138,8 +137,8 @@ public Builder from(WordSearchResponse other) { */ @java.lang.Override @JsonSetter("id") - public TotalCountStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); + public TotalCountStage id(String id) { + this.id = id; return this; } diff --git a/src/main/java/com/assemblyai/api/types/Error.java b/src/main/java/com/assemblyai/api/types/Error.java index 8cab22ed..626e8a08 100644 --- a/src/main/java/com/assemblyai/api/types/Error.java +++ b/src/main/java/com/assemblyai/api/types/Error.java @@ -16,7 +16,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Error.Builder.class) @@ -76,7 +75,7 @@ public static ErrorStage builder() { } public interface ErrorStage { - _FinalStage error(@NotNull String error); + _FinalStage error(String error); Builder from(Error other); } @@ -113,8 +112,8 @@ public Builder from(Error other) { */ @java.lang.Override @JsonSetter("error") - public _FinalStage error(@NotNull String error) { - this.error = Objects.requireNonNull(error, "error must not be null"); + public _FinalStage error(String error) { + this.error = error; return this; }