Skip to content

Commit

Permalink
Merge pull request #110 from AssemblyAI/fern-bot/06-27-2024-0119PM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- June 27, 2024
  • Loading branch information
Swimburger committed Jun 27, 2024
2 parents d3597fa + 9b13cc1 commit 41b0851
Show file tree
Hide file tree
Showing 9 changed files with 314 additions and 147 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.assemblyai'
artifactId = 'assemblyai-java'
version = '1.2.1'
version = '2.0.0'
from components.java
pom {
scm {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.assemblyai.api.resources.lemur.types;

public interface ILemurStringResponse extends ILemurBaseResponse {
String getResponse();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,32 @@

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonDeserialize(builder = LemurActionItemsResponse.Builder.class)
public final class LemurActionItemsResponse implements ILemurBaseResponse {
public final class LemurActionItemsResponse implements ILemurStringResponse {
private final String response;

private final String requestId;

private final LemurUsage usage;

private final String response;

private final Map<String, Object> additionalProperties;

private LemurActionItemsResponse(
String requestId, LemurUsage usage, String response, Map<String, Object> additionalProperties) {
String response, String requestId, LemurUsage usage, Map<String, Object> additionalProperties) {
this.response = response;
this.requestId = requestId;
this.usage = usage;
this.response = response;
this.additionalProperties = additionalProperties;
}

/**
* @return The response generated by LeMUR.
*/
@JsonProperty("response")
@java.lang.Override
public String getResponse() {
return response;
}

/**
* @return The ID of the LeMUR request
*/
Expand All @@ -52,14 +61,6 @@ public LemurUsage getUsage() {
return usage;
}

/**
* @return The response generated by LeMUR
*/
@JsonProperty("response")
public String getResponse() {
return response;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -72,98 +73,98 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(LemurActionItemsResponse other) {
return requestId.equals(other.requestId) && usage.equals(other.usage) && response.equals(other.response);
return response.equals(other.response) && requestId.equals(other.requestId) && usage.equals(other.usage);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.requestId, this.usage, this.response);
return Objects.hash(this.response, this.requestId, this.usage);
}

@java.lang.Override
public String toString() {
return ObjectMappers.stringify(this);
}

public static RequestIdStage builder() {
public static ResponseStage builder() {
return new Builder();
}

public interface RequestIdStage {
UsageStage requestId(String requestId);
public interface ResponseStage {
RequestIdStage response(String response);

Builder from(LemurActionItemsResponse other);
}

public interface UsageStage {
ResponseStage usage(LemurUsage usage);
public interface RequestIdStage {
UsageStage requestId(String requestId);
}

public interface ResponseStage {
_FinalStage response(String response);
public interface UsageStage {
_FinalStage usage(LemurUsage usage);
}

public interface _FinalStage {
LemurActionItemsResponse build();
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements RequestIdStage, UsageStage, ResponseStage, _FinalStage {
public static final class Builder implements ResponseStage, RequestIdStage, UsageStage, _FinalStage {
private String response;

private String requestId;

private LemurUsage usage;

private String response;

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

private Builder() {}

@java.lang.Override
public Builder from(LemurActionItemsResponse other) {
response(other.getResponse());
requestId(other.getRequestId());
usage(other.getUsage());
response(other.getResponse());
return this;
}

/**
* <p>The ID of the LeMUR request</p>
* <p>The response generated by LeMUR.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("request_id")
public UsageStage requestId(String requestId) {
this.requestId = requestId;
@JsonSetter("response")
public RequestIdStage response(String response) {
this.response = response;
return this;
}

/**
* <p>The usage numbers for the LeMUR request</p>
* <p>The ID of the LeMUR request</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("usage")
public ResponseStage usage(LemurUsage usage) {
this.usage = usage;
@JsonSetter("request_id")
public UsageStage requestId(String requestId) {
this.requestId = requestId;
return this;
}

/**
* <p>The response generated by LeMUR</p>
* <p>The usage numbers for the LeMUR request</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("response")
public _FinalStage response(String response) {
this.response = response;
@JsonSetter("usage")
public _FinalStage usage(LemurUsage usage) {
this.usage = usage;
return this;
}

@java.lang.Override
public LemurActionItemsResponse build() {
return new LemurActionItemsResponse(requestId, usage, response, additionalProperties);
return new LemurActionItemsResponse(response, requestId, usage, additionalProperties);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ public Object get() {

public <T> T visit(Visitor<T> visitor) {
if (this.type == 0) {
return visitor.visit((LemurTaskResponse) this.value);
return visitor.visit((LemurStringResponse) this.value);
} else if (this.type == 1) {
return visitor.visit((LemurSummaryResponse) this.value);
} else if (this.type == 2) {
return visitor.visit((LemurQuestionAnswerResponse) this.value);
} else if (this.type == 3) {
return visitor.visit((LemurActionItemsResponse) this.value);
}
throw new IllegalStateException("Failed to visit value. This should never happen.");
}
Expand All @@ -62,30 +58,18 @@ public String toString() {
return this.value.toString();
}

public static LemurResponse of(LemurTaskResponse value) {
public static LemurResponse of(LemurStringResponse value) {
return new LemurResponse(value, 0);
}

public static LemurResponse of(LemurSummaryResponse value) {
return new LemurResponse(value, 1);
}

public static LemurResponse of(LemurQuestionAnswerResponse value) {
return new LemurResponse(value, 2);
}

public static LemurResponse of(LemurActionItemsResponse value) {
return new LemurResponse(value, 3);
return new LemurResponse(value, 1);
}

public interface Visitor<T> {
T visit(LemurTaskResponse value);

T visit(LemurSummaryResponse value);
T visit(LemurStringResponse value);

T visit(LemurQuestionAnswerResponse value);

T visit(LemurActionItemsResponse value);
}

static final class Deserializer extends StdDeserializer<LemurResponse> {
Expand All @@ -97,21 +81,13 @@ static final class Deserializer extends StdDeserializer<LemurResponse> {
public LemurResponse deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
Object value = p.readValueAs(Object.class);
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, LemurTaskResponse.class));
} catch (IllegalArgumentException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, LemurSummaryResponse.class));
return of(ObjectMappers.JSON_MAPPER.convertValue(value, LemurStringResponse.class));
} catch (IllegalArgumentException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, LemurQuestionAnswerResponse.class));
} catch (IllegalArgumentException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, LemurActionItemsResponse.class));
} catch (IllegalArgumentException e) {
}
throw new JsonParseException(p, "Failed to deserialize");
}
}
Expand Down
Loading

0 comments on commit 41b0851

Please sign in to comment.