Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Nov 6, 2024
1 parent cefda91 commit 548a50f
Show file tree
Hide file tree
Showing 53 changed files with 793 additions and 482 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -47,7 +47,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.assemblyai'
artifactId = 'assemblyai-java'
version = '3.0.0'
version = '3.1.0'
from components.java
pom {
scm {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
60 changes: 0 additions & 60 deletions src/main/java/com/assemblyai/api/core/FileStream.java

This file was deleted.

79 changes: 0 additions & 79 deletions src/main/java/com/assemblyai/api/core/InputStreamRequestBody.java

This file was deleted.

25 changes: 4 additions & 21 deletions src/main/java/com/assemblyai/api/resources/files/FilesClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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()) {
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -66,7 +65,7 @@ public static UploadUrlStage builder() {
}

public interface UploadUrlStage {
_FinalStage uploadUrl(@NotNull String uploadUrl);
_FinalStage uploadUrl(String uploadUrl);

Builder from(UploadedFile other);
}
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -169,7 +168,7 @@ public static PromptStage builder() {
}

public interface PromptStage {
_FinalStage prompt(@NotNull String prompt);
_FinalStage prompt(String prompt);

Builder from(LemurTaskParams other);
}
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down
Loading

0 comments on commit 548a50f

Please sign in to comment.