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 Apr 1, 2024
1 parent 0910c58 commit 545b733
Show file tree
Hide file tree
Showing 12 changed files with 211 additions and 48 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.0.9'
version = '1.0.10'
from components.java
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public RealtimeClient(ClientOptions clientOptions) {
}

/**
* Create a temporary authentication token for real-time transcription
* Create a temporary authentication token for Streaming Speech-to-Text
*/
public RealtimeTemporaryTokenResponse createTemporaryToken(CreateRealtimeTemporaryTokenParams request) {
return createTemporaryToken(request, null);
}

/**
* Create a temporary authentication token for real-time transcription
* Create a temporary authentication token for Streaming Speech-to-Text
*/
public RealtimeTemporaryTokenResponse createTemporaryToken(
CreateRealtimeTemporaryTokenParams request, RequestOptions requestOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private RealtimeTemporaryTokenResponse(String token, Map<String, Object> additio
}

/**
* @return The temporary authentication token for real-time transcription
* @return The temporary authentication token for Streaming Speech-to-Text
*/
@JsonProperty("token")
public String getToken() {
Expand Down Expand Up @@ -90,7 +90,7 @@ public Builder from(RealtimeTemporaryTokenResponse other) {
}

/**
* <p>The temporary authentication token for real-time transcription</p>
* <p>The temporary authentication token for Streaming Speech-to-Text</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private TerminateSession(boolean terminateSession, Map<String, Object> additiona
}

/**
* @return Set to true to end your real-time session forever
* @return Set to true to end your streaming session forever
*/
@JsonProperty("terminate_session")
public boolean getTerminateSession() {
Expand Down Expand Up @@ -90,7 +90,7 @@ public Builder from(TerminateSession other) {
}

/**
* <p>Set to true to end your real-time session forever</p>
* <p>Set to true to end your streaming session forever</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.assemblyai.api.resources.realtime.types;
package com.assemblyai.api.resources.streaming.types;

import com.assemblyai.api.core.ObjectMappers;
import com.assemblyai.api.resources.realtime.types.FinalTranscript;
import com.assemblyai.api.resources.realtime.types.PartialTranscript;
import com.assemblyai.api.resources.realtime.types.RealtimeError;
import com.assemblyai.api.resources.realtime.types.SessionBegins;
import com.assemblyai.api.resources.realtime.types.SessionTerminated;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.assemblyai.api.resources.realtime.types;
package com.assemblyai.api.resources.streaming.types;

import com.assemblyai.api.core.ObjectMappers;
import com.assemblyai.api.resources.realtime.types.ConfigureEndUtteranceSilenceThreshold;
import com.assemblyai.api.resources.realtime.types.ForceEndUtterance;
import com.assemblyai.api.resources.realtime.types.TerminateSession;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.assemblyai.api.resources.streaming.types;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public final class Streaming {
public static final Streaming PCM_S16LE = new Streaming(Value.PCM_S16LE, "pcm_s16le");

public static final Streaming PCM_MULAW = new Streaming(Value.PCM_MULAW, "pcm_mulaw");

private final Value value;

private final String string;

Streaming(Value value, String string) {
this.value = value;
this.string = string;
}

public Value getEnumValue() {
return value;
}

@java.lang.Override
@JsonValue
public String toString() {
return this.string;
}

@java.lang.Override
public boolean equals(Object other) {
return (this == other) || (other instanceof Streaming && this.string.equals(((Streaming) other).string));
}

@java.lang.Override
public int hashCode() {
return this.string.hashCode();
}

public <T> T visit(Visitor<T> visitor) {
switch (value) {
case PCM_S16LE:
return visitor.visitPcmS16le();
case PCM_MULAW:
return visitor.visitPcmMulaw();
case UNKNOWN:
default:
return visitor.visitUnknown(string);
}
}

@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static Streaming valueOf(String value) {
switch (value) {
case "pcm_s16le":
return PCM_S16LE;
case "pcm_mulaw":
return PCM_MULAW;
default:
return new Streaming(Value.UNKNOWN, value);
}
}

public enum Value {
PCM_S16LE,

PCM_MULAW,

UNKNOWN
}

public interface Visitor<T> {
T visitPcmS16le();

T visitPcmMulaw();

T visitUnknown(String unknownType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@ public TranscriptsClient(ClientOptions clientOptions) {
}

/**
* Retrieve a list of transcripts you created
* Retrieve a list of transcripts you created.
* Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
*/
public TranscriptList list() {
return list(ListTranscriptParams.builder().build());
}

/**
* Retrieve a list of transcripts you created
* Retrieve a list of transcripts you created.
* Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
*/
public TranscriptList list(ListTranscriptParams request) {
return list(request, null);
}

/**
* Retrieve a list of transcripts you created
* Retrieve a list of transcripts you created.
* Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
*/
public TranscriptList list(ListTranscriptParams request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class PageDetails {

private final String currentUrl;

private final String prevUrl;
private final Optional<String> prevUrl;

private final Optional<String> nextUrl;

Expand All @@ -36,7 +36,7 @@ private PageDetails(
int limit,
int resultCount,
String currentUrl,
String prevUrl,
Optional<String> prevUrl,
Optional<String> nextUrl,
Map<String, Object> additionalProperties) {
this.limit = limit;
Expand All @@ -62,11 +62,17 @@ public String getCurrentUrl() {
return currentUrl;
}

/**
* @return The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
*/
@JsonProperty("prev_url")
public String getPrevUrl() {
public Optional<String> getPrevUrl() {
return prevUrl;
}

/**
* @return The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
*/
@JsonProperty("next_url")
public Optional<String> getNextUrl() {
return nextUrl;
Expand Down Expand Up @@ -116,34 +122,33 @@ public interface ResultCountStage {
}

public interface CurrentUrlStage {
PrevUrlStage currentUrl(String currentUrl);
}

public interface PrevUrlStage {
_FinalStage prevUrl(String prevUrl);
_FinalStage currentUrl(String currentUrl);
}

public interface _FinalStage {
PageDetails build();

_FinalStage prevUrl(Optional<String> prevUrl);

_FinalStage prevUrl(String prevUrl);

_FinalStage nextUrl(Optional<String> nextUrl);

_FinalStage nextUrl(String nextUrl);
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder
implements LimitStage, ResultCountStage, CurrentUrlStage, PrevUrlStage, _FinalStage {
public static final class Builder implements LimitStage, ResultCountStage, CurrentUrlStage, _FinalStage {
private int limit;

private int resultCount;

private String currentUrl;

private String prevUrl;

private Optional<String> nextUrl = Optional.empty();

private Optional<String> prevUrl = Optional.empty();

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

Expand Down Expand Up @@ -175,18 +180,15 @@ public CurrentUrlStage resultCount(int resultCount) {

@java.lang.Override
@JsonSetter("current_url")
public PrevUrlStage currentUrl(String currentUrl) {
public _FinalStage currentUrl(String currentUrl) {
this.currentUrl = currentUrl;
return this;
}

@java.lang.Override
@JsonSetter("prev_url")
public _FinalStage prevUrl(String prevUrl) {
this.prevUrl = prevUrl;
return this;
}

/**
* <p>The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage nextUrl(String nextUrl) {
this.nextUrl = Optional.of(nextUrl);
Expand All @@ -200,6 +202,23 @@ public _FinalStage nextUrl(Optional<String> nextUrl) {
return this;
}

/**
* <p>The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage prevUrl(String prevUrl) {
this.prevUrl = Optional.of(prevUrl);
return this;
}

@java.lang.Override
@JsonSetter(value = "prev_url", nulls = Nulls.SKIP)
public _FinalStage prevUrl(Optional<String> prevUrl) {
this.prevUrl = prevUrl;
return this;
}

@java.lang.Override
public PageDetails build() {
return new PageDetails(limit, resultCount, currentUrl, prevUrl, nextUrl, additionalProperties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import com.fasterxml.jackson.annotation.JsonValue;

public final class SpeechModel {
public static final SpeechModel CONFORMER2 = new SpeechModel(Value.CONFORMER2, "conformer-2");

public static final SpeechModel NANO = new SpeechModel(Value.NANO, "nano");

public static final SpeechModel BEST = new SpeechModel(Value.BEST, "best");

public static final SpeechModel CONFORMER2 = new SpeechModel(Value.CONFORMER2, "conformer-2");

private final Value value;

private final String string;
Expand Down Expand Up @@ -42,10 +44,12 @@ public int hashCode() {

public <T> T visit(Visitor<T> visitor) {
switch (value) {
case CONFORMER2:
return visitor.visitConformer2();
case NANO:
return visitor.visitNano();
case BEST:
return visitor.visitBest();
case CONFORMER2:
return visitor.visitConformer2();
case UNKNOWN:
default:
return visitor.visitUnknown(string);
Expand All @@ -55,16 +59,20 @@ public <T> T visit(Visitor<T> visitor) {
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static SpeechModel valueOf(String value) {
switch (value) {
case "conformer-2":
return CONFORMER2;
case "nano":
return NANO;
case "best":
return BEST;
case "conformer-2":
return CONFORMER2;
default:
return new SpeechModel(Value.UNKNOWN, value);
}
}

public enum Value {
BEST,

NANO,

CONFORMER2,
Expand All @@ -73,6 +81,8 @@ public enum Value {
}

public interface Visitor<T> {
T visitBest();

T visitNano();

T visitConformer2();
Expand Down
Loading

0 comments on commit 545b733

Please sign in to comment.