diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fbf392..552eeb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - name: Publish to maven run: | - ./gradlew publish + ./gradlew publish env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} diff --git a/build.gradle b/build.gradle index 9d7537c..33aed2e 100644 --- a/build.gradle +++ b/build.gradle @@ -24,31 +24,62 @@ dependencies { sourceCompatibility = 1.8 targetCompatibility = 1.8 +tasks.withType(Javadoc) { + failOnError false + options.addStringOption('Xdoclint:none', '-quiet') +} + spotless { java { palantirJavaFormat() } } + java { withSourcesJar() withJavadocJar() } + +group = 'dev.vapi' + +version = '0.2.0' + +jar { + dependsOn(":generatePomFileForMavenPublication") + archiveBaseName = "server-sdk" +} + +sourcesJar { + archiveBaseName = "server-sdk" +} + +javadocJar { + archiveBaseName = "server-sdk" +} + test { useJUnitPlatform() testLogging { showStandardStreams = true } } + publishing { publications { maven(MavenPublication) { groupId = 'dev.vapi' artifactId = 'server-sdk' - version = '0.1.0' + version = '0.2.0' from components.java pom { + licenses { + license { + name = 'The MIT License (MIT)' + url = 'https://mit-license.org/' + } + } scm { connection = 'scm:git:git://github.com/VapiAI/server-sdk-java.git' developerConnection = 'scm:git:git://github.com/VapiAI/server-sdk-java.git' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0aaefbc..e2847c8 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.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index aed36fe..2db0426 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ +rootProject.name = 'server-sdk' + include 'sample-app' \ No newline at end of file diff --git a/src/main/java/com/vapi/api/Vapi.java b/src/main/java/com/vapi/api/Vapi.java index bf4b19d..1b9d6c5 100644 --- a/src/main/java/com/vapi/api/Vapi.java +++ b/src/main/java/com/vapi/api/Vapi.java @@ -10,6 +10,7 @@ import com.vapi.api.resources.blocks.BlocksClient; import com.vapi.api.resources.calls.CallsClient; import com.vapi.api.resources.files.FilesClient; +import com.vapi.api.resources.knowledgebases.KnowledgeBasesClient; import com.vapi.api.resources.logs.LogsClient; import com.vapi.api.resources.phonenumbers.PhoneNumbersClient; import com.vapi.api.resources.squads.SquadsClient; @@ -27,6 +28,8 @@ public class Vapi { protected final Supplier squadsClient; + protected final Supplier knowledgeBasesClient; + protected final Supplier blocksClient; protected final Supplier toolsClient; @@ -43,6 +46,7 @@ public Vapi(ClientOptions clientOptions) { this.assistantsClient = Suppliers.memoize(() -> new AssistantsClient(clientOptions)); this.phoneNumbersClient = Suppliers.memoize(() -> new PhoneNumbersClient(clientOptions)); this.squadsClient = Suppliers.memoize(() -> new SquadsClient(clientOptions)); + this.knowledgeBasesClient = Suppliers.memoize(() -> new KnowledgeBasesClient(clientOptions)); this.blocksClient = Suppliers.memoize(() -> new BlocksClient(clientOptions)); this.toolsClient = Suppliers.memoize(() -> new ToolsClient(clientOptions)); this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions)); @@ -66,6 +70,10 @@ public SquadsClient squads() { return this.squadsClient.get(); } + public KnowledgeBasesClient knowledgeBases() { + return this.knowledgeBasesClient.get(); + } + public BlocksClient blocks() { return this.blocksClient.get(); } diff --git a/src/main/java/com/vapi/api/VapiBuilder.java b/src/main/java/com/vapi/api/VapiBuilder.java index e4616eb..f96776b 100644 --- a/src/main/java/com/vapi/api/VapiBuilder.java +++ b/src/main/java/com/vapi/api/VapiBuilder.java @@ -32,9 +32,6 @@ public VapiBuilder url(String url) { } public Vapi build() { - if (token == null) { - throw new RuntimeException("Please provide token"); - } this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.token); clientOptionsBuilder.environment(this.environment); return new Vapi(clientOptionsBuilder.build()); diff --git a/src/main/java/com/vapi/api/core/ClientOptions.java b/src/main/java/com/vapi/api/core/ClientOptions.java index 2232e9c..2ea0f36 100644 --- a/src/main/java/com/vapi/api/core/ClientOptions.java +++ b/src/main/java/com/vapi/api/core/ClientOptions.java @@ -30,7 +30,7 @@ private ClientOptions( { put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.vapi.fern:api-sdk"); - put("X-Fern-SDK-Version", "0.1.0"); + put("X-Fern-SDK-Version", "0.2.0"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/vapi/api/resources/analytics/AnalyticsClient.java b/src/main/java/com/vapi/api/resources/analytics/AnalyticsClient.java index 5e02b3a..7d298fd 100644 --- a/src/main/java/com/vapi/api/resources/analytics/AnalyticsClient.java +++ b/src/main/java/com/vapi/api/resources/analytics/AnalyticsClient.java @@ -3,18 +3,12 @@ */ package com.vapi.api.resources.analytics; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; import com.vapi.api.core.ClientOptions; -import com.vapi.api.core.MediaTypes; import com.vapi.api.core.ObjectMappers; import com.vapi.api.core.RequestOptions; import com.vapi.api.core.VapiApiException; import com.vapi.api.core.VapiException; -import com.vapi.api.resources.analytics.requests.AnalyticsQueryDto; -import com.vapi.api.types.AnalyticsQueryResult; import java.io.IOException; -import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -30,27 +24,19 @@ public AnalyticsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public List get(AnalyticsQueryDto request) { - return get(request, null); + public void get() { + get(null); } - public List get(AnalyticsQueryDto request, RequestOptions requestOptions) { + public void get(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("analytics") .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new VapiException("Failed to serialize request", e); - } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", body) + .method("POST", RequestBody.create("", null)) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -59,8 +45,7 @@ public List get(AnalyticsQueryDto request, RequestOptions try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}); + return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new VapiApiException( diff --git a/src/main/java/com/vapi/api/resources/assistants/requests/UpdateAssistantDto.java b/src/main/java/com/vapi/api/resources/assistants/requests/UpdateAssistantDto.java index 3baa966..9eea308 100644 --- a/src/main/java/com/vapi/api/resources/assistants/requests/UpdateAssistantDto.java +++ b/src/main/java/com/vapi/api/resources/assistants/requests/UpdateAssistantDto.java @@ -23,6 +23,7 @@ import com.vapi.api.types.ArtifactPlan; import com.vapi.api.types.MessagePlan; import com.vapi.api.types.MonitorPlan; +import com.vapi.api.types.Server; import com.vapi.api.types.StartSpeakingPlan; import com.vapi.api.types.StopSpeakingPlan; import com.vapi.api.types.TransportConfigurationTwilio; @@ -42,6 +43,8 @@ public final class UpdateAssistantDto { private final Optional voice; + private final Optional firstMessage; + private final Optional firstMessageMode; private final Optional hipaaEnabled; @@ -56,8 +59,6 @@ public final class UpdateAssistantDto { private final Optional backgroundSound; - private final Optional backchannelingEnabled; - private final Optional backgroundDenoisingEnabled; private final Optional modelOutputInMessagesEnabled; @@ -66,8 +67,6 @@ public final class UpdateAssistantDto { private final Optional name; - private final Optional firstMessage; - private final Optional voicemailDetection; private final Optional voicemailMessage; @@ -78,10 +77,6 @@ public final class UpdateAssistantDto { private final Optional> metadata; - private final Optional serverUrl; - - private final Optional serverUrlSecret; - private final Optional analysisPlan; private final Optional artifactPlan; @@ -96,12 +91,15 @@ public final class UpdateAssistantDto { private final Optional> credentialIds; + private final Optional server; + private final Map additionalProperties; private UpdateAssistantDto( Optional transcriber, Optional model, Optional voice, + Optional firstMessage, Optional firstMessageMode, Optional hipaaEnabled, Optional> clientMessages, @@ -109,19 +107,15 @@ private UpdateAssistantDto( Optional silenceTimeoutSeconds, Optional maxDurationSeconds, Optional backgroundSound, - Optional backchannelingEnabled, Optional backgroundDenoisingEnabled, Optional modelOutputInMessagesEnabled, Optional> transportConfigurations, Optional name, - Optional firstMessage, Optional voicemailDetection, Optional voicemailMessage, Optional endCallMessage, Optional> endCallPhrases, Optional> metadata, - Optional serverUrl, - Optional serverUrlSecret, Optional analysisPlan, Optional artifactPlan, Optional messagePlan, @@ -129,10 +123,12 @@ private UpdateAssistantDto( Optional stopSpeakingPlan, Optional monitorPlan, Optional> credentialIds, + Optional server, Map additionalProperties) { this.transcriber = transcriber; this.model = model; this.voice = voice; + this.firstMessage = firstMessage; this.firstMessageMode = firstMessageMode; this.hipaaEnabled = hipaaEnabled; this.clientMessages = clientMessages; @@ -140,19 +136,15 @@ private UpdateAssistantDto( this.silenceTimeoutSeconds = silenceTimeoutSeconds; this.maxDurationSeconds = maxDurationSeconds; this.backgroundSound = backgroundSound; - this.backchannelingEnabled = backchannelingEnabled; this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; this.modelOutputInMessagesEnabled = modelOutputInMessagesEnabled; this.transportConfigurations = transportConfigurations; this.name = name; - this.firstMessage = firstMessage; this.voicemailDetection = voicemailDetection; this.voicemailMessage = voicemailMessage; this.endCallMessage = endCallMessage; this.endCallPhrases = endCallPhrases; this.metadata = metadata; - this.serverUrl = serverUrl; - this.serverUrlSecret = serverUrlSecret; this.analysisPlan = analysisPlan; this.artifactPlan = artifactPlan; this.messagePlan = messagePlan; @@ -160,6 +152,7 @@ private UpdateAssistantDto( this.stopSpeakingPlan = stopSpeakingPlan; this.monitorPlan = monitorPlan; this.credentialIds = credentialIds; + this.server = server; this.additionalProperties = additionalProperties; } @@ -187,6 +180,15 @@ public Optional getVoice() { return voice; } + /** + * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

+ */ + @JsonProperty("firstMessage") + public Optional getFirstMessage() { + return firstMessage; + } + /** * @return This is the mode for the first message. Default is 'assistant-speaks-first'. *

Use:

@@ -211,7 +213,7 @@ public Optional getHipaaEnabled() { } /** - * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. */ @JsonProperty("clientMessages") public Optional> getClientMessages() { @@ -252,16 +254,6 @@ public Optional getBackgroundSound() { return backgroundSound; } - /** - * @return This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. - *

Default false while in beta.

- *

@default false

- */ - @JsonProperty("backchannelingEnabled") - public Optional getBackchannelingEnabled() { - return backchannelingEnabled; - } - /** * @return This enables filtering of noise and background speech while the user is talking. *

Default false while in beta.

@@ -299,15 +291,6 @@ public Optional getName() { return name; } - /** - * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). - *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

- */ - @JsonProperty("firstMessage") - public Optional getFirstMessage() { - return firstMessage; - } - /** * @return These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. * This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. @@ -352,25 +335,6 @@ public Optional> getMetadata() { return metadata; } - /** - * @return This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. - *

All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

- *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl

- */ - @JsonProperty("serverUrl") - public Optional getServerUrl() { - return serverUrl; - } - - /** - * @return This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. - *

Same precedence logic as serverUrl.

- */ - @JsonProperty("serverUrlSecret") - public Optional getServerUrlSecret() { - return serverUrlSecret; - } - /** * @return This is the plan for analysis of assistant's calls. Stored in call.analysis. */ @@ -449,6 +413,20 @@ public Optional> getCredentialIds() { return credentialIds; } + /** + * @return This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + *

The order of precedence is:

+ *
    + *
  1. assistant.server.url
  2. + *
  3. phoneNumber.serverUrl
  4. + *
  5. org.serverUrl
  6. + *
+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -464,6 +442,7 @@ private boolean equalTo(UpdateAssistantDto other) { return transcriber.equals(other.transcriber) && model.equals(other.model) && voice.equals(other.voice) + && firstMessage.equals(other.firstMessage) && firstMessageMode.equals(other.firstMessageMode) && hipaaEnabled.equals(other.hipaaEnabled) && clientMessages.equals(other.clientMessages) @@ -471,26 +450,23 @@ private boolean equalTo(UpdateAssistantDto other) { && silenceTimeoutSeconds.equals(other.silenceTimeoutSeconds) && maxDurationSeconds.equals(other.maxDurationSeconds) && backgroundSound.equals(other.backgroundSound) - && backchannelingEnabled.equals(other.backchannelingEnabled) && backgroundDenoisingEnabled.equals(other.backgroundDenoisingEnabled) && modelOutputInMessagesEnabled.equals(other.modelOutputInMessagesEnabled) && transportConfigurations.equals(other.transportConfigurations) && name.equals(other.name) - && firstMessage.equals(other.firstMessage) && voicemailDetection.equals(other.voicemailDetection) && voicemailMessage.equals(other.voicemailMessage) && endCallMessage.equals(other.endCallMessage) && endCallPhrases.equals(other.endCallPhrases) && metadata.equals(other.metadata) - && serverUrl.equals(other.serverUrl) - && serverUrlSecret.equals(other.serverUrlSecret) && analysisPlan.equals(other.analysisPlan) && artifactPlan.equals(other.artifactPlan) && messagePlan.equals(other.messagePlan) && startSpeakingPlan.equals(other.startSpeakingPlan) && stopSpeakingPlan.equals(other.stopSpeakingPlan) && monitorPlan.equals(other.monitorPlan) - && credentialIds.equals(other.credentialIds); + && credentialIds.equals(other.credentialIds) + && server.equals(other.server); } @java.lang.Override @@ -499,6 +475,7 @@ public int hashCode() { this.transcriber, this.model, this.voice, + this.firstMessage, this.firstMessageMode, this.hipaaEnabled, this.clientMessages, @@ -506,26 +483,23 @@ public int hashCode() { this.silenceTimeoutSeconds, this.maxDurationSeconds, this.backgroundSound, - this.backchannelingEnabled, this.backgroundDenoisingEnabled, this.modelOutputInMessagesEnabled, this.transportConfigurations, this.name, - this.firstMessage, this.voicemailDetection, this.voicemailMessage, this.endCallMessage, this.endCallPhrases, this.metadata, - this.serverUrl, - this.serverUrlSecret, this.analysisPlan, this.artifactPlan, this.messagePlan, this.startSpeakingPlan, this.stopSpeakingPlan, this.monitorPlan, - this.credentialIds); + this.credentialIds, + this.server); } @java.lang.Override @@ -545,6 +519,8 @@ public static final class Builder { private Optional voice = Optional.empty(); + private Optional firstMessage = Optional.empty(); + private Optional firstMessageMode = Optional.empty(); private Optional hipaaEnabled = Optional.empty(); @@ -559,8 +535,6 @@ public static final class Builder { private Optional backgroundSound = Optional.empty(); - private Optional backchannelingEnabled = Optional.empty(); - private Optional backgroundDenoisingEnabled = Optional.empty(); private Optional modelOutputInMessagesEnabled = Optional.empty(); @@ -569,8 +543,6 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional firstMessage = Optional.empty(); - private Optional voicemailDetection = Optional.empty(); private Optional voicemailMessage = Optional.empty(); @@ -581,10 +553,6 @@ public static final class Builder { private Optional> metadata = Optional.empty(); - private Optional serverUrl = Optional.empty(); - - private Optional serverUrlSecret = Optional.empty(); - private Optional analysisPlan = Optional.empty(); private Optional artifactPlan = Optional.empty(); @@ -599,6 +567,8 @@ public static final class Builder { private Optional> credentialIds = Optional.empty(); + private Optional server = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -608,6 +578,7 @@ public Builder from(UpdateAssistantDto other) { transcriber(other.getTranscriber()); model(other.getModel()); voice(other.getVoice()); + firstMessage(other.getFirstMessage()); firstMessageMode(other.getFirstMessageMode()); hipaaEnabled(other.getHipaaEnabled()); clientMessages(other.getClientMessages()); @@ -615,19 +586,15 @@ public Builder from(UpdateAssistantDto other) { silenceTimeoutSeconds(other.getSilenceTimeoutSeconds()); maxDurationSeconds(other.getMaxDurationSeconds()); backgroundSound(other.getBackgroundSound()); - backchannelingEnabled(other.getBackchannelingEnabled()); backgroundDenoisingEnabled(other.getBackgroundDenoisingEnabled()); modelOutputInMessagesEnabled(other.getModelOutputInMessagesEnabled()); transportConfigurations(other.getTransportConfigurations()); name(other.getName()); - firstMessage(other.getFirstMessage()); voicemailDetection(other.getVoicemailDetection()); voicemailMessage(other.getVoicemailMessage()); endCallMessage(other.getEndCallMessage()); endCallPhrases(other.getEndCallPhrases()); metadata(other.getMetadata()); - serverUrl(other.getServerUrl()); - serverUrlSecret(other.getServerUrlSecret()); analysisPlan(other.getAnalysisPlan()); artifactPlan(other.getArtifactPlan()); messagePlan(other.getMessagePlan()); @@ -635,6 +602,7 @@ public Builder from(UpdateAssistantDto other) { stopSpeakingPlan(other.getStopSpeakingPlan()); monitorPlan(other.getMonitorPlan()); credentialIds(other.getCredentialIds()); + server(other.getServer()); return this; } @@ -671,6 +639,17 @@ public Builder voice(UpdateAssistantDtoVoice voice) { return this; } + @JsonSetter(value = "firstMessage", nulls = Nulls.SKIP) + public Builder firstMessage(Optional firstMessage) { + this.firstMessage = firstMessage; + return this; + } + + public Builder firstMessage(String firstMessage) { + this.firstMessage = Optional.ofNullable(firstMessage); + return this; + } + @JsonSetter(value = "firstMessageMode", nulls = Nulls.SKIP) public Builder firstMessageMode(Optional firstMessageMode) { this.firstMessageMode = firstMessageMode; @@ -748,17 +727,6 @@ public Builder backgroundSound(UpdateAssistantDtoBackgroundSound backgroundSound return this; } - @JsonSetter(value = "backchannelingEnabled", nulls = Nulls.SKIP) - public Builder backchannelingEnabled(Optional backchannelingEnabled) { - this.backchannelingEnabled = backchannelingEnabled; - return this; - } - - public Builder backchannelingEnabled(Boolean backchannelingEnabled) { - this.backchannelingEnabled = Optional.ofNullable(backchannelingEnabled); - return this; - } - @JsonSetter(value = "backgroundDenoisingEnabled", nulls = Nulls.SKIP) public Builder backgroundDenoisingEnabled(Optional backgroundDenoisingEnabled) { this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; @@ -803,17 +771,6 @@ public Builder name(String name) { return this; } - @JsonSetter(value = "firstMessage", nulls = Nulls.SKIP) - public Builder firstMessage(Optional firstMessage) { - this.firstMessage = firstMessage; - return this; - } - - public Builder firstMessage(String firstMessage) { - this.firstMessage = Optional.ofNullable(firstMessage); - return this; - } - @JsonSetter(value = "voicemailDetection", nulls = Nulls.SKIP) public Builder voicemailDetection(Optional voicemailDetection) { this.voicemailDetection = voicemailDetection; @@ -869,28 +826,6 @@ public Builder metadata(Map metadata) { return this; } - @JsonSetter(value = "serverUrl", nulls = Nulls.SKIP) - public Builder serverUrl(Optional serverUrl) { - this.serverUrl = serverUrl; - return this; - } - - public Builder serverUrl(String serverUrl) { - this.serverUrl = Optional.ofNullable(serverUrl); - return this; - } - - @JsonSetter(value = "serverUrlSecret", nulls = Nulls.SKIP) - public Builder serverUrlSecret(Optional serverUrlSecret) { - this.serverUrlSecret = serverUrlSecret; - return this; - } - - public Builder serverUrlSecret(String serverUrlSecret) { - this.serverUrlSecret = Optional.ofNullable(serverUrlSecret); - return this; - } - @JsonSetter(value = "analysisPlan", nulls = Nulls.SKIP) public Builder analysisPlan(Optional analysisPlan) { this.analysisPlan = analysisPlan; @@ -968,11 +903,23 @@ public Builder credentialIds(List credentialIds) { return this; } + @JsonSetter(value = "server", nulls = Nulls.SKIP) + public Builder server(Optional server) { + this.server = server; + return this; + } + + public Builder server(Server server) { + this.server = Optional.ofNullable(server); + return this; + } + public UpdateAssistantDto build() { return new UpdateAssistantDto( transcriber, model, voice, + firstMessage, firstMessageMode, hipaaEnabled, clientMessages, @@ -980,19 +927,15 @@ public UpdateAssistantDto build() { silenceTimeoutSeconds, maxDurationSeconds, backgroundSound, - backchannelingEnabled, backgroundDenoisingEnabled, modelOutputInMessagesEnabled, transportConfigurations, name, - firstMessage, voicemailDetection, voicemailMessage, endCallMessage, endCallPhrases, metadata, - serverUrl, - serverUrlSecret, analysisPlan, artifactPlan, messagePlan, @@ -1000,6 +943,7 @@ public UpdateAssistantDto build() { stopSpeakingPlan, monitorPlan, credentialIds, + server, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoClientMessagesItem.java b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoClientMessagesItem.java index b0de6ca..789382e 100644 --- a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoClientMessagesItem.java +++ b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoClientMessagesItem.java @@ -30,6 +30,8 @@ public enum UpdateAssistantDtoClientMessagesItem { TOOL_CALLS_RESULT("tool-calls-result"), + TRANSFER_UPDATE("transfer-update"), + USER_INTERRUPTED("user-interrupted"), VOICE_INPUT("voice-input"); diff --git a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoModel.java b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoModel.java index 397ba97..29b181b 100644 --- a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoModel.java +++ b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoModel.java @@ -15,12 +15,15 @@ import com.vapi.api.types.AnyscaleModel; import com.vapi.api.types.CustomLlmModel; import com.vapi.api.types.DeepInfraModel; +import com.vapi.api.types.GoogleModel; import com.vapi.api.types.GroqModel; +import com.vapi.api.types.InflectionAiModel; import com.vapi.api.types.OpenAiModel; import com.vapi.api.types.OpenRouterModel; import com.vapi.api.types.PerplexityAiModel; import com.vapi.api.types.TogetherAiModel; import com.vapi.api.types.VapiModel; +import com.vapi.api.types.XaiModel; import java.util.Objects; import java.util.Optional; @@ -52,10 +55,18 @@ public static UpdateAssistantDtoModel deepinfra(DeepInfraModel value) { return new UpdateAssistantDtoModel(new DeepinfraValue(value)); } + public static UpdateAssistantDtoModel google(GoogleModel value) { + return new UpdateAssistantDtoModel(new GoogleValue(value)); + } + public static UpdateAssistantDtoModel groq(GroqModel value) { return new UpdateAssistantDtoModel(new GroqValue(value)); } + public static UpdateAssistantDtoModel inflectionAi(InflectionAiModel value) { + return new UpdateAssistantDtoModel(new InflectionAiValue(value)); + } + public static UpdateAssistantDtoModel openai(OpenAiModel value) { return new UpdateAssistantDtoModel(new OpenaiValue(value)); } @@ -76,6 +87,10 @@ public static UpdateAssistantDtoModel vapi(VapiModel value) { return new UpdateAssistantDtoModel(new VapiValue(value)); } + public static UpdateAssistantDtoModel xai(XaiModel value) { + return new UpdateAssistantDtoModel(new XaiValue(value)); + } + public boolean isAnyscale() { return value instanceof AnyscaleValue; } @@ -92,10 +107,18 @@ public boolean isDeepinfra() { return value instanceof DeepinfraValue; } + public boolean isGoogle() { + return value instanceof GoogleValue; + } + public boolean isGroq() { return value instanceof GroqValue; } + public boolean isInflectionAi() { + return value instanceof InflectionAiValue; + } + public boolean isOpenai() { return value instanceof OpenaiValue; } @@ -116,6 +139,10 @@ public boolean isVapi() { return value instanceof VapiValue; } + public boolean isXai() { + return value instanceof XaiValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -148,6 +175,13 @@ public Optional getDeepinfra() { return Optional.empty(); } + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + public Optional getGroq() { if (isGroq()) { return Optional.of(((GroqValue) value).value); @@ -155,6 +189,13 @@ public Optional getGroq() { return Optional.empty(); } + public Optional getInflectionAi() { + if (isInflectionAi()) { + return Optional.of(((InflectionAiValue) value).value); + } + return Optional.empty(); + } + public Optional getOpenai() { if (isOpenai()) { return Optional.of(((OpenaiValue) value).value); @@ -190,6 +231,13 @@ public Optional getVapi() { return Optional.empty(); } + public Optional getXai() { + if (isXai()) { + return Optional.of(((XaiValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -211,8 +259,12 @@ public interface Visitor { T visitDeepinfra(DeepInfraModel deepinfra); + T visitGoogle(GoogleModel google); + T visitGroq(GroqModel groq); + T visitInflectionAi(InflectionAiModel inflectionAi); + T visitOpenai(OpenAiModel openai); T visitOpenrouter(OpenRouterModel openrouter); @@ -223,6 +275,8 @@ public interface Visitor { T visitVapi(VapiModel vapi); + T visitXai(XaiModel xai); + T _visitUnknown(Object unknownType); } @@ -232,12 +286,15 @@ public interface Visitor { @JsonSubTypes.Type(AnthropicValue.class), @JsonSubTypes.Type(CustomLlmValue.class), @JsonSubTypes.Type(DeepinfraValue.class), + @JsonSubTypes.Type(GoogleValue.class), @JsonSubTypes.Type(GroqValue.class), + @JsonSubTypes.Type(InflectionAiValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(OpenrouterValue.class), @JsonSubTypes.Type(PerplexityAiValue.class), @JsonSubTypes.Type(TogetherAiValue.class), - @JsonSubTypes.Type(VapiValue.class) + @JsonSubTypes.Type(VapiValue.class), + @JsonSubTypes.Type(XaiValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -396,6 +453,44 @@ public String toString() { } } + @JsonTypeName("google") + private static final class GoogleValue implements Value { + @JsonUnwrapped + private GoogleModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(GoogleModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("groq") private static final class GroqValue implements Value { @JsonUnwrapped @@ -434,6 +529,44 @@ public String toString() { } } + @JsonTypeName("inflection-ai") + private static final class InflectionAiValue implements Value { + @JsonUnwrapped + private InflectionAiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private InflectionAiValue() {} + + private InflectionAiValue(InflectionAiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitInflectionAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InflectionAiValue && equalTo((InflectionAiValue) other); + } + + private boolean equalTo(InflectionAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("openai") private static final class OpenaiValue implements Value { @JsonUnwrapped @@ -624,6 +757,44 @@ public String toString() { } } + @JsonTypeName("xai") + private static final class XaiValue implements Value { + @JsonUnwrapped + private XaiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private XaiValue() {} + + private XaiValue(XaiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitXai(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof XaiValue && equalTo((XaiValue) other); + } + + private boolean equalTo(XaiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoModel{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoServerMessagesItem.java b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoServerMessagesItem.java index 8c6a121..99b83df 100644 --- a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoServerMessagesItem.java +++ b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoServerMessagesItem.java @@ -16,6 +16,8 @@ public enum UpdateAssistantDtoServerMessagesItem { LANGUAGE_CHANGED("language-changed"), + LANGUAGE_CHANGE_DETECTED("language-change-detected"), + MODEL_OUTPUT("model-output"), PHONE_CALL_CONTROL("phone-call-control"), diff --git a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoTranscriber.java b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoTranscriber.java index e6ad82a..7ca7714 100644 --- a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoTranscriber.java +++ b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoTranscriber.java @@ -11,6 +11,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.AssemblyAiTranscriber; +import com.vapi.api.types.CustomTranscriber; import com.vapi.api.types.DeepgramTranscriber; import com.vapi.api.types.GladiaTranscriber; import com.vapi.api.types.TalkscriberTranscriber; @@ -29,6 +31,14 @@ public T visit(Visitor visitor) { return value.visit(visitor); } + public static UpdateAssistantDtoTranscriber assemblyAi(AssemblyAiTranscriber value) { + return new UpdateAssistantDtoTranscriber(new AssemblyAiValue(value)); + } + + public static UpdateAssistantDtoTranscriber customTranscriber(CustomTranscriber value) { + return new UpdateAssistantDtoTranscriber(new CustomTranscriberValue(value)); + } + public static UpdateAssistantDtoTranscriber deepgram(DeepgramTranscriber value) { return new UpdateAssistantDtoTranscriber(new DeepgramValue(value)); } @@ -41,6 +51,14 @@ public static UpdateAssistantDtoTranscriber talkscriber(TalkscriberTranscriber v return new UpdateAssistantDtoTranscriber(new TalkscriberValue(value)); } + public boolean isAssemblyAi() { + return value instanceof AssemblyAiValue; + } + + public boolean isCustomTranscriber() { + return value instanceof CustomTranscriberValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -57,6 +75,20 @@ public boolean _isUnknown() { return value instanceof _UnknownValue; } + public Optional getAssemblyAi() { + if (isAssemblyAi()) { + return Optional.of(((AssemblyAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomTranscriber() { + if (isCustomTranscriber()) { + return Optional.of(((CustomTranscriberValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -91,6 +123,10 @@ private Value getValue() { } public interface Visitor { + T visitAssemblyAi(AssemblyAiTranscriber assemblyAi); + + T visitCustomTranscriber(CustomTranscriber customTranscriber); + T visitDeepgram(DeepgramTranscriber deepgram); T visitGladia(GladiaTranscriber gladia); @@ -102,6 +138,8 @@ public interface Visitor { @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) @JsonSubTypes({ + @JsonSubTypes.Type(AssemblyAiValue.class), + @JsonSubTypes.Type(CustomTranscriberValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(GladiaValue.class), @JsonSubTypes.Type(TalkscriberValue.class) @@ -111,6 +149,82 @@ private interface Value { T visit(Visitor visitor); } + @JsonTypeName("assembly-ai") + private static final class AssemblyAiValue implements Value { + @JsonUnwrapped + private AssemblyAiTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AssemblyAiValue() {} + + private AssemblyAiValue(AssemblyAiTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAssemblyAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssemblyAiValue && equalTo((AssemblyAiValue) other); + } + + private boolean equalTo(AssemblyAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoTranscriber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-transcriber") + private static final class CustomTranscriberValue implements Value { + @JsonUnwrapped + private CustomTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomTranscriberValue() {} + + private CustomTranscriberValue(CustomTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomTranscriber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomTranscriberValue && equalTo((CustomTranscriberValue) other); + } + + private boolean equalTo(CustomTranscriberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoTranscriber{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped diff --git a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoVoice.java b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoVoice.java index 01987c7..ba6d48a 100644 --- a/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoVoice.java +++ b/src/main/java/com/vapi/api/resources/assistants/types/UpdateAssistantDtoVoice.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.vapi.api.types.AzureVoice; import com.vapi.api.types.CartesiaVoice; +import com.vapi.api.types.CustomVoice; import com.vapi.api.types.DeepgramVoice; import com.vapi.api.types.ElevenLabsVoice; import com.vapi.api.types.LmntVoice; @@ -20,6 +21,7 @@ import com.vapi.api.types.OpenAiVoice; import com.vapi.api.types.PlayHtVoice; import com.vapi.api.types.RimeAiVoice; +import com.vapi.api.types.TavusVoice; import java.util.Objects; import java.util.Optional; @@ -43,6 +45,10 @@ public static UpdateAssistantDtoVoice cartesia(CartesiaVoice value) { return new UpdateAssistantDtoVoice(new CartesiaValue(value)); } + public static UpdateAssistantDtoVoice customVoice(CustomVoice value) { + return new UpdateAssistantDtoVoice(new CustomVoiceValue(value)); + } + public static UpdateAssistantDtoVoice deepgram(DeepgramVoice value) { return new UpdateAssistantDtoVoice(new DeepgramValue(value)); } @@ -71,6 +77,10 @@ public static UpdateAssistantDtoVoice rimeAi(RimeAiVoice value) { return new UpdateAssistantDtoVoice(new RimeAiValue(value)); } + public static UpdateAssistantDtoVoice tavus(TavusVoice value) { + return new UpdateAssistantDtoVoice(new TavusValue(value)); + } + public boolean isAzure() { return value instanceof AzureValue; } @@ -79,6 +89,10 @@ public boolean isCartesia() { return value instanceof CartesiaValue; } + public boolean isCustomVoice() { + return value instanceof CustomVoiceValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -107,6 +121,10 @@ public boolean isRimeAi() { return value instanceof RimeAiValue; } + public boolean isTavus() { + return value instanceof TavusValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -125,6 +143,13 @@ public Optional getCartesia() { return Optional.empty(); } + public Optional getCustomVoice() { + if (isCustomVoice()) { + return Optional.of(((CustomVoiceValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -174,6 +199,13 @@ public Optional getRimeAi() { return Optional.empty(); } + public Optional getTavus() { + if (isTavus()) { + return Optional.of(((TavusValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -191,6 +223,8 @@ public interface Visitor { T visitCartesia(CartesiaVoice cartesia); + T visitCustomVoice(CustomVoice customVoice); + T visitDeepgram(DeepgramVoice deepgram); T visit11Labs(ElevenLabsVoice _11Labs); @@ -205,6 +239,8 @@ public interface Visitor { T visitRimeAi(RimeAiVoice rimeAi); + T visitTavus(TavusVoice tavus); + T _visitUnknown(Object unknownType); } @@ -212,13 +248,15 @@ public interface Visitor { @JsonSubTypes({ @JsonSubTypes.Type(AzureValue.class), @JsonSubTypes.Type(CartesiaValue.class), + @JsonSubTypes.Type(CustomVoiceValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(_11LabsValue.class), @JsonSubTypes.Type(LmntValue.class), @JsonSubTypes.Type(NeetsValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(PlayhtValue.class), - @JsonSubTypes.Type(RimeAiValue.class) + @JsonSubTypes.Type(RimeAiValue.class), + @JsonSubTypes.Type(TavusValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -301,6 +339,44 @@ public String toString() { } } + @JsonTypeName("custom-voice") + private static final class CustomVoiceValue implements Value { + @JsonUnwrapped + private CustomVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomVoiceValue() {} + + private CustomVoiceValue(CustomVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomVoice(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomVoiceValue && equalTo((CustomVoiceValue) other); + } + + private boolean equalTo(CustomVoiceValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoVoice{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped @@ -567,6 +643,44 @@ public String toString() { } } + @JsonTypeName("tavus") + private static final class TavusValue implements Value { + @JsonUnwrapped + private TavusVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TavusValue() {} + + private TavusValue(TavusVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTavus(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusValue && equalTo((TavusValue) other); + } + + private boolean equalTo(TavusValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "UpdateAssistantDtoVoice{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/calls/CallsClient.java b/src/main/java/com/vapi/api/resources/calls/CallsClient.java index 78983b0..0decc43 100644 --- a/src/main/java/com/vapi/api/resources/calls/CallsClient.java +++ b/src/main/java/com/vapi/api/resources/calls/CallsClient.java @@ -44,9 +44,16 @@ public List list(CallsListRequest request, RequestOptions requestOptions) HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("call"); + if (request.getId().isPresent()) { + httpUrl.addQueryParameter("id", request.getId().get()); + } if (request.getAssistantId().isPresent()) { httpUrl.addQueryParameter("assistantId", request.getAssistantId().get()); } + if (request.getPhoneNumberId().isPresent()) { + httpUrl.addQueryParameter( + "phoneNumberId", request.getPhoneNumberId().get()); + } if (request.getLimit().isPresent()) { httpUrl.addQueryParameter("limit", request.getLimit().get().toString()); } diff --git a/src/main/java/com/vapi/api/resources/calls/requests/CallsListRequest.java b/src/main/java/com/vapi/api/resources/calls/requests/CallsListRequest.java index 0f74f2b..6002549 100644 --- a/src/main/java/com/vapi/api/resources/calls/requests/CallsListRequest.java +++ b/src/main/java/com/vapi/api/resources/calls/requests/CallsListRequest.java @@ -21,8 +21,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CallsListRequest.Builder.class) public final class CallsListRequest { + private final Optional id; + private final Optional assistantId; + private final Optional phoneNumberId; + private final Optional limit; private final Optional createdAtGt; @@ -44,7 +48,9 @@ public final class CallsListRequest { private final Map additionalProperties; private CallsListRequest( + Optional id, Optional assistantId, + Optional phoneNumberId, Optional limit, Optional createdAtGt, Optional createdAtLt, @@ -55,7 +61,9 @@ private CallsListRequest( Optional updatedAtGe, Optional updatedAtLe, Map additionalProperties) { + this.id = id; this.assistantId = assistantId; + this.phoneNumberId = phoneNumberId; this.limit = limit; this.createdAtGt = createdAtGt; this.createdAtLt = createdAtLt; @@ -68,6 +76,14 @@ private CallsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return This is the unique identifier for the call. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + /** * @return This will return calls with the specified assistantId. */ @@ -76,6 +92,15 @@ public Optional getAssistantId() { return assistantId; } + /** + * @return This is the phone number that will be used for the call. To use a transient number, use phoneNumber instead. + *

Only relevant for outboundPhoneCall and inboundPhoneCall type.

+ */ + @JsonProperty("phoneNumberId") + public Optional getPhoneNumberId() { + return phoneNumberId; + } + /** * @return This is the maximum number of items to return. Defaults to 100. */ @@ -160,7 +185,9 @@ public Map getAdditionalProperties() { } private boolean equalTo(CallsListRequest other) { - return assistantId.equals(other.assistantId) + return id.equals(other.id) + && assistantId.equals(other.assistantId) + && phoneNumberId.equals(other.phoneNumberId) && limit.equals(other.limit) && createdAtGt.equals(other.createdAtGt) && createdAtLt.equals(other.createdAtLt) @@ -175,7 +202,9 @@ private boolean equalTo(CallsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.id, this.assistantId, + this.phoneNumberId, this.limit, this.createdAtGt, this.createdAtLt, @@ -198,8 +227,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional id = Optional.empty(); + private Optional assistantId = Optional.empty(); + private Optional phoneNumberId = Optional.empty(); + private Optional limit = Optional.empty(); private Optional createdAtGt = Optional.empty(); @@ -224,7 +257,9 @@ public static final class Builder { private Builder() {} public Builder from(CallsListRequest other) { + id(other.getId()); assistantId(other.getAssistantId()); + phoneNumberId(other.getPhoneNumberId()); limit(other.getLimit()); createdAtGt(other.getCreatedAtGt()); createdAtLt(other.getCreatedAtLt()); @@ -237,6 +272,17 @@ public Builder from(CallsListRequest other) { return this; } + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + @JsonSetter(value = "assistantId", nulls = Nulls.SKIP) public Builder assistantId(Optional assistantId) { this.assistantId = assistantId; @@ -248,6 +294,17 @@ public Builder assistantId(String assistantId) { return this; } + @JsonSetter(value = "phoneNumberId", nulls = Nulls.SKIP) + public Builder phoneNumberId(Optional phoneNumberId) { + this.phoneNumberId = phoneNumberId; + return this; + } + + public Builder phoneNumberId(String phoneNumberId) { + this.phoneNumberId = Optional.ofNullable(phoneNumberId); + return this; + } + @JsonSetter(value = "limit", nulls = Nulls.SKIP) public Builder limit(Optional limit) { this.limit = limit; @@ -349,7 +406,9 @@ public Builder updatedAtLe(OffsetDateTime updatedAtLe) { public CallsListRequest build() { return new CallsListRequest( + id, assistantId, + phoneNumberId, limit, createdAtGt, createdAtLt, diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/KnowledgeBasesClient.java b/src/main/java/com/vapi/api/resources/knowledgebases/KnowledgeBasesClient.java new file mode 100644 index 0000000..721233e --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/KnowledgeBasesClient.java @@ -0,0 +1,256 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.vapi.api.core.ClientOptions; +import com.vapi.api.core.MediaTypes; +import com.vapi.api.core.ObjectMappers; +import com.vapi.api.core.RequestOptions; +import com.vapi.api.core.VapiApiException; +import com.vapi.api.core.VapiException; +import com.vapi.api.resources.knowledgebases.requests.KnowledgeBasesListRequest; +import com.vapi.api.resources.knowledgebases.types.KnowledgeBasesCreateRequest; +import com.vapi.api.resources.knowledgebases.types.KnowledgeBasesCreateResponse; +import com.vapi.api.resources.knowledgebases.types.KnowledgeBasesDeleteResponse; +import com.vapi.api.resources.knowledgebases.types.KnowledgeBasesGetResponse; +import com.vapi.api.resources.knowledgebases.types.KnowledgeBasesListResponseItem; +import com.vapi.api.resources.knowledgebases.types.KnowledgeBasesUpdateResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class KnowledgeBasesClient { + protected final ClientOptions clientOptions; + + public KnowledgeBasesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public List list() { + return list(KnowledgeBasesListRequest.builder().build()); + } + + public List list(KnowledgeBasesListRequest request) { + return list(request, null); + } + + public List list(KnowledgeBasesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledge-base"); + if (request.getLimit().isPresent()) { + httpUrl.addQueryParameter("limit", request.getLimit().get().toString()); + } + if (request.getCreatedAtGt().isPresent()) { + httpUrl.addQueryParameter( + "createdAtGt", request.getCreatedAtGt().get().toString()); + } + if (request.getCreatedAtLt().isPresent()) { + httpUrl.addQueryParameter( + "createdAtLt", request.getCreatedAtLt().get().toString()); + } + if (request.getCreatedAtGe().isPresent()) { + httpUrl.addQueryParameter( + "createdAtGe", request.getCreatedAtGe().get().toString()); + } + if (request.getCreatedAtLe().isPresent()) { + httpUrl.addQueryParameter( + "createdAtLe", request.getCreatedAtLe().get().toString()); + } + if (request.getUpdatedAtGt().isPresent()) { + httpUrl.addQueryParameter( + "updatedAtGt", request.getUpdatedAtGt().get().toString()); + } + if (request.getUpdatedAtLt().isPresent()) { + httpUrl.addQueryParameter( + "updatedAtLt", request.getUpdatedAtLt().get().toString()); + } + if (request.getUpdatedAtGe().isPresent()) { + httpUrl.addQueryParameter( + "updatedAtGe", request.getUpdatedAtGe().get().toString()); + } + if (request.getUpdatedAtLe().isPresent()) { + httpUrl.addQueryParameter( + "updatedAtLe", request.getUpdatedAtLe().get().toString()); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new VapiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new VapiException("Network error executing HTTP request", e); + } + } + + public KnowledgeBasesCreateResponse create(KnowledgeBasesCreateRequest request) { + return create(request, null); + } + + public KnowledgeBasesCreateResponse create(KnowledgeBasesCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledge-base") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new VapiException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), KnowledgeBasesCreateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new VapiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new VapiException("Network error executing HTTP request", e); + } + } + + public KnowledgeBasesGetResponse get(String id) { + return get(id, null); + } + + public KnowledgeBasesGetResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledge-base") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), KnowledgeBasesGetResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new VapiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new VapiException("Network error executing HTTP request", e); + } + } + + public KnowledgeBasesDeleteResponse delete(String id) { + return delete(id, null); + } + + public KnowledgeBasesDeleteResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledge-base") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), KnowledgeBasesDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new VapiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new VapiException("Network error executing HTTP request", e); + } + } + + public KnowledgeBasesUpdateResponse update(String id) { + return update(id, null); + } + + public KnowledgeBasesUpdateResponse update(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledge-base") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), KnowledgeBasesUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new VapiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new VapiException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/requests/KnowledgeBasesListRequest.java b/src/main/java/com/vapi/api/resources/knowledgebases/requests/KnowledgeBasesListRequest.java new file mode 100644 index 0000000..672f706 --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/requests/KnowledgeBasesListRequest.java @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = KnowledgeBasesListRequest.Builder.class) +public final class KnowledgeBasesListRequest { + private final Optional limit; + + private final Optional createdAtGt; + + private final Optional createdAtLt; + + private final Optional createdAtGe; + + private final Optional createdAtLe; + + private final Optional updatedAtGt; + + private final Optional updatedAtLt; + + private final Optional updatedAtGe; + + private final Optional updatedAtLe; + + private final Map additionalProperties; + + private KnowledgeBasesListRequest( + Optional limit, + Optional createdAtGt, + Optional createdAtLt, + Optional createdAtGe, + Optional createdAtLe, + Optional updatedAtGt, + Optional updatedAtLt, + Optional updatedAtGe, + Optional updatedAtLe, + Map additionalProperties) { + this.limit = limit; + this.createdAtGt = createdAtGt; + this.createdAtLt = createdAtLt; + this.createdAtGe = createdAtGe; + this.createdAtLe = createdAtLe; + this.updatedAtGt = updatedAtGt; + this.updatedAtLt = updatedAtLt; + this.updatedAtGe = updatedAtGe; + this.updatedAtLe = updatedAtLe; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the maximum number of items to return. Defaults to 100. + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return This will return items where the createdAt is greater than the specified value. + */ + @JsonProperty("createdAtGt") + public Optional getCreatedAtGt() { + return createdAtGt; + } + + /** + * @return This will return items where the createdAt is less than the specified value. + */ + @JsonProperty("createdAtLt") + public Optional getCreatedAtLt() { + return createdAtLt; + } + + /** + * @return This will return items where the createdAt is greater than or equal to the specified value. + */ + @JsonProperty("createdAtGe") + public Optional getCreatedAtGe() { + return createdAtGe; + } + + /** + * @return This will return items where the createdAt is less than or equal to the specified value. + */ + @JsonProperty("createdAtLe") + public Optional getCreatedAtLe() { + return createdAtLe; + } + + /** + * @return This will return items where the updatedAt is greater than the specified value. + */ + @JsonProperty("updatedAtGt") + public Optional getUpdatedAtGt() { + return updatedAtGt; + } + + /** + * @return This will return items where the updatedAt is less than the specified value. + */ + @JsonProperty("updatedAtLt") + public Optional getUpdatedAtLt() { + return updatedAtLt; + } + + /** + * @return This will return items where the updatedAt is greater than or equal to the specified value. + */ + @JsonProperty("updatedAtGe") + public Optional getUpdatedAtGe() { + return updatedAtGe; + } + + /** + * @return This will return items where the updatedAt is less than or equal to the specified value. + */ + @JsonProperty("updatedAtLe") + public Optional getUpdatedAtLe() { + return updatedAtLe; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof KnowledgeBasesListRequest && equalTo((KnowledgeBasesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(KnowledgeBasesListRequest other) { + return limit.equals(other.limit) + && createdAtGt.equals(other.createdAtGt) + && createdAtLt.equals(other.createdAtLt) + && createdAtGe.equals(other.createdAtGe) + && createdAtLe.equals(other.createdAtLe) + && updatedAtGt.equals(other.updatedAtGt) + && updatedAtLt.equals(other.updatedAtLt) + && updatedAtGe.equals(other.updatedAtGe) + && updatedAtLe.equals(other.updatedAtLe); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.limit, + this.createdAtGt, + this.createdAtLt, + this.createdAtGe, + this.createdAtLe, + this.updatedAtGt, + this.updatedAtLt, + this.updatedAtGe, + this.updatedAtLe); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional limit = Optional.empty(); + + private Optional createdAtGt = Optional.empty(); + + private Optional createdAtLt = Optional.empty(); + + private Optional createdAtGe = Optional.empty(); + + private Optional createdAtLe = Optional.empty(); + + private Optional updatedAtGt = Optional.empty(); + + private Optional updatedAtLt = Optional.empty(); + + private Optional updatedAtGe = Optional.empty(); + + private Optional updatedAtLe = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(KnowledgeBasesListRequest other) { + limit(other.getLimit()); + createdAtGt(other.getCreatedAtGt()); + createdAtLt(other.getCreatedAtLt()); + createdAtGe(other.getCreatedAtGe()); + createdAtLe(other.getCreatedAtLe()); + updatedAtGt(other.getUpdatedAtGt()); + updatedAtLt(other.getUpdatedAtLt()); + updatedAtGe(other.getUpdatedAtGe()); + updatedAtLe(other.getUpdatedAtLe()); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "createdAtGt", nulls = Nulls.SKIP) + public Builder createdAtGt(Optional createdAtGt) { + this.createdAtGt = createdAtGt; + return this; + } + + public Builder createdAtGt(OffsetDateTime createdAtGt) { + this.createdAtGt = Optional.ofNullable(createdAtGt); + return this; + } + + @JsonSetter(value = "createdAtLt", nulls = Nulls.SKIP) + public Builder createdAtLt(Optional createdAtLt) { + this.createdAtLt = createdAtLt; + return this; + } + + public Builder createdAtLt(OffsetDateTime createdAtLt) { + this.createdAtLt = Optional.ofNullable(createdAtLt); + return this; + } + + @JsonSetter(value = "createdAtGe", nulls = Nulls.SKIP) + public Builder createdAtGe(Optional createdAtGe) { + this.createdAtGe = createdAtGe; + return this; + } + + public Builder createdAtGe(OffsetDateTime createdAtGe) { + this.createdAtGe = Optional.ofNullable(createdAtGe); + return this; + } + + @JsonSetter(value = "createdAtLe", nulls = Nulls.SKIP) + public Builder createdAtLe(Optional createdAtLe) { + this.createdAtLe = createdAtLe; + return this; + } + + public Builder createdAtLe(OffsetDateTime createdAtLe) { + this.createdAtLe = Optional.ofNullable(createdAtLe); + return this; + } + + @JsonSetter(value = "updatedAtGt", nulls = Nulls.SKIP) + public Builder updatedAtGt(Optional updatedAtGt) { + this.updatedAtGt = updatedAtGt; + return this; + } + + public Builder updatedAtGt(OffsetDateTime updatedAtGt) { + this.updatedAtGt = Optional.ofNullable(updatedAtGt); + return this; + } + + @JsonSetter(value = "updatedAtLt", nulls = Nulls.SKIP) + public Builder updatedAtLt(Optional updatedAtLt) { + this.updatedAtLt = updatedAtLt; + return this; + } + + public Builder updatedAtLt(OffsetDateTime updatedAtLt) { + this.updatedAtLt = Optional.ofNullable(updatedAtLt); + return this; + } + + @JsonSetter(value = "updatedAtGe", nulls = Nulls.SKIP) + public Builder updatedAtGe(Optional updatedAtGe) { + this.updatedAtGe = updatedAtGe; + return this; + } + + public Builder updatedAtGe(OffsetDateTime updatedAtGe) { + this.updatedAtGe = Optional.ofNullable(updatedAtGe); + return this; + } + + @JsonSetter(value = "updatedAtLe", nulls = Nulls.SKIP) + public Builder updatedAtLe(Optional updatedAtLe) { + this.updatedAtLe = updatedAtLe; + return this; + } + + public Builder updatedAtLe(OffsetDateTime updatedAtLe) { + this.updatedAtLe = Optional.ofNullable(updatedAtLe); + return this; + } + + public KnowledgeBasesListRequest build() { + return new KnowledgeBasesListRequest( + limit, + createdAtGt, + createdAtLt, + createdAtGe, + createdAtLe, + updatedAtGt, + updatedAtLt, + updatedAtGe, + updatedAtLe, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesCreateRequest.java b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesCreateRequest.java new file mode 100644 index 0000000..118968c --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesCreateRequest.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CreateCustomKnowledgeBaseDto; +import com.vapi.api.types.CreateTrieveKnowledgeBaseDto; +import java.util.Objects; +import java.util.Optional; + +public final class KnowledgeBasesCreateRequest { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private KnowledgeBasesCreateRequest(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static KnowledgeBasesCreateRequest trieve(CreateTrieveKnowledgeBaseDto value) { + return new KnowledgeBasesCreateRequest(new TrieveValue(value)); + } + + public static KnowledgeBasesCreateRequest customKnowledgeBase(CreateCustomKnowledgeBaseDto value) { + return new KnowledgeBasesCreateRequest(new CustomKnowledgeBaseValue(value)); + } + + public boolean isTrieve() { + return value instanceof TrieveValue; + } + + public boolean isCustomKnowledgeBase() { + return value instanceof CustomKnowledgeBaseValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getTrieve() { + if (isTrieve()) { + return Optional.of(((TrieveValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomKnowledgeBase() { + if (isCustomKnowledgeBase()) { + return Optional.of(((CustomKnowledgeBaseValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitTrieve(CreateTrieveKnowledgeBaseDto trieve); + + T visitCustomKnowledgeBase(CreateCustomKnowledgeBaseDto customKnowledgeBase); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(TrieveValue.class), @JsonSubTypes.Type(CustomKnowledgeBaseValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("trieve") + private static final class TrieveValue implements Value { + @JsonUnwrapped + private CreateTrieveKnowledgeBaseDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TrieveValue() {} + + private TrieveValue(CreateTrieveKnowledgeBaseDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTrieve(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveValue && equalTo((TrieveValue) other); + } + + private boolean equalTo(TrieveValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesCreateRequest{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-knowledge-base") + private static final class CustomKnowledgeBaseValue implements Value { + @JsonUnwrapped + private CreateCustomKnowledgeBaseDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomKnowledgeBaseValue() {} + + private CustomKnowledgeBaseValue(CreateCustomKnowledgeBaseDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomKnowledgeBase(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBaseValue && equalTo((CustomKnowledgeBaseValue) other); + } + + private boolean equalTo(CustomKnowledgeBaseValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesCreateRequest{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesCreateRequest{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesCreateResponse.java b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesCreateResponse.java new file mode 100644 index 0000000..06a318d --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesCreateResponse.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CustomKnowledgeBase; +import com.vapi.api.types.TrieveKnowledgeBase; +import java.util.Objects; +import java.util.Optional; + +public final class KnowledgeBasesCreateResponse { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private KnowledgeBasesCreateResponse(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static KnowledgeBasesCreateResponse trieve(TrieveKnowledgeBase value) { + return new KnowledgeBasesCreateResponse(new TrieveValue(value)); + } + + public static KnowledgeBasesCreateResponse customKnowledgeBase(CustomKnowledgeBase value) { + return new KnowledgeBasesCreateResponse(new CustomKnowledgeBaseValue(value)); + } + + public boolean isTrieve() { + return value instanceof TrieveValue; + } + + public boolean isCustomKnowledgeBase() { + return value instanceof CustomKnowledgeBaseValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getTrieve() { + if (isTrieve()) { + return Optional.of(((TrieveValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomKnowledgeBase() { + if (isCustomKnowledgeBase()) { + return Optional.of(((CustomKnowledgeBaseValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitTrieve(TrieveKnowledgeBase trieve); + + T visitCustomKnowledgeBase(CustomKnowledgeBase customKnowledgeBase); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(TrieveValue.class), @JsonSubTypes.Type(CustomKnowledgeBaseValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("trieve") + private static final class TrieveValue implements Value { + @JsonUnwrapped + private TrieveKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TrieveValue() {} + + private TrieveValue(TrieveKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTrieve(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveValue && equalTo((TrieveValue) other); + } + + private boolean equalTo(TrieveValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesCreateResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-knowledge-base") + private static final class CustomKnowledgeBaseValue implements Value { + @JsonUnwrapped + private CustomKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomKnowledgeBaseValue() {} + + private CustomKnowledgeBaseValue(CustomKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomKnowledgeBase(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBaseValue && equalTo((CustomKnowledgeBaseValue) other); + } + + private boolean equalTo(CustomKnowledgeBaseValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesCreateResponse{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesCreateResponse{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesDeleteResponse.java b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesDeleteResponse.java new file mode 100644 index 0000000..38bd106 --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesDeleteResponse.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CustomKnowledgeBase; +import com.vapi.api.types.TrieveKnowledgeBase; +import java.util.Objects; +import java.util.Optional; + +public final class KnowledgeBasesDeleteResponse { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private KnowledgeBasesDeleteResponse(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static KnowledgeBasesDeleteResponse trieve(TrieveKnowledgeBase value) { + return new KnowledgeBasesDeleteResponse(new TrieveValue(value)); + } + + public static KnowledgeBasesDeleteResponse customKnowledgeBase(CustomKnowledgeBase value) { + return new KnowledgeBasesDeleteResponse(new CustomKnowledgeBaseValue(value)); + } + + public boolean isTrieve() { + return value instanceof TrieveValue; + } + + public boolean isCustomKnowledgeBase() { + return value instanceof CustomKnowledgeBaseValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getTrieve() { + if (isTrieve()) { + return Optional.of(((TrieveValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomKnowledgeBase() { + if (isCustomKnowledgeBase()) { + return Optional.of(((CustomKnowledgeBaseValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitTrieve(TrieveKnowledgeBase trieve); + + T visitCustomKnowledgeBase(CustomKnowledgeBase customKnowledgeBase); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(TrieveValue.class), @JsonSubTypes.Type(CustomKnowledgeBaseValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("trieve") + private static final class TrieveValue implements Value { + @JsonUnwrapped + private TrieveKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TrieveValue() {} + + private TrieveValue(TrieveKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTrieve(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveValue && equalTo((TrieveValue) other); + } + + private boolean equalTo(TrieveValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesDeleteResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-knowledge-base") + private static final class CustomKnowledgeBaseValue implements Value { + @JsonUnwrapped + private CustomKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomKnowledgeBaseValue() {} + + private CustomKnowledgeBaseValue(CustomKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomKnowledgeBase(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBaseValue && equalTo((CustomKnowledgeBaseValue) other); + } + + private boolean equalTo(CustomKnowledgeBaseValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesDeleteResponse{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesDeleteResponse{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesGetResponse.java b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesGetResponse.java new file mode 100644 index 0000000..1534fe1 --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesGetResponse.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CustomKnowledgeBase; +import com.vapi.api.types.TrieveKnowledgeBase; +import java.util.Objects; +import java.util.Optional; + +public final class KnowledgeBasesGetResponse { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private KnowledgeBasesGetResponse(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static KnowledgeBasesGetResponse trieve(TrieveKnowledgeBase value) { + return new KnowledgeBasesGetResponse(new TrieveValue(value)); + } + + public static KnowledgeBasesGetResponse customKnowledgeBase(CustomKnowledgeBase value) { + return new KnowledgeBasesGetResponse(new CustomKnowledgeBaseValue(value)); + } + + public boolean isTrieve() { + return value instanceof TrieveValue; + } + + public boolean isCustomKnowledgeBase() { + return value instanceof CustomKnowledgeBaseValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getTrieve() { + if (isTrieve()) { + return Optional.of(((TrieveValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomKnowledgeBase() { + if (isCustomKnowledgeBase()) { + return Optional.of(((CustomKnowledgeBaseValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitTrieve(TrieveKnowledgeBase trieve); + + T visitCustomKnowledgeBase(CustomKnowledgeBase customKnowledgeBase); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(TrieveValue.class), @JsonSubTypes.Type(CustomKnowledgeBaseValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("trieve") + private static final class TrieveValue implements Value { + @JsonUnwrapped + private TrieveKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TrieveValue() {} + + private TrieveValue(TrieveKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTrieve(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveValue && equalTo((TrieveValue) other); + } + + private boolean equalTo(TrieveValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesGetResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-knowledge-base") + private static final class CustomKnowledgeBaseValue implements Value { + @JsonUnwrapped + private CustomKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomKnowledgeBaseValue() {} + + private CustomKnowledgeBaseValue(CustomKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomKnowledgeBase(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBaseValue && equalTo((CustomKnowledgeBaseValue) other); + } + + private boolean equalTo(CustomKnowledgeBaseValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesGetResponse{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesGetResponse{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesListResponseItem.java b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesListResponseItem.java new file mode 100644 index 0000000..2df092c --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesListResponseItem.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CustomKnowledgeBase; +import com.vapi.api.types.TrieveKnowledgeBase; +import java.util.Objects; +import java.util.Optional; + +public final class KnowledgeBasesListResponseItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private KnowledgeBasesListResponseItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static KnowledgeBasesListResponseItem trieve(TrieveKnowledgeBase value) { + return new KnowledgeBasesListResponseItem(new TrieveValue(value)); + } + + public static KnowledgeBasesListResponseItem customKnowledgeBase(CustomKnowledgeBase value) { + return new KnowledgeBasesListResponseItem(new CustomKnowledgeBaseValue(value)); + } + + public boolean isTrieve() { + return value instanceof TrieveValue; + } + + public boolean isCustomKnowledgeBase() { + return value instanceof CustomKnowledgeBaseValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getTrieve() { + if (isTrieve()) { + return Optional.of(((TrieveValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomKnowledgeBase() { + if (isCustomKnowledgeBase()) { + return Optional.of(((CustomKnowledgeBaseValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitTrieve(TrieveKnowledgeBase trieve); + + T visitCustomKnowledgeBase(CustomKnowledgeBase customKnowledgeBase); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(TrieveValue.class), @JsonSubTypes.Type(CustomKnowledgeBaseValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("trieve") + private static final class TrieveValue implements Value { + @JsonUnwrapped + private TrieveKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TrieveValue() {} + + private TrieveValue(TrieveKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTrieve(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveValue && equalTo((TrieveValue) other); + } + + private boolean equalTo(TrieveValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesListResponseItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-knowledge-base") + private static final class CustomKnowledgeBaseValue implements Value { + @JsonUnwrapped + private CustomKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomKnowledgeBaseValue() {} + + private CustomKnowledgeBaseValue(CustomKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomKnowledgeBase(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBaseValue && equalTo((CustomKnowledgeBaseValue) other); + } + + private boolean equalTo(CustomKnowledgeBaseValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesListResponseItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesListResponseItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesUpdateResponse.java b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesUpdateResponse.java new file mode 100644 index 0000000..6c28779 --- /dev/null +++ b/src/main/java/com/vapi/api/resources/knowledgebases/types/KnowledgeBasesUpdateResponse.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.resources.knowledgebases.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CustomKnowledgeBase; +import com.vapi.api.types.TrieveKnowledgeBase; +import java.util.Objects; +import java.util.Optional; + +public final class KnowledgeBasesUpdateResponse { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private KnowledgeBasesUpdateResponse(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static KnowledgeBasesUpdateResponse trieve(TrieveKnowledgeBase value) { + return new KnowledgeBasesUpdateResponse(new TrieveValue(value)); + } + + public static KnowledgeBasesUpdateResponse customKnowledgeBase(CustomKnowledgeBase value) { + return new KnowledgeBasesUpdateResponse(new CustomKnowledgeBaseValue(value)); + } + + public boolean isTrieve() { + return value instanceof TrieveValue; + } + + public boolean isCustomKnowledgeBase() { + return value instanceof CustomKnowledgeBaseValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getTrieve() { + if (isTrieve()) { + return Optional.of(((TrieveValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomKnowledgeBase() { + if (isCustomKnowledgeBase()) { + return Optional.of(((CustomKnowledgeBaseValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitTrieve(TrieveKnowledgeBase trieve); + + T visitCustomKnowledgeBase(CustomKnowledgeBase customKnowledgeBase); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(TrieveValue.class), @JsonSubTypes.Type(CustomKnowledgeBaseValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("trieve") + private static final class TrieveValue implements Value { + @JsonUnwrapped + private TrieveKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TrieveValue() {} + + private TrieveValue(TrieveKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTrieve(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveValue && equalTo((TrieveValue) other); + } + + private boolean equalTo(TrieveValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesUpdateResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-knowledge-base") + private static final class CustomKnowledgeBaseValue implements Value { + @JsonUnwrapped + private CustomKnowledgeBase value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomKnowledgeBaseValue() {} + + private CustomKnowledgeBaseValue(CustomKnowledgeBase value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomKnowledgeBase(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBaseValue && equalTo((CustomKnowledgeBaseValue) other); + } + + private boolean equalTo(CustomKnowledgeBaseValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesUpdateResponse{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "KnowledgeBasesUpdateResponse{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/resources/logs/LogsClient.java b/src/main/java/com/vapi/api/resources/logs/LogsClient.java index 875a013..b7ec473 100644 --- a/src/main/java/com/vapi/api/resources/logs/LogsClient.java +++ b/src/main/java/com/vapi/api/resources/logs/LogsClient.java @@ -46,6 +46,9 @@ public SyncPagingIterable get(LogsGetRequest request, RequestOptions reques if (request.getType().isPresent()) { httpUrl.addQueryParameter("type", request.getType().get().toString()); } + if (request.getWebhookType().isPresent()) { + httpUrl.addQueryParameter("webhookType", request.getWebhookType().get()); + } if (request.getAssistantId().isPresent()) { httpUrl.addQueryParameter("assistantId", request.getAssistantId().get()); } @@ -118,7 +121,7 @@ public SyncPagingIterable get(LogsGetRequest request, RequestOptions reques if (response.isSuccessful()) { LogsPaginatedResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LogsPaginatedResponse.class); - int newPageNumber = request.getPage().map(page -> page + 1).orElse(1); + double newPageNumber = request.getPage().map(page -> page + 1).orElse(1); LogsGetRequest nextRequest = LogsGetRequest.builder() .from(request) .page(newPageNumber) diff --git a/src/main/java/com/vapi/api/resources/logs/requests/LogsGetRequest.java b/src/main/java/com/vapi/api/resources/logs/requests/LogsGetRequest.java index fc175b9..969faaa 100644 --- a/src/main/java/com/vapi/api/resources/logs/requests/LogsGetRequest.java +++ b/src/main/java/com/vapi/api/resources/logs/requests/LogsGetRequest.java @@ -27,6 +27,8 @@ public final class LogsGetRequest { private final Optional type; + private final Optional webhookType; + private final Optional assistantId; private final Optional phoneNumberId; @@ -37,7 +39,7 @@ public final class LogsGetRequest { private final Optional callId; - private final Optional page; + private final Optional page; private final Optional sortOrder; @@ -64,12 +66,13 @@ public final class LogsGetRequest { private LogsGetRequest( Optional orgId, Optional type, + Optional webhookType, Optional assistantId, Optional phoneNumberId, Optional customerId, Optional squadId, Optional callId, - Optional page, + Optional page, Optional sortOrder, Optional limit, Optional createdAtGt, @@ -83,6 +86,7 @@ private LogsGetRequest( Map additionalProperties) { this.orgId = orgId; this.type = type; + this.webhookType = webhookType; this.assistantId = assistantId; this.phoneNumberId = phoneNumberId; this.customerId = customerId; @@ -118,6 +122,14 @@ public Optional getType() { return type; } + /** + * @return This is the type of the webhook, given the log is from a webhook. + */ + @JsonProperty("webhookType") + public Optional getWebhookType() { + return webhookType; + } + /** * @return This is the ID of the assistant. */ @@ -162,7 +174,7 @@ public Optional getCallId() { * @return This is the page number to return. Defaults to 1. */ @JsonProperty("page") - public Optional getPage() { + public Optional getPage() { return page; } @@ -260,6 +272,7 @@ public Map getAdditionalProperties() { private boolean equalTo(LogsGetRequest other) { return orgId.equals(other.orgId) && type.equals(other.type) + && webhookType.equals(other.webhookType) && assistantId.equals(other.assistantId) && phoneNumberId.equals(other.phoneNumberId) && customerId.equals(other.customerId) @@ -283,6 +296,7 @@ public int hashCode() { return Objects.hash( this.orgId, this.type, + this.webhookType, this.assistantId, this.phoneNumberId, this.customerId, @@ -316,6 +330,8 @@ public static final class Builder { private Optional type = Optional.empty(); + private Optional webhookType = Optional.empty(); + private Optional assistantId = Optional.empty(); private Optional phoneNumberId = Optional.empty(); @@ -326,7 +342,7 @@ public static final class Builder { private Optional callId = Optional.empty(); - private Optional page = Optional.empty(); + private Optional page = Optional.empty(); private Optional sortOrder = Optional.empty(); @@ -356,6 +372,7 @@ private Builder() {} public Builder from(LogsGetRequest other) { orgId(other.getOrgId()); type(other.getType()); + webhookType(other.getWebhookType()); assistantId(other.getAssistantId()); phoneNumberId(other.getPhoneNumberId()); customerId(other.getCustomerId()); @@ -397,6 +414,17 @@ public Builder type(LogsGetRequestType type) { return this; } + @JsonSetter(value = "webhookType", nulls = Nulls.SKIP) + public Builder webhookType(Optional webhookType) { + this.webhookType = webhookType; + return this; + } + + public Builder webhookType(String webhookType) { + this.webhookType = Optional.ofNullable(webhookType); + return this; + } + @JsonSetter(value = "assistantId", nulls = Nulls.SKIP) public Builder assistantId(Optional assistantId) { this.assistantId = assistantId; @@ -453,12 +481,12 @@ public Builder callId(String callId) { } @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(Optional page) { + public Builder page(Optional page) { this.page = page; return this; } - public Builder page(Integer page) { + public Builder page(Double page) { this.page = Optional.ofNullable(page); return this; } @@ -577,6 +605,7 @@ public LogsGetRequest build() { return new LogsGetRequest( orgId, type, + webhookType, assistantId, phoneNumberId, customerId, diff --git a/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateRequest.java b/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateRequest.java index 2ea0777..0ae946d 100644 --- a/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateRequest.java +++ b/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateRequest.java @@ -11,12 +11,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.CreateBashToolDto; +import com.vapi.api.types.CreateComputerToolDto; import com.vapi.api.types.CreateDtmfToolDto; import com.vapi.api.types.CreateEndCallToolDto; import com.vapi.api.types.CreateFunctionToolDto; import com.vapi.api.types.CreateGhlToolDto; import com.vapi.api.types.CreateMakeToolDto; import com.vapi.api.types.CreateOutputToolDto; +import com.vapi.api.types.CreateTextEditorToolDto; import com.vapi.api.types.CreateTransferCallToolDto; import java.util.Objects; import java.util.Optional; @@ -61,6 +64,18 @@ public static ToolsCreateRequest output(CreateOutputToolDto value) { return new ToolsCreateRequest(new OutputValue(value)); } + public static ToolsCreateRequest bash(CreateBashToolDto value) { + return new ToolsCreateRequest(new BashValue(value)); + } + + public static ToolsCreateRequest computer(CreateComputerToolDto value) { + return new ToolsCreateRequest(new ComputerValue(value)); + } + + public static ToolsCreateRequest textEditor(CreateTextEditorToolDto value) { + return new ToolsCreateRequest(new TextEditorValue(value)); + } + public boolean isDtmf() { return value instanceof DtmfValue; } @@ -89,6 +104,18 @@ public boolean isOutput() { return value instanceof OutputValue; } + public boolean isBash() { + return value instanceof BashValue; + } + + public boolean isComputer() { + return value instanceof ComputerValue; + } + + public boolean isTextEditor() { + return value instanceof TextEditorValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -142,6 +169,27 @@ public Optional getOutput() { return Optional.empty(); } + public Optional getBash() { + if (isBash()) { + return Optional.of(((BashValue) value).value); + } + return Optional.empty(); + } + + public Optional getComputer() { + if (isComputer()) { + return Optional.of(((ComputerValue) value).value); + } + return Optional.empty(); + } + + public Optional getTextEditor() { + if (isTextEditor()) { + return Optional.of(((TextEditorValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -169,6 +217,12 @@ public interface Visitor { T visitOutput(CreateOutputToolDto output); + T visitBash(CreateBashToolDto bash); + + T visitComputer(CreateComputerToolDto computer); + + T visitTextEditor(CreateTextEditorToolDto textEditor); + T _visitUnknown(Object unknownType); } @@ -180,7 +234,10 @@ public interface Visitor { @JsonSubTypes.Type(GhlValue.class), @JsonSubTypes.Type(MakeValue.class), @JsonSubTypes.Type(TransferCallValue.class), - @JsonSubTypes.Type(OutputValue.class) + @JsonSubTypes.Type(OutputValue.class), + @JsonSubTypes.Type(BashValue.class), + @JsonSubTypes.Type(ComputerValue.class), + @JsonSubTypes.Type(TextEditorValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -453,6 +510,120 @@ public String toString() { } } + @JsonTypeName("bash") + private static final class BashValue implements Value { + @JsonUnwrapped + private CreateBashToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BashValue() {} + + private BashValue(CreateBashToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBash(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashValue && equalTo((BashValue) other); + } + + private boolean equalTo(BashValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsCreateRequest{" + "value: " + value + "}"; + } + } + + @JsonTypeName("computer") + private static final class ComputerValue implements Value { + @JsonUnwrapped + private CreateComputerToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ComputerValue() {} + + private ComputerValue(CreateComputerToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComputer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerValue && equalTo((ComputerValue) other); + } + + private boolean equalTo(ComputerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsCreateRequest{" + "value: " + value + "}"; + } + } + + @JsonTypeName("textEditor") + private static final class TextEditorValue implements Value { + @JsonUnwrapped + private CreateTextEditorToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TextEditorValue() {} + + private TextEditorValue(CreateTextEditorToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTextEditor(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorValue && equalTo((TextEditorValue) other); + } + + private boolean equalTo(TextEditorValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsCreateRequest{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateResponse.java b/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateResponse.java index 77b9f5b..d78197b 100644 --- a/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateResponse.java +++ b/src/main/java/com/vapi/api/resources/tools/types/ToolsCreateResponse.java @@ -11,12 +11,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.BashTool; +import com.vapi.api.types.ComputerTool; import com.vapi.api.types.DtmfTool; import com.vapi.api.types.EndCallTool; import com.vapi.api.types.FunctionTool; import com.vapi.api.types.GhlTool; import com.vapi.api.types.MakeTool; import com.vapi.api.types.OutputTool; +import com.vapi.api.types.TextEditorTool; import com.vapi.api.types.TransferCallTool; import java.util.Objects; import java.util.Optional; @@ -61,6 +64,18 @@ public static ToolsCreateResponse output(OutputTool value) { return new ToolsCreateResponse(new OutputValue(value)); } + public static ToolsCreateResponse bash(BashTool value) { + return new ToolsCreateResponse(new BashValue(value)); + } + + public static ToolsCreateResponse computer(ComputerTool value) { + return new ToolsCreateResponse(new ComputerValue(value)); + } + + public static ToolsCreateResponse textEditor(TextEditorTool value) { + return new ToolsCreateResponse(new TextEditorValue(value)); + } + public boolean isDtmf() { return value instanceof DtmfValue; } @@ -89,6 +104,18 @@ public boolean isOutput() { return value instanceof OutputValue; } + public boolean isBash() { + return value instanceof BashValue; + } + + public boolean isComputer() { + return value instanceof ComputerValue; + } + + public boolean isTextEditor() { + return value instanceof TextEditorValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -142,6 +169,27 @@ public Optional getOutput() { return Optional.empty(); } + public Optional getBash() { + if (isBash()) { + return Optional.of(((BashValue) value).value); + } + return Optional.empty(); + } + + public Optional getComputer() { + if (isComputer()) { + return Optional.of(((ComputerValue) value).value); + } + return Optional.empty(); + } + + public Optional getTextEditor() { + if (isTextEditor()) { + return Optional.of(((TextEditorValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -169,6 +217,12 @@ public interface Visitor { T visitOutput(OutputTool output); + T visitBash(BashTool bash); + + T visitComputer(ComputerTool computer); + + T visitTextEditor(TextEditorTool textEditor); + T _visitUnknown(Object unknownType); } @@ -180,7 +234,10 @@ public interface Visitor { @JsonSubTypes.Type(GhlValue.class), @JsonSubTypes.Type(MakeValue.class), @JsonSubTypes.Type(TransferCallValue.class), - @JsonSubTypes.Type(OutputValue.class) + @JsonSubTypes.Type(OutputValue.class), + @JsonSubTypes.Type(BashValue.class), + @JsonSubTypes.Type(ComputerValue.class), + @JsonSubTypes.Type(TextEditorValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -453,6 +510,120 @@ public String toString() { } } + @JsonTypeName("bash") + private static final class BashValue implements Value { + @JsonUnwrapped + private BashTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BashValue() {} + + private BashValue(BashTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBash(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashValue && equalTo((BashValue) other); + } + + private boolean equalTo(BashValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsCreateResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("computer") + private static final class ComputerValue implements Value { + @JsonUnwrapped + private ComputerTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ComputerValue() {} + + private ComputerValue(ComputerTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComputer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerValue && equalTo((ComputerValue) other); + } + + private boolean equalTo(ComputerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsCreateResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("textEditor") + private static final class TextEditorValue implements Value { + @JsonUnwrapped + private TextEditorTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TextEditorValue() {} + + private TextEditorValue(TextEditorTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTextEditor(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorValue && equalTo((TextEditorValue) other); + } + + private boolean equalTo(TextEditorValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsCreateResponse{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/tools/types/ToolsDeleteResponse.java b/src/main/java/com/vapi/api/resources/tools/types/ToolsDeleteResponse.java index dad6055..aac5d96 100644 --- a/src/main/java/com/vapi/api/resources/tools/types/ToolsDeleteResponse.java +++ b/src/main/java/com/vapi/api/resources/tools/types/ToolsDeleteResponse.java @@ -11,12 +11,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.BashTool; +import com.vapi.api.types.ComputerTool; import com.vapi.api.types.DtmfTool; import com.vapi.api.types.EndCallTool; import com.vapi.api.types.FunctionTool; import com.vapi.api.types.GhlTool; import com.vapi.api.types.MakeTool; import com.vapi.api.types.OutputTool; +import com.vapi.api.types.TextEditorTool; import com.vapi.api.types.TransferCallTool; import java.util.Objects; import java.util.Optional; @@ -61,6 +64,18 @@ public static ToolsDeleteResponse output(OutputTool value) { return new ToolsDeleteResponse(new OutputValue(value)); } + public static ToolsDeleteResponse bash(BashTool value) { + return new ToolsDeleteResponse(new BashValue(value)); + } + + public static ToolsDeleteResponse computer(ComputerTool value) { + return new ToolsDeleteResponse(new ComputerValue(value)); + } + + public static ToolsDeleteResponse textEditor(TextEditorTool value) { + return new ToolsDeleteResponse(new TextEditorValue(value)); + } + public boolean isDtmf() { return value instanceof DtmfValue; } @@ -89,6 +104,18 @@ public boolean isOutput() { return value instanceof OutputValue; } + public boolean isBash() { + return value instanceof BashValue; + } + + public boolean isComputer() { + return value instanceof ComputerValue; + } + + public boolean isTextEditor() { + return value instanceof TextEditorValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -142,6 +169,27 @@ public Optional getOutput() { return Optional.empty(); } + public Optional getBash() { + if (isBash()) { + return Optional.of(((BashValue) value).value); + } + return Optional.empty(); + } + + public Optional getComputer() { + if (isComputer()) { + return Optional.of(((ComputerValue) value).value); + } + return Optional.empty(); + } + + public Optional getTextEditor() { + if (isTextEditor()) { + return Optional.of(((TextEditorValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -169,6 +217,12 @@ public interface Visitor { T visitOutput(OutputTool output); + T visitBash(BashTool bash); + + T visitComputer(ComputerTool computer); + + T visitTextEditor(TextEditorTool textEditor); + T _visitUnknown(Object unknownType); } @@ -180,7 +234,10 @@ public interface Visitor { @JsonSubTypes.Type(GhlValue.class), @JsonSubTypes.Type(MakeValue.class), @JsonSubTypes.Type(TransferCallValue.class), - @JsonSubTypes.Type(OutputValue.class) + @JsonSubTypes.Type(OutputValue.class), + @JsonSubTypes.Type(BashValue.class), + @JsonSubTypes.Type(ComputerValue.class), + @JsonSubTypes.Type(TextEditorValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -453,6 +510,120 @@ public String toString() { } } + @JsonTypeName("bash") + private static final class BashValue implements Value { + @JsonUnwrapped + private BashTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BashValue() {} + + private BashValue(BashTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBash(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashValue && equalTo((BashValue) other); + } + + private boolean equalTo(BashValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsDeleteResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("computer") + private static final class ComputerValue implements Value { + @JsonUnwrapped + private ComputerTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ComputerValue() {} + + private ComputerValue(ComputerTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComputer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerValue && equalTo((ComputerValue) other); + } + + private boolean equalTo(ComputerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsDeleteResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("textEditor") + private static final class TextEditorValue implements Value { + @JsonUnwrapped + private TextEditorTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TextEditorValue() {} + + private TextEditorValue(TextEditorTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTextEditor(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorValue && equalTo((TextEditorValue) other); + } + + private boolean equalTo(TextEditorValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsDeleteResponse{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/tools/types/ToolsGetResponse.java b/src/main/java/com/vapi/api/resources/tools/types/ToolsGetResponse.java index 3649efa..cd5af54 100644 --- a/src/main/java/com/vapi/api/resources/tools/types/ToolsGetResponse.java +++ b/src/main/java/com/vapi/api/resources/tools/types/ToolsGetResponse.java @@ -11,12 +11,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.BashTool; +import com.vapi.api.types.ComputerTool; import com.vapi.api.types.DtmfTool; import com.vapi.api.types.EndCallTool; import com.vapi.api.types.FunctionTool; import com.vapi.api.types.GhlTool; import com.vapi.api.types.MakeTool; import com.vapi.api.types.OutputTool; +import com.vapi.api.types.TextEditorTool; import com.vapi.api.types.TransferCallTool; import java.util.Objects; import java.util.Optional; @@ -61,6 +64,18 @@ public static ToolsGetResponse output(OutputTool value) { return new ToolsGetResponse(new OutputValue(value)); } + public static ToolsGetResponse bash(BashTool value) { + return new ToolsGetResponse(new BashValue(value)); + } + + public static ToolsGetResponse computer(ComputerTool value) { + return new ToolsGetResponse(new ComputerValue(value)); + } + + public static ToolsGetResponse textEditor(TextEditorTool value) { + return new ToolsGetResponse(new TextEditorValue(value)); + } + public boolean isDtmf() { return value instanceof DtmfValue; } @@ -89,6 +104,18 @@ public boolean isOutput() { return value instanceof OutputValue; } + public boolean isBash() { + return value instanceof BashValue; + } + + public boolean isComputer() { + return value instanceof ComputerValue; + } + + public boolean isTextEditor() { + return value instanceof TextEditorValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -142,6 +169,27 @@ public Optional getOutput() { return Optional.empty(); } + public Optional getBash() { + if (isBash()) { + return Optional.of(((BashValue) value).value); + } + return Optional.empty(); + } + + public Optional getComputer() { + if (isComputer()) { + return Optional.of(((ComputerValue) value).value); + } + return Optional.empty(); + } + + public Optional getTextEditor() { + if (isTextEditor()) { + return Optional.of(((TextEditorValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -169,6 +217,12 @@ public interface Visitor { T visitOutput(OutputTool output); + T visitBash(BashTool bash); + + T visitComputer(ComputerTool computer); + + T visitTextEditor(TextEditorTool textEditor); + T _visitUnknown(Object unknownType); } @@ -180,7 +234,10 @@ public interface Visitor { @JsonSubTypes.Type(GhlValue.class), @JsonSubTypes.Type(MakeValue.class), @JsonSubTypes.Type(TransferCallValue.class), - @JsonSubTypes.Type(OutputValue.class) + @JsonSubTypes.Type(OutputValue.class), + @JsonSubTypes.Type(BashValue.class), + @JsonSubTypes.Type(ComputerValue.class), + @JsonSubTypes.Type(TextEditorValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -453,6 +510,120 @@ public String toString() { } } + @JsonTypeName("bash") + private static final class BashValue implements Value { + @JsonUnwrapped + private BashTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BashValue() {} + + private BashValue(BashTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBash(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashValue && equalTo((BashValue) other); + } + + private boolean equalTo(BashValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsGetResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("computer") + private static final class ComputerValue implements Value { + @JsonUnwrapped + private ComputerTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ComputerValue() {} + + private ComputerValue(ComputerTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComputer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerValue && equalTo((ComputerValue) other); + } + + private boolean equalTo(ComputerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsGetResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("textEditor") + private static final class TextEditorValue implements Value { + @JsonUnwrapped + private TextEditorTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TextEditorValue() {} + + private TextEditorValue(TextEditorTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTextEditor(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorValue && equalTo((TextEditorValue) other); + } + + private boolean equalTo(TextEditorValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsGetResponse{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/tools/types/ToolsListResponseItem.java b/src/main/java/com/vapi/api/resources/tools/types/ToolsListResponseItem.java index ea26199..93a6753 100644 --- a/src/main/java/com/vapi/api/resources/tools/types/ToolsListResponseItem.java +++ b/src/main/java/com/vapi/api/resources/tools/types/ToolsListResponseItem.java @@ -11,12 +11,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.BashTool; +import com.vapi.api.types.ComputerTool; import com.vapi.api.types.DtmfTool; import com.vapi.api.types.EndCallTool; import com.vapi.api.types.FunctionTool; import com.vapi.api.types.GhlTool; import com.vapi.api.types.MakeTool; import com.vapi.api.types.OutputTool; +import com.vapi.api.types.TextEditorTool; import com.vapi.api.types.TransferCallTool; import java.util.Objects; import java.util.Optional; @@ -61,6 +64,18 @@ public static ToolsListResponseItem output(OutputTool value) { return new ToolsListResponseItem(new OutputValue(value)); } + public static ToolsListResponseItem bash(BashTool value) { + return new ToolsListResponseItem(new BashValue(value)); + } + + public static ToolsListResponseItem computer(ComputerTool value) { + return new ToolsListResponseItem(new ComputerValue(value)); + } + + public static ToolsListResponseItem textEditor(TextEditorTool value) { + return new ToolsListResponseItem(new TextEditorValue(value)); + } + public boolean isDtmf() { return value instanceof DtmfValue; } @@ -89,6 +104,18 @@ public boolean isOutput() { return value instanceof OutputValue; } + public boolean isBash() { + return value instanceof BashValue; + } + + public boolean isComputer() { + return value instanceof ComputerValue; + } + + public boolean isTextEditor() { + return value instanceof TextEditorValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -142,6 +169,27 @@ public Optional getOutput() { return Optional.empty(); } + public Optional getBash() { + if (isBash()) { + return Optional.of(((BashValue) value).value); + } + return Optional.empty(); + } + + public Optional getComputer() { + if (isComputer()) { + return Optional.of(((ComputerValue) value).value); + } + return Optional.empty(); + } + + public Optional getTextEditor() { + if (isTextEditor()) { + return Optional.of(((TextEditorValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -169,6 +217,12 @@ public interface Visitor { T visitOutput(OutputTool output); + T visitBash(BashTool bash); + + T visitComputer(ComputerTool computer); + + T visitTextEditor(TextEditorTool textEditor); + T _visitUnknown(Object unknownType); } @@ -180,7 +234,10 @@ public interface Visitor { @JsonSubTypes.Type(GhlValue.class), @JsonSubTypes.Type(MakeValue.class), @JsonSubTypes.Type(TransferCallValue.class), - @JsonSubTypes.Type(OutputValue.class) + @JsonSubTypes.Type(OutputValue.class), + @JsonSubTypes.Type(BashValue.class), + @JsonSubTypes.Type(ComputerValue.class), + @JsonSubTypes.Type(TextEditorValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -453,6 +510,120 @@ public String toString() { } } + @JsonTypeName("bash") + private static final class BashValue implements Value { + @JsonUnwrapped + private BashTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BashValue() {} + + private BashValue(BashTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBash(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashValue && equalTo((BashValue) other); + } + + private boolean equalTo(BashValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsListResponseItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("computer") + private static final class ComputerValue implements Value { + @JsonUnwrapped + private ComputerTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ComputerValue() {} + + private ComputerValue(ComputerTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComputer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerValue && equalTo((ComputerValue) other); + } + + private boolean equalTo(ComputerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsListResponseItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("textEditor") + private static final class TextEditorValue implements Value { + @JsonUnwrapped + private TextEditorTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TextEditorValue() {} + + private TextEditorValue(TextEditorTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTextEditor(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorValue && equalTo((TextEditorValue) other); + } + + private boolean equalTo(TextEditorValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsListResponseItem{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/tools/types/ToolsUpdateResponse.java b/src/main/java/com/vapi/api/resources/tools/types/ToolsUpdateResponse.java index 220f09f..2c08336 100644 --- a/src/main/java/com/vapi/api/resources/tools/types/ToolsUpdateResponse.java +++ b/src/main/java/com/vapi/api/resources/tools/types/ToolsUpdateResponse.java @@ -11,12 +11,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.vapi.api.types.BashTool; +import com.vapi.api.types.ComputerTool; import com.vapi.api.types.DtmfTool; import com.vapi.api.types.EndCallTool; import com.vapi.api.types.FunctionTool; import com.vapi.api.types.GhlTool; import com.vapi.api.types.MakeTool; import com.vapi.api.types.OutputTool; +import com.vapi.api.types.TextEditorTool; import com.vapi.api.types.TransferCallTool; import java.util.Objects; import java.util.Optional; @@ -61,6 +64,18 @@ public static ToolsUpdateResponse output(OutputTool value) { return new ToolsUpdateResponse(new OutputValue(value)); } + public static ToolsUpdateResponse bash(BashTool value) { + return new ToolsUpdateResponse(new BashValue(value)); + } + + public static ToolsUpdateResponse computer(ComputerTool value) { + return new ToolsUpdateResponse(new ComputerValue(value)); + } + + public static ToolsUpdateResponse textEditor(TextEditorTool value) { + return new ToolsUpdateResponse(new TextEditorValue(value)); + } + public boolean isDtmf() { return value instanceof DtmfValue; } @@ -89,6 +104,18 @@ public boolean isOutput() { return value instanceof OutputValue; } + public boolean isBash() { + return value instanceof BashValue; + } + + public boolean isComputer() { + return value instanceof ComputerValue; + } + + public boolean isTextEditor() { + return value instanceof TextEditorValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -142,6 +169,27 @@ public Optional getOutput() { return Optional.empty(); } + public Optional getBash() { + if (isBash()) { + return Optional.of(((BashValue) value).value); + } + return Optional.empty(); + } + + public Optional getComputer() { + if (isComputer()) { + return Optional.of(((ComputerValue) value).value); + } + return Optional.empty(); + } + + public Optional getTextEditor() { + if (isTextEditor()) { + return Optional.of(((TextEditorValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -169,6 +217,12 @@ public interface Visitor { T visitOutput(OutputTool output); + T visitBash(BashTool bash); + + T visitComputer(ComputerTool computer); + + T visitTextEditor(TextEditorTool textEditor); + T _visitUnknown(Object unknownType); } @@ -180,7 +234,10 @@ public interface Visitor { @JsonSubTypes.Type(GhlValue.class), @JsonSubTypes.Type(MakeValue.class), @JsonSubTypes.Type(TransferCallValue.class), - @JsonSubTypes.Type(OutputValue.class) + @JsonSubTypes.Type(OutputValue.class), + @JsonSubTypes.Type(BashValue.class), + @JsonSubTypes.Type(ComputerValue.class), + @JsonSubTypes.Type(TextEditorValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -453,6 +510,120 @@ public String toString() { } } + @JsonTypeName("bash") + private static final class BashValue implements Value { + @JsonUnwrapped + private BashTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BashValue() {} + + private BashValue(BashTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBash(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashValue && equalTo((BashValue) other); + } + + private boolean equalTo(BashValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsUpdateResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("computer") + private static final class ComputerValue implements Value { + @JsonUnwrapped + private ComputerTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ComputerValue() {} + + private ComputerValue(ComputerTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComputer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerValue && equalTo((ComputerValue) other); + } + + private boolean equalTo(ComputerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsUpdateResponse{" + "value: " + value + "}"; + } + } + + @JsonTypeName("textEditor") + private static final class TextEditorValue implements Value { + @JsonUnwrapped + private TextEditorTool value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TextEditorValue() {} + + private TextEditorValue(TextEditorTool value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTextEditor(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorValue && equalTo((TextEditorValue) other); + } + + private boolean equalTo(TextEditorValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ToolsUpdateResponse{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/resources/analytics/requests/AnalyticsQueryDto.java b/src/main/java/com/vapi/api/types/AnalyticsQueryDto.java similarity index 97% rename from src/main/java/com/vapi/api/resources/analytics/requests/AnalyticsQueryDto.java rename to src/main/java/com/vapi/api/types/AnalyticsQueryDto.java index 7be1a78..89af942 100644 --- a/src/main/java/com/vapi/api/resources/analytics/requests/AnalyticsQueryDto.java +++ b/src/main/java/com/vapi/api/types/AnalyticsQueryDto.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.vapi.api.resources.analytics.requests; +package com.vapi.api.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; -import com.vapi.api.types.AnalyticsQuery; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/com/vapi/api/types/AnthropicCredential.java b/src/main/java/com/vapi/api/types/AnthropicCredential.java index c184235..3e94942 100644 --- a/src/main/java/com/vapi/api/types/AnthropicCredential.java +++ b/src/main/java/com/vapi/api/types/AnthropicCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class AnthropicCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private AnthropicCredential( @@ -38,12 +42,14 @@ private AnthropicCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(AnthropicCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { AnthropicCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(AnthropicCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public AnthropicCredential build() { - return new AnthropicCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new AnthropicCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/AnthropicModel.java b/src/main/java/com/vapi/api/types/AnthropicModel.java index f2e4298..93ce8c4 100644 --- a/src/main/java/com/vapi/api/types/AnthropicModel.java +++ b/src/main/java/com/vapi/api/types/AnthropicModel.java @@ -28,12 +28,14 @@ public final class AnthropicModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final AnthropicModelModel model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private AnthropicModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, AnthropicModelModel model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private AnthropicModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the Anthropic/Claude models that will be used. */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(AnthropicModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(AnthropicModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

These are the options for the knowledge base.

+ *

This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

+ *

This is the ID of the knowledge base the model will use.

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

These are the options for the knowledge base.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public AnthropicModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/AnthropicModelModel.java b/src/main/java/com/vapi/api/types/AnthropicModelModel.java index cddb17e..cc4d2d7 100644 --- a/src/main/java/com/vapi/api/types/AnthropicModelModel.java +++ b/src/main/java/com/vapi/api/types/AnthropicModelModel.java @@ -12,7 +12,11 @@ public enum AnthropicModelModel { CLAUDE_3_HAIKU_20240307("claude-3-haiku-20240307"), - CLAUDE_35_SONNET_20240620("claude-3-5-sonnet-20240620"); + CLAUDE_35_SONNET_20240620("claude-3-5-sonnet-20240620"), + + CLAUDE_35_SONNET_20241022("claude-3-5-sonnet-20241022"), + + CLAUDE_35_HAIKU_20241022("claude-3-5-haiku-20241022"); private final String value; diff --git a/src/main/java/com/vapi/api/types/AnyscaleCredential.java b/src/main/java/com/vapi/api/types/AnyscaleCredential.java index 09ff28f..6bebfda 100644 --- a/src/main/java/com/vapi/api/types/AnyscaleCredential.java +++ b/src/main/java/com/vapi/api/types/AnyscaleCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class AnyscaleCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private AnyscaleCredential( @@ -38,12 +42,14 @@ private AnyscaleCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(AnyscaleCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { AnyscaleCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(AnyscaleCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public AnyscaleCredential build() { - return new AnyscaleCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new AnyscaleCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/AnyscaleModel.java b/src/main/java/com/vapi/api/types/AnyscaleModel.java index ddcfcd5..3398a75 100644 --- a/src/main/java/com/vapi/api/types/AnyscaleModel.java +++ b/src/main/java/com/vapi/api/types/AnyscaleModel.java @@ -28,12 +28,14 @@ public final class AnyscaleModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final String model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private AnyscaleModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private AnyscaleModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(AnyscaleModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(AnyscaleModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

These are the options for the knowledge base.

+ *

This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

+ *

This is the ID of the knowledge base the model will use.

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

These are the options for the knowledge base.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public AnyscaleModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/AssemblyAiCredential.java b/src/main/java/com/vapi/api/types/AssemblyAiCredential.java new file mode 100644 index 0000000..26604d6 --- /dev/null +++ b/src/main/java/com/vapi/api/types/AssemblyAiCredential.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssemblyAiCredential.Builder.class) +public final class AssemblyAiCredential { + private final String apiKey; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private AssemblyAiCredential( + String apiKey, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.apiKey = apiKey; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "assembly-ai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssemblyAiCredential && equalTo((AssemblyAiCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssemblyAiCredential other) { + return apiKey.equals(other.apiKey) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + IdStage apiKey(@NotNull String apiKey); + + Builder from(AssemblyAiCredential other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + AssemblyAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ApiKeyStage, IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String apiKey; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AssemblyAiCredential other) { + apiKey(other.getApiKey()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

This is not returned in the API.

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

This is the unique identifier for the credential.

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

This is the unique identifier for the org that this credential belongs to.

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

This is the ISO 8601 date-time string of when the credential was created.

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

This is the ISO 8601 date-time string of when the assistant was last updated.

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

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public AssemblyAiCredential build() { + return new AssemblyAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/AssemblyAiTranscriber.java b/src/main/java/com/vapi/api/types/AssemblyAiTranscriber.java new file mode 100644 index 0000000..fe35941 --- /dev/null +++ b/src/main/java/com/vapi/api/types/AssemblyAiTranscriber.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssemblyAiTranscriber.Builder.class) +public final class AssemblyAiTranscriber { + private final Optional language; + + private final Optional realtimeUrl; + + private final Optional> wordBoost; + + private final Optional endUtteranceSilenceThreshold; + + private final Optional disablePartialTranscripts; + + private final Map additionalProperties; + + private AssemblyAiTranscriber( + Optional language, + Optional realtimeUrl, + Optional> wordBoost, + Optional endUtteranceSilenceThreshold, + Optional disablePartialTranscripts, + Map additionalProperties) { + this.language = language; + this.realtimeUrl = realtimeUrl; + this.wordBoost = wordBoost; + this.endUtteranceSilenceThreshold = endUtteranceSilenceThreshold; + this.disablePartialTranscripts = disablePartialTranscripts; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the language that will be set for the transcription. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The WebSocket URL that the transcriber connects to. + */ + @JsonProperty("realtimeUrl") + public Optional getRealtimeUrl() { + return realtimeUrl; + } + + /** + * @return Add up to 2500 characters of custom vocabulary. + */ + @JsonProperty("wordBoost") + public Optional> getWordBoost() { + return wordBoost; + } + + /** + * @return The duration of the end utterance silence threshold in milliseconds. + */ + @JsonProperty("endUtteranceSilenceThreshold") + public Optional getEndUtteranceSilenceThreshold() { + return endUtteranceSilenceThreshold; + } + + /** + * @return Disable partial transcripts. + * Set to true to not receive partial transcripts. Defaults to false. + */ + @JsonProperty("disablePartialTranscripts") + public Optional getDisablePartialTranscripts() { + return disablePartialTranscripts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssemblyAiTranscriber && equalTo((AssemblyAiTranscriber) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssemblyAiTranscriber other) { + return language.equals(other.language) + && realtimeUrl.equals(other.realtimeUrl) + && wordBoost.equals(other.wordBoost) + && endUtteranceSilenceThreshold.equals(other.endUtteranceSilenceThreshold) + && disablePartialTranscripts.equals(other.disablePartialTranscripts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.language, + this.realtimeUrl, + this.wordBoost, + this.endUtteranceSilenceThreshold, + this.disablePartialTranscripts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional language = Optional.empty(); + + private Optional realtimeUrl = Optional.empty(); + + private Optional> wordBoost = Optional.empty(); + + private Optional endUtteranceSilenceThreshold = Optional.empty(); + + private Optional disablePartialTranscripts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssemblyAiTranscriber other) { + language(other.getLanguage()); + realtimeUrl(other.getRealtimeUrl()); + wordBoost(other.getWordBoost()); + endUtteranceSilenceThreshold(other.getEndUtteranceSilenceThreshold()); + disablePartialTranscripts(other.getDisablePartialTranscripts()); + return this; + } + + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public Builder language(Optional language) { + this.language = language; + return this; + } + + public Builder language(String language) { + this.language = Optional.ofNullable(language); + return this; + } + + @JsonSetter(value = "realtimeUrl", nulls = Nulls.SKIP) + public Builder realtimeUrl(Optional realtimeUrl) { + this.realtimeUrl = realtimeUrl; + return this; + } + + public Builder realtimeUrl(String realtimeUrl) { + this.realtimeUrl = Optional.ofNullable(realtimeUrl); + return this; + } + + @JsonSetter(value = "wordBoost", nulls = Nulls.SKIP) + public Builder wordBoost(Optional> wordBoost) { + this.wordBoost = wordBoost; + return this; + } + + public Builder wordBoost(List wordBoost) { + this.wordBoost = Optional.ofNullable(wordBoost); + return this; + } + + @JsonSetter(value = "endUtteranceSilenceThreshold", nulls = Nulls.SKIP) + public Builder endUtteranceSilenceThreshold(Optional endUtteranceSilenceThreshold) { + this.endUtteranceSilenceThreshold = endUtteranceSilenceThreshold; + return this; + } + + public Builder endUtteranceSilenceThreshold(Double endUtteranceSilenceThreshold) { + this.endUtteranceSilenceThreshold = Optional.ofNullable(endUtteranceSilenceThreshold); + return this; + } + + @JsonSetter(value = "disablePartialTranscripts", nulls = Nulls.SKIP) + public Builder disablePartialTranscripts(Optional disablePartialTranscripts) { + this.disablePartialTranscripts = disablePartialTranscripts; + return this; + } + + public Builder disablePartialTranscripts(Boolean disablePartialTranscripts) { + this.disablePartialTranscripts = Optional.ofNullable(disablePartialTranscripts); + return this; + } + + public AssemblyAiTranscriber build() { + return new AssemblyAiTranscriber( + language, + realtimeUrl, + wordBoost, + endUtteranceSilenceThreshold, + disablePartialTranscripts, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/Assistant.java b/src/main/java/com/vapi/api/types/Assistant.java index dabb520..ef65c69 100644 --- a/src/main/java/com/vapi/api/types/Assistant.java +++ b/src/main/java/com/vapi/api/types/Assistant.java @@ -29,6 +29,8 @@ public final class Assistant { private final Optional voice; + private final Optional firstMessage; + private final Optional firstMessageMode; private final Optional hipaaEnabled; @@ -43,8 +45,6 @@ public final class Assistant { private final Optional backgroundSound; - private final Optional backchannelingEnabled; - private final Optional backgroundDenoisingEnabled; private final Optional modelOutputInMessagesEnabled; @@ -53,8 +53,6 @@ public final class Assistant { private final Optional name; - private final Optional firstMessage; - private final Optional voicemailDetection; private final Optional voicemailMessage; @@ -65,10 +63,6 @@ public final class Assistant { private final Optional> metadata; - private final Optional serverUrl; - - private final Optional serverUrlSecret; - private final Optional analysisPlan; private final Optional artifactPlan; @@ -83,6 +77,8 @@ public final class Assistant { private final Optional> credentialIds; + private final Optional server; + private final String id; private final String orgId; @@ -97,6 +93,7 @@ private Assistant( Optional transcriber, Optional model, Optional voice, + Optional firstMessage, Optional firstMessageMode, Optional hipaaEnabled, Optional> clientMessages, @@ -104,19 +101,15 @@ private Assistant( Optional silenceTimeoutSeconds, Optional maxDurationSeconds, Optional backgroundSound, - Optional backchannelingEnabled, Optional backgroundDenoisingEnabled, Optional modelOutputInMessagesEnabled, Optional> transportConfigurations, Optional name, - Optional firstMessage, Optional voicemailDetection, Optional voicemailMessage, Optional endCallMessage, Optional> endCallPhrases, Optional> metadata, - Optional serverUrl, - Optional serverUrlSecret, Optional analysisPlan, Optional artifactPlan, Optional messagePlan, @@ -124,6 +117,7 @@ private Assistant( Optional stopSpeakingPlan, Optional monitorPlan, Optional> credentialIds, + Optional server, String id, String orgId, OffsetDateTime createdAt, @@ -132,6 +126,7 @@ private Assistant( this.transcriber = transcriber; this.model = model; this.voice = voice; + this.firstMessage = firstMessage; this.firstMessageMode = firstMessageMode; this.hipaaEnabled = hipaaEnabled; this.clientMessages = clientMessages; @@ -139,19 +134,15 @@ private Assistant( this.silenceTimeoutSeconds = silenceTimeoutSeconds; this.maxDurationSeconds = maxDurationSeconds; this.backgroundSound = backgroundSound; - this.backchannelingEnabled = backchannelingEnabled; this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; this.modelOutputInMessagesEnabled = modelOutputInMessagesEnabled; this.transportConfigurations = transportConfigurations; this.name = name; - this.firstMessage = firstMessage; this.voicemailDetection = voicemailDetection; this.voicemailMessage = voicemailMessage; this.endCallMessage = endCallMessage; this.endCallPhrases = endCallPhrases; this.metadata = metadata; - this.serverUrl = serverUrl; - this.serverUrlSecret = serverUrlSecret; this.analysisPlan = analysisPlan; this.artifactPlan = artifactPlan; this.messagePlan = messagePlan; @@ -159,6 +150,7 @@ private Assistant( this.stopSpeakingPlan = stopSpeakingPlan; this.monitorPlan = monitorPlan; this.credentialIds = credentialIds; + this.server = server; this.id = id; this.orgId = orgId; this.createdAt = createdAt; @@ -190,6 +182,15 @@ public Optional getVoice() { return voice; } + /** + * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

+ */ + @JsonProperty("firstMessage") + public Optional getFirstMessage() { + return firstMessage; + } + /** * @return This is the mode for the first message. Default is 'assistant-speaks-first'. *

Use:

@@ -214,7 +215,7 @@ public Optional getHipaaEnabled() { } /** - * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. */ @JsonProperty("clientMessages") public Optional> getClientMessages() { @@ -255,16 +256,6 @@ public Optional getBackgroundSound() { return backgroundSound; } - /** - * @return This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. - *

Default false while in beta.

- *

@default false

- */ - @JsonProperty("backchannelingEnabled") - public Optional getBackchannelingEnabled() { - return backchannelingEnabled; - } - /** * @return This enables filtering of noise and background speech while the user is talking. *

Default false while in beta.

@@ -302,15 +293,6 @@ public Optional getName() { return name; } - /** - * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). - *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

- */ - @JsonProperty("firstMessage") - public Optional getFirstMessage() { - return firstMessage; - } - /** * @return These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. * This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. @@ -355,25 +337,6 @@ public Optional> getMetadata() { return metadata; } - /** - * @return This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. - *

All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

- *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl

- */ - @JsonProperty("serverUrl") - public Optional getServerUrl() { - return serverUrl; - } - - /** - * @return This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. - *

Same precedence logic as serverUrl.

- */ - @JsonProperty("serverUrlSecret") - public Optional getServerUrlSecret() { - return serverUrlSecret; - } - /** * @return This is the plan for analysis of assistant's calls. Stored in call.analysis. */ @@ -452,6 +415,20 @@ public Optional> getCredentialIds() { return credentialIds; } + /** + * @return This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + *

The order of precedence is:

+ *
    + *
  1. assistant.server.url
  2. + *
  3. phoneNumber.serverUrl
  4. + *
  5. org.serverUrl
  6. + *
+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + /** * @return This is the unique identifier for the assistant. */ @@ -499,6 +476,7 @@ private boolean equalTo(Assistant other) { return transcriber.equals(other.transcriber) && model.equals(other.model) && voice.equals(other.voice) + && firstMessage.equals(other.firstMessage) && firstMessageMode.equals(other.firstMessageMode) && hipaaEnabled.equals(other.hipaaEnabled) && clientMessages.equals(other.clientMessages) @@ -506,19 +484,15 @@ private boolean equalTo(Assistant other) { && silenceTimeoutSeconds.equals(other.silenceTimeoutSeconds) && maxDurationSeconds.equals(other.maxDurationSeconds) && backgroundSound.equals(other.backgroundSound) - && backchannelingEnabled.equals(other.backchannelingEnabled) && backgroundDenoisingEnabled.equals(other.backgroundDenoisingEnabled) && modelOutputInMessagesEnabled.equals(other.modelOutputInMessagesEnabled) && transportConfigurations.equals(other.transportConfigurations) && name.equals(other.name) - && firstMessage.equals(other.firstMessage) && voicemailDetection.equals(other.voicemailDetection) && voicemailMessage.equals(other.voicemailMessage) && endCallMessage.equals(other.endCallMessage) && endCallPhrases.equals(other.endCallPhrases) && metadata.equals(other.metadata) - && serverUrl.equals(other.serverUrl) - && serverUrlSecret.equals(other.serverUrlSecret) && analysisPlan.equals(other.analysisPlan) && artifactPlan.equals(other.artifactPlan) && messagePlan.equals(other.messagePlan) @@ -526,6 +500,7 @@ private boolean equalTo(Assistant other) { && stopSpeakingPlan.equals(other.stopSpeakingPlan) && monitorPlan.equals(other.monitorPlan) && credentialIds.equals(other.credentialIds) + && server.equals(other.server) && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) @@ -538,6 +513,7 @@ public int hashCode() { this.transcriber, this.model, this.voice, + this.firstMessage, this.firstMessageMode, this.hipaaEnabled, this.clientMessages, @@ -545,19 +521,15 @@ public int hashCode() { this.silenceTimeoutSeconds, this.maxDurationSeconds, this.backgroundSound, - this.backchannelingEnabled, this.backgroundDenoisingEnabled, this.modelOutputInMessagesEnabled, this.transportConfigurations, this.name, - this.firstMessage, this.voicemailDetection, this.voicemailMessage, this.endCallMessage, this.endCallPhrases, this.metadata, - this.serverUrl, - this.serverUrlSecret, this.analysisPlan, this.artifactPlan, this.messagePlan, @@ -565,6 +537,7 @@ public int hashCode() { this.stopSpeakingPlan, this.monitorPlan, this.credentialIds, + this.server, this.id, this.orgId, this.createdAt, @@ -613,6 +586,10 @@ public interface _FinalStage { _FinalStage voice(AssistantVoice voice); + _FinalStage firstMessage(Optional firstMessage); + + _FinalStage firstMessage(String firstMessage); + _FinalStage firstMessageMode(Optional firstMessageMode); _FinalStage firstMessageMode(AssistantFirstMessageMode firstMessageMode); @@ -641,10 +618,6 @@ public interface _FinalStage { _FinalStage backgroundSound(AssistantBackgroundSound backgroundSound); - _FinalStage backchannelingEnabled(Optional backchannelingEnabled); - - _FinalStage backchannelingEnabled(Boolean backchannelingEnabled); - _FinalStage backgroundDenoisingEnabled(Optional backgroundDenoisingEnabled); _FinalStage backgroundDenoisingEnabled(Boolean backgroundDenoisingEnabled); @@ -661,10 +634,6 @@ public interface _FinalStage { _FinalStage name(String name); - _FinalStage firstMessage(Optional firstMessage); - - _FinalStage firstMessage(String firstMessage); - _FinalStage voicemailDetection(Optional voicemailDetection); _FinalStage voicemailDetection(TwilioVoicemailDetection voicemailDetection); @@ -685,14 +654,6 @@ public interface _FinalStage { _FinalStage metadata(Map metadata); - _FinalStage serverUrl(Optional serverUrl); - - _FinalStage serverUrl(String serverUrl); - - _FinalStage serverUrlSecret(Optional serverUrlSecret); - - _FinalStage serverUrlSecret(String serverUrlSecret); - _FinalStage analysisPlan(Optional analysisPlan); _FinalStage analysisPlan(AnalysisPlan analysisPlan); @@ -720,6 +681,10 @@ public interface _FinalStage { _FinalStage credentialIds(Optional> credentialIds); _FinalStage credentialIds(List credentialIds); + + _FinalStage server(Optional server); + + _FinalStage server(Server server); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -732,6 +697,8 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private OffsetDateTime updatedAt; + private Optional server = Optional.empty(); + private Optional> credentialIds = Optional.empty(); private Optional monitorPlan = Optional.empty(); @@ -746,10 +713,6 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private Optional analysisPlan = Optional.empty(); - private Optional serverUrlSecret = Optional.empty(); - - private Optional serverUrl = Optional.empty(); - private Optional> metadata = Optional.empty(); private Optional> endCallPhrases = Optional.empty(); @@ -760,8 +723,6 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private Optional voicemailDetection = Optional.empty(); - private Optional firstMessage = Optional.empty(); - private Optional name = Optional.empty(); private Optional> transportConfigurations = Optional.empty(); @@ -770,8 +731,6 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private Optional backgroundDenoisingEnabled = Optional.empty(); - private Optional backchannelingEnabled = Optional.empty(); - private Optional backgroundSound = Optional.empty(); private Optional maxDurationSeconds = Optional.empty(); @@ -786,6 +745,8 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private Optional firstMessageMode = Optional.empty(); + private Optional firstMessage = Optional.empty(); + private Optional voice = Optional.empty(); private Optional model = Optional.empty(); @@ -802,6 +763,7 @@ public Builder from(Assistant other) { transcriber(other.getTranscriber()); model(other.getModel()); voice(other.getVoice()); + firstMessage(other.getFirstMessage()); firstMessageMode(other.getFirstMessageMode()); hipaaEnabled(other.getHipaaEnabled()); clientMessages(other.getClientMessages()); @@ -809,19 +771,15 @@ public Builder from(Assistant other) { silenceTimeoutSeconds(other.getSilenceTimeoutSeconds()); maxDurationSeconds(other.getMaxDurationSeconds()); backgroundSound(other.getBackgroundSound()); - backchannelingEnabled(other.getBackchannelingEnabled()); backgroundDenoisingEnabled(other.getBackgroundDenoisingEnabled()); modelOutputInMessagesEnabled(other.getModelOutputInMessagesEnabled()); transportConfigurations(other.getTransportConfigurations()); name(other.getName()); - firstMessage(other.getFirstMessage()); voicemailDetection(other.getVoicemailDetection()); voicemailMessage(other.getVoicemailMessage()); endCallMessage(other.getEndCallMessage()); endCallPhrases(other.getEndCallPhrases()); metadata(other.getMetadata()); - serverUrl(other.getServerUrl()); - serverUrlSecret(other.getServerUrlSecret()); analysisPlan(other.getAnalysisPlan()); artifactPlan(other.getArtifactPlan()); messagePlan(other.getMessagePlan()); @@ -829,6 +787,7 @@ public Builder from(Assistant other) { stopSpeakingPlan(other.getStopSpeakingPlan()); monitorPlan(other.getMonitorPlan()); credentialIds(other.getCredentialIds()); + server(other.getServer()); id(other.getId()); orgId(other.getOrgId()); createdAt(other.getCreatedAt()); @@ -880,6 +839,29 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.

+ *

The order of precedence is:

+ *
    + *
  1. assistant.server.url
  2. + *
  3. phoneNumber.serverUrl
  4. + *
  5. org.serverUrl
  6. + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage server(Server server) { + this.server = Optional.ofNullable(server); + return this; + } + + @java.lang.Override + @JsonSetter(value = "server", nulls = Nulls.SKIP) + public _FinalStage server(Optional server) { + this.server = server; + return this; + } + /** *

These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1021,43 +1003,6 @@ public _FinalStage analysisPlan(Optional analysisPlan) { return this; } - /** - *

This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.

- *

Same precedence logic as serverUrl.

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

This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports.

- *

All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

- *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl

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

This is for metadata you want to store on the assistant.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1147,24 +1092,6 @@ public _FinalStage voicemailDetection(Optional voicema return this; } - /** - *

This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).

- *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

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

This is the name of the assistant.

*

This is required when you want to transfer between assistants in a call.

@@ -1239,25 +1166,6 @@ public _FinalStage backgroundDenoisingEnabled(Optional backgroundDenois return this; } - /** - *

This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking.

- *

Default false while in beta.

- *

@default false

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

This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1329,7 +1237,7 @@ public _FinalStage serverMessages(Optional> se } /** - *

These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema.

+ *

These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -1386,6 +1294,24 @@ public _FinalStage firstMessageMode(Optional firstMes return this; } + /** + *

This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).

+ *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

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

These are the options for the assistant's voice.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1443,6 +1369,7 @@ public Assistant build() { transcriber, model, voice, + firstMessage, firstMessageMode, hipaaEnabled, clientMessages, @@ -1450,19 +1377,15 @@ public Assistant build() { silenceTimeoutSeconds, maxDurationSeconds, backgroundSound, - backchannelingEnabled, backgroundDenoisingEnabled, modelOutputInMessagesEnabled, transportConfigurations, name, - firstMessage, voicemailDetection, voicemailMessage, endCallMessage, endCallPhrases, metadata, - serverUrl, - serverUrlSecret, analysisPlan, artifactPlan, messagePlan, @@ -1470,6 +1393,7 @@ public Assistant build() { stopSpeakingPlan, monitorPlan, credentialIds, + server, id, orgId, createdAt, diff --git a/src/main/java/com/vapi/api/types/AssistantClientMessagesItem.java b/src/main/java/com/vapi/api/types/AssistantClientMessagesItem.java index a5ff260..f3267c1 100644 --- a/src/main/java/com/vapi/api/types/AssistantClientMessagesItem.java +++ b/src/main/java/com/vapi/api/types/AssistantClientMessagesItem.java @@ -30,6 +30,8 @@ public enum AssistantClientMessagesItem { TOOL_CALLS_RESULT("tool-calls-result"), + TRANSFER_UPDATE("transfer-update"), + USER_INTERRUPTED("user-interrupted"), VOICE_INPUT("voice-input"); diff --git a/src/main/java/com/vapi/api/types/AssistantCustomEndpointingRule.java b/src/main/java/com/vapi/api/types/AssistantCustomEndpointingRule.java new file mode 100644 index 0000000..e9f5efa --- /dev/null +++ b/src/main/java/com/vapi/api/types/AssistantCustomEndpointingRule.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +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 = AssistantCustomEndpointingRule.Builder.class) +public final class AssistantCustomEndpointingRule { + private final String regex; + + private final Optional> regexOptions; + + private final double timeoutSeconds; + + private final Map additionalProperties; + + private AssistantCustomEndpointingRule( + String regex, + Optional> regexOptions, + double timeoutSeconds, + Map additionalProperties) { + this.regex = regex; + this.regexOptions = regexOptions; + this.timeoutSeconds = timeoutSeconds; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the regex pattern to match. + *

Note:

+ *
    + *
  • This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
  • + *
+ *

Hot tip:

+ *
    + *
  • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
  • + *
  • RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, send "^cat$".
  • + *
+ */ + @JsonProperty("regex") + public String getRegex() { + return regex; + } + + /** + * @return These are the options for the regex match. Defaults to all disabled. + *

@default []

+ */ + @JsonProperty("regexOptions") + public Optional> getRegexOptions() { + return regexOptions; + } + + /** + * @return This is the endpointing timeout in seconds, if the rule is matched. + */ + @JsonProperty("timeoutSeconds") + public double getTimeoutSeconds() { + return timeoutSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssistantCustomEndpointingRule && equalTo((AssistantCustomEndpointingRule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssistantCustomEndpointingRule other) { + return regex.equals(other.regex) + && regexOptions.equals(other.regexOptions) + && timeoutSeconds == other.timeoutSeconds; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.regex, this.regexOptions, this.timeoutSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RegexStage builder() { + return new Builder(); + } + + public interface RegexStage { + TimeoutSecondsStage regex(@NotNull String regex); + + Builder from(AssistantCustomEndpointingRule other); + } + + public interface TimeoutSecondsStage { + _FinalStage timeoutSeconds(double timeoutSeconds); + } + + public interface _FinalStage { + AssistantCustomEndpointingRule build(); + + _FinalStage regexOptions(Optional> regexOptions); + + _FinalStage regexOptions(List regexOptions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RegexStage, TimeoutSecondsStage, _FinalStage { + private String regex; + + private double timeoutSeconds; + + private Optional> regexOptions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AssistantCustomEndpointingRule other) { + regex(other.getRegex()); + regexOptions(other.getRegexOptions()); + timeoutSeconds(other.getTimeoutSeconds()); + return this; + } + + /** + *

This is the regex pattern to match.

+ *

Note:

+ *
    + *
  • This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
  • + *
+ *

Hot tip:

+ *
    + *
  • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
  • + *
  • RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, send "^cat$".
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("regex") + public TimeoutSecondsStage regex(@NotNull String regex) { + this.regex = Objects.requireNonNull(regex, "regex must not be null"); + return this; + } + + /** + *

This is the endpointing timeout in seconds, if the rule is matched.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("timeoutSeconds") + public _FinalStage timeoutSeconds(double timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + *

These are the options for the regex match. Defaults to all disabled.

+ *

@default []

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage regexOptions(List regexOptions) { + this.regexOptions = Optional.ofNullable(regexOptions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "regexOptions", nulls = Nulls.SKIP) + public _FinalStage regexOptions(Optional> regexOptions) { + this.regexOptions = regexOptions; + return this; + } + + @java.lang.Override + public AssistantCustomEndpointingRule build() { + return new AssistantCustomEndpointingRule(regex, regexOptions, timeoutSeconds, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/AssistantModel.java b/src/main/java/com/vapi/api/types/AssistantModel.java index 612d9b8..3f40d02 100644 --- a/src/main/java/com/vapi/api/types/AssistantModel.java +++ b/src/main/java/com/vapi/api/types/AssistantModel.java @@ -42,10 +42,18 @@ public static AssistantModel deepinfra(DeepInfraModel value) { return new AssistantModel(new DeepinfraValue(value)); } + public static AssistantModel google(GoogleModel value) { + return new AssistantModel(new GoogleValue(value)); + } + public static AssistantModel groq(GroqModel value) { return new AssistantModel(new GroqValue(value)); } + public static AssistantModel inflectionAi(InflectionAiModel value) { + return new AssistantModel(new InflectionAiValue(value)); + } + public static AssistantModel openai(OpenAiModel value) { return new AssistantModel(new OpenaiValue(value)); } @@ -66,6 +74,10 @@ public static AssistantModel vapi(VapiModel value) { return new AssistantModel(new VapiValue(value)); } + public static AssistantModel xai(XaiModel value) { + return new AssistantModel(new XaiValue(value)); + } + public boolean isAnyscale() { return value instanceof AnyscaleValue; } @@ -82,10 +94,18 @@ public boolean isDeepinfra() { return value instanceof DeepinfraValue; } + public boolean isGoogle() { + return value instanceof GoogleValue; + } + public boolean isGroq() { return value instanceof GroqValue; } + public boolean isInflectionAi() { + return value instanceof InflectionAiValue; + } + public boolean isOpenai() { return value instanceof OpenaiValue; } @@ -106,6 +126,10 @@ public boolean isVapi() { return value instanceof VapiValue; } + public boolean isXai() { + return value instanceof XaiValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -138,6 +162,13 @@ public Optional getDeepinfra() { return Optional.empty(); } + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + public Optional getGroq() { if (isGroq()) { return Optional.of(((GroqValue) value).value); @@ -145,6 +176,13 @@ public Optional getGroq() { return Optional.empty(); } + public Optional getInflectionAi() { + if (isInflectionAi()) { + return Optional.of(((InflectionAiValue) value).value); + } + return Optional.empty(); + } + public Optional getOpenai() { if (isOpenai()) { return Optional.of(((OpenaiValue) value).value); @@ -180,6 +218,13 @@ public Optional getVapi() { return Optional.empty(); } + public Optional getXai() { + if (isXai()) { + return Optional.of(((XaiValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -201,8 +246,12 @@ public interface Visitor { T visitDeepinfra(DeepInfraModel deepinfra); + T visitGoogle(GoogleModel google); + T visitGroq(GroqModel groq); + T visitInflectionAi(InflectionAiModel inflectionAi); + T visitOpenai(OpenAiModel openai); T visitOpenrouter(OpenRouterModel openrouter); @@ -213,6 +262,8 @@ public interface Visitor { T visitVapi(VapiModel vapi); + T visitXai(XaiModel xai); + T _visitUnknown(Object unknownType); } @@ -222,12 +273,15 @@ public interface Visitor { @JsonSubTypes.Type(AnthropicValue.class), @JsonSubTypes.Type(CustomLlmValue.class), @JsonSubTypes.Type(DeepinfraValue.class), + @JsonSubTypes.Type(GoogleValue.class), @JsonSubTypes.Type(GroqValue.class), + @JsonSubTypes.Type(InflectionAiValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(OpenrouterValue.class), @JsonSubTypes.Type(PerplexityAiValue.class), @JsonSubTypes.Type(TogetherAiValue.class), - @JsonSubTypes.Type(VapiValue.class) + @JsonSubTypes.Type(VapiValue.class), + @JsonSubTypes.Type(XaiValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -386,6 +440,44 @@ public String toString() { } } + @JsonTypeName("google") + private static final class GoogleValue implements Value { + @JsonUnwrapped + private GoogleModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(GoogleModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("groq") private static final class GroqValue implements Value { @JsonUnwrapped @@ -424,6 +516,44 @@ public String toString() { } } + @JsonTypeName("inflection-ai") + private static final class InflectionAiValue implements Value { + @JsonUnwrapped + private InflectionAiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private InflectionAiValue() {} + + private InflectionAiValue(InflectionAiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitInflectionAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InflectionAiValue && equalTo((InflectionAiValue) other); + } + + private boolean equalTo(InflectionAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("openai") private static final class OpenaiValue implements Value { @JsonUnwrapped @@ -614,6 +744,44 @@ public String toString() { } } + @JsonTypeName("xai") + private static final class XaiValue implements Value { + @JsonUnwrapped + private XaiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private XaiValue() {} + + private XaiValue(XaiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitXai(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof XaiValue && equalTo((XaiValue) other); + } + + private boolean equalTo(XaiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantModel{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/AssistantOverrides.java b/src/main/java/com/vapi/api/types/AssistantOverrides.java index d42b813..0a7a681 100644 --- a/src/main/java/com/vapi/api/types/AssistantOverrides.java +++ b/src/main/java/com/vapi/api/types/AssistantOverrides.java @@ -27,6 +27,8 @@ public final class AssistantOverrides { private final Optional voice; + private final Optional firstMessage; + private final Optional firstMessageMode; private final Optional hipaaEnabled; @@ -41,8 +43,6 @@ public final class AssistantOverrides { private final Optional backgroundSound; - private final Optional backchannelingEnabled; - private final Optional backgroundDenoisingEnabled; private final Optional modelOutputInMessagesEnabled; @@ -53,8 +53,6 @@ public final class AssistantOverrides { private final Optional name; - private final Optional firstMessage; - private final Optional voicemailDetection; private final Optional voicemailMessage; @@ -65,10 +63,6 @@ public final class AssistantOverrides { private final Optional> metadata; - private final Optional serverUrl; - - private final Optional serverUrlSecret; - private final Optional analysisPlan; private final Optional artifactPlan; @@ -83,12 +77,15 @@ public final class AssistantOverrides { private final Optional> credentialIds; + private final Optional server; + private final Map additionalProperties; private AssistantOverrides( Optional transcriber, Optional model, Optional voice, + Optional firstMessage, Optional firstMessageMode, Optional hipaaEnabled, Optional> clientMessages, @@ -96,20 +93,16 @@ private AssistantOverrides( Optional silenceTimeoutSeconds, Optional maxDurationSeconds, Optional backgroundSound, - Optional backchannelingEnabled, Optional backgroundDenoisingEnabled, Optional modelOutputInMessagesEnabled, Optional> transportConfigurations, Optional> variableValues, Optional name, - Optional firstMessage, Optional voicemailDetection, Optional voicemailMessage, Optional endCallMessage, Optional> endCallPhrases, Optional> metadata, - Optional serverUrl, - Optional serverUrlSecret, Optional analysisPlan, Optional artifactPlan, Optional messagePlan, @@ -117,10 +110,12 @@ private AssistantOverrides( Optional stopSpeakingPlan, Optional monitorPlan, Optional> credentialIds, + Optional server, Map additionalProperties) { this.transcriber = transcriber; this.model = model; this.voice = voice; + this.firstMessage = firstMessage; this.firstMessageMode = firstMessageMode; this.hipaaEnabled = hipaaEnabled; this.clientMessages = clientMessages; @@ -128,20 +123,16 @@ private AssistantOverrides( this.silenceTimeoutSeconds = silenceTimeoutSeconds; this.maxDurationSeconds = maxDurationSeconds; this.backgroundSound = backgroundSound; - this.backchannelingEnabled = backchannelingEnabled; this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; this.modelOutputInMessagesEnabled = modelOutputInMessagesEnabled; this.transportConfigurations = transportConfigurations; this.variableValues = variableValues; this.name = name; - this.firstMessage = firstMessage; this.voicemailDetection = voicemailDetection; this.voicemailMessage = voicemailMessage; this.endCallMessage = endCallMessage; this.endCallPhrases = endCallPhrases; this.metadata = metadata; - this.serverUrl = serverUrl; - this.serverUrlSecret = serverUrlSecret; this.analysisPlan = analysisPlan; this.artifactPlan = artifactPlan; this.messagePlan = messagePlan; @@ -149,6 +140,7 @@ private AssistantOverrides( this.stopSpeakingPlan = stopSpeakingPlan; this.monitorPlan = monitorPlan; this.credentialIds = credentialIds; + this.server = server; this.additionalProperties = additionalProperties; } @@ -176,6 +168,15 @@ public Optional getVoice() { return voice; } + /** + * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

+ */ + @JsonProperty("firstMessage") + public Optional getFirstMessage() { + return firstMessage; + } + /** * @return This is the mode for the first message. Default is 'assistant-speaks-first'. *

Use:

@@ -200,7 +201,7 @@ public Optional getHipaaEnabled() { } /** - * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. */ @JsonProperty("clientMessages") public Optional> getClientMessages() { @@ -241,16 +242,6 @@ public Optional getBackgroundSound() { return backgroundSound; } - /** - * @return This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. - *

Default false while in beta.

- *

@default false

- */ - @JsonProperty("backchannelingEnabled") - public Optional getBackchannelingEnabled() { - return backchannelingEnabled; - } - /** * @return This enables filtering of noise and background speech while the user is talking. *

Default false while in beta.

@@ -281,6 +272,13 @@ public Optional> getTransportConfigurations() /** * @return These are values that will be used to replace the template variables in the assistant messages and other text-based fields. + * This uses LiquidJS syntax. https://liquidjs.com/tutorials/intro-to-liquid.html + *

So for example, {{ name }} will be replaced with the value of name in variableValues. + * {{"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"}} will be replaced with the current date and time in New York. + * Some VAPI reserved defaults:

+ *
    + *
  • customer - the customer object
  • + *
*/ @JsonProperty("variableValues") public Optional> getVariableValues() { @@ -296,15 +294,6 @@ public Optional getName() { return name; } - /** - * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). - *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

- */ - @JsonProperty("firstMessage") - public Optional getFirstMessage() { - return firstMessage; - } - /** * @return These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. * This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. @@ -349,25 +338,6 @@ public Optional> getMetadata() { return metadata; } - /** - * @return This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. - *

All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

- *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl

- */ - @JsonProperty("serverUrl") - public Optional getServerUrl() { - return serverUrl; - } - - /** - * @return This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. - *

Same precedence logic as serverUrl.

- */ - @JsonProperty("serverUrlSecret") - public Optional getServerUrlSecret() { - return serverUrlSecret; - } - /** * @return This is the plan for analysis of assistant's calls. Stored in call.analysis. */ @@ -446,6 +416,20 @@ public Optional> getCredentialIds() { return credentialIds; } + /** + * @return This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + *

The order of precedence is:

+ *
    + *
  1. assistant.server.url
  2. + *
  3. phoneNumber.serverUrl
  4. + *
  5. org.serverUrl
  6. + *
+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -461,6 +445,7 @@ private boolean equalTo(AssistantOverrides other) { return transcriber.equals(other.transcriber) && model.equals(other.model) && voice.equals(other.voice) + && firstMessage.equals(other.firstMessage) && firstMessageMode.equals(other.firstMessageMode) && hipaaEnabled.equals(other.hipaaEnabled) && clientMessages.equals(other.clientMessages) @@ -468,27 +453,24 @@ private boolean equalTo(AssistantOverrides other) { && silenceTimeoutSeconds.equals(other.silenceTimeoutSeconds) && maxDurationSeconds.equals(other.maxDurationSeconds) && backgroundSound.equals(other.backgroundSound) - && backchannelingEnabled.equals(other.backchannelingEnabled) && backgroundDenoisingEnabled.equals(other.backgroundDenoisingEnabled) && modelOutputInMessagesEnabled.equals(other.modelOutputInMessagesEnabled) && transportConfigurations.equals(other.transportConfigurations) && variableValues.equals(other.variableValues) && name.equals(other.name) - && firstMessage.equals(other.firstMessage) && voicemailDetection.equals(other.voicemailDetection) && voicemailMessage.equals(other.voicemailMessage) && endCallMessage.equals(other.endCallMessage) && endCallPhrases.equals(other.endCallPhrases) && metadata.equals(other.metadata) - && serverUrl.equals(other.serverUrl) - && serverUrlSecret.equals(other.serverUrlSecret) && analysisPlan.equals(other.analysisPlan) && artifactPlan.equals(other.artifactPlan) && messagePlan.equals(other.messagePlan) && startSpeakingPlan.equals(other.startSpeakingPlan) && stopSpeakingPlan.equals(other.stopSpeakingPlan) && monitorPlan.equals(other.monitorPlan) - && credentialIds.equals(other.credentialIds); + && credentialIds.equals(other.credentialIds) + && server.equals(other.server); } @java.lang.Override @@ -497,6 +479,7 @@ public int hashCode() { this.transcriber, this.model, this.voice, + this.firstMessage, this.firstMessageMode, this.hipaaEnabled, this.clientMessages, @@ -504,27 +487,24 @@ public int hashCode() { this.silenceTimeoutSeconds, this.maxDurationSeconds, this.backgroundSound, - this.backchannelingEnabled, this.backgroundDenoisingEnabled, this.modelOutputInMessagesEnabled, this.transportConfigurations, this.variableValues, this.name, - this.firstMessage, this.voicemailDetection, this.voicemailMessage, this.endCallMessage, this.endCallPhrases, this.metadata, - this.serverUrl, - this.serverUrlSecret, this.analysisPlan, this.artifactPlan, this.messagePlan, this.startSpeakingPlan, this.stopSpeakingPlan, this.monitorPlan, - this.credentialIds); + this.credentialIds, + this.server); } @java.lang.Override @@ -544,6 +524,8 @@ public static final class Builder { private Optional voice = Optional.empty(); + private Optional firstMessage = Optional.empty(); + private Optional firstMessageMode = Optional.empty(); private Optional hipaaEnabled = Optional.empty(); @@ -558,8 +540,6 @@ public static final class Builder { private Optional backgroundSound = Optional.empty(); - private Optional backchannelingEnabled = Optional.empty(); - private Optional backgroundDenoisingEnabled = Optional.empty(); private Optional modelOutputInMessagesEnabled = Optional.empty(); @@ -570,8 +550,6 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional firstMessage = Optional.empty(); - private Optional voicemailDetection = Optional.empty(); private Optional voicemailMessage = Optional.empty(); @@ -582,10 +560,6 @@ public static final class Builder { private Optional> metadata = Optional.empty(); - private Optional serverUrl = Optional.empty(); - - private Optional serverUrlSecret = Optional.empty(); - private Optional analysisPlan = Optional.empty(); private Optional artifactPlan = Optional.empty(); @@ -600,6 +574,8 @@ public static final class Builder { private Optional> credentialIds = Optional.empty(); + private Optional server = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -609,6 +585,7 @@ public Builder from(AssistantOverrides other) { transcriber(other.getTranscriber()); model(other.getModel()); voice(other.getVoice()); + firstMessage(other.getFirstMessage()); firstMessageMode(other.getFirstMessageMode()); hipaaEnabled(other.getHipaaEnabled()); clientMessages(other.getClientMessages()); @@ -616,20 +593,16 @@ public Builder from(AssistantOverrides other) { silenceTimeoutSeconds(other.getSilenceTimeoutSeconds()); maxDurationSeconds(other.getMaxDurationSeconds()); backgroundSound(other.getBackgroundSound()); - backchannelingEnabled(other.getBackchannelingEnabled()); backgroundDenoisingEnabled(other.getBackgroundDenoisingEnabled()); modelOutputInMessagesEnabled(other.getModelOutputInMessagesEnabled()); transportConfigurations(other.getTransportConfigurations()); variableValues(other.getVariableValues()); name(other.getName()); - firstMessage(other.getFirstMessage()); voicemailDetection(other.getVoicemailDetection()); voicemailMessage(other.getVoicemailMessage()); endCallMessage(other.getEndCallMessage()); endCallPhrases(other.getEndCallPhrases()); metadata(other.getMetadata()); - serverUrl(other.getServerUrl()); - serverUrlSecret(other.getServerUrlSecret()); analysisPlan(other.getAnalysisPlan()); artifactPlan(other.getArtifactPlan()); messagePlan(other.getMessagePlan()); @@ -637,6 +610,7 @@ public Builder from(AssistantOverrides other) { stopSpeakingPlan(other.getStopSpeakingPlan()); monitorPlan(other.getMonitorPlan()); credentialIds(other.getCredentialIds()); + server(other.getServer()); return this; } @@ -673,6 +647,17 @@ public Builder voice(AssistantOverridesVoice voice) { return this; } + @JsonSetter(value = "firstMessage", nulls = Nulls.SKIP) + public Builder firstMessage(Optional firstMessage) { + this.firstMessage = firstMessage; + return this; + } + + public Builder firstMessage(String firstMessage) { + this.firstMessage = Optional.ofNullable(firstMessage); + return this; + } + @JsonSetter(value = "firstMessageMode", nulls = Nulls.SKIP) public Builder firstMessageMode(Optional firstMessageMode) { this.firstMessageMode = firstMessageMode; @@ -750,17 +735,6 @@ public Builder backgroundSound(AssistantOverridesBackgroundSound backgroundSound return this; } - @JsonSetter(value = "backchannelingEnabled", nulls = Nulls.SKIP) - public Builder backchannelingEnabled(Optional backchannelingEnabled) { - this.backchannelingEnabled = backchannelingEnabled; - return this; - } - - public Builder backchannelingEnabled(Boolean backchannelingEnabled) { - this.backchannelingEnabled = Optional.ofNullable(backchannelingEnabled); - return this; - } - @JsonSetter(value = "backgroundDenoisingEnabled", nulls = Nulls.SKIP) public Builder backgroundDenoisingEnabled(Optional backgroundDenoisingEnabled) { this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; @@ -816,17 +790,6 @@ public Builder name(String name) { return this; } - @JsonSetter(value = "firstMessage", nulls = Nulls.SKIP) - public Builder firstMessage(Optional firstMessage) { - this.firstMessage = firstMessage; - return this; - } - - public Builder firstMessage(String firstMessage) { - this.firstMessage = Optional.ofNullable(firstMessage); - return this; - } - @JsonSetter(value = "voicemailDetection", nulls = Nulls.SKIP) public Builder voicemailDetection(Optional voicemailDetection) { this.voicemailDetection = voicemailDetection; @@ -882,28 +845,6 @@ public Builder metadata(Map metadata) { return this; } - @JsonSetter(value = "serverUrl", nulls = Nulls.SKIP) - public Builder serverUrl(Optional serverUrl) { - this.serverUrl = serverUrl; - return this; - } - - public Builder serverUrl(String serverUrl) { - this.serverUrl = Optional.ofNullable(serverUrl); - return this; - } - - @JsonSetter(value = "serverUrlSecret", nulls = Nulls.SKIP) - public Builder serverUrlSecret(Optional serverUrlSecret) { - this.serverUrlSecret = serverUrlSecret; - return this; - } - - public Builder serverUrlSecret(String serverUrlSecret) { - this.serverUrlSecret = Optional.ofNullable(serverUrlSecret); - return this; - } - @JsonSetter(value = "analysisPlan", nulls = Nulls.SKIP) public Builder analysisPlan(Optional analysisPlan) { this.analysisPlan = analysisPlan; @@ -981,11 +922,23 @@ public Builder credentialIds(List credentialIds) { return this; } + @JsonSetter(value = "server", nulls = Nulls.SKIP) + public Builder server(Optional server) { + this.server = server; + return this; + } + + public Builder server(Server server) { + this.server = Optional.ofNullable(server); + return this; + } + public AssistantOverrides build() { return new AssistantOverrides( transcriber, model, voice, + firstMessage, firstMessageMode, hipaaEnabled, clientMessages, @@ -993,20 +946,16 @@ public AssistantOverrides build() { silenceTimeoutSeconds, maxDurationSeconds, backgroundSound, - backchannelingEnabled, backgroundDenoisingEnabled, modelOutputInMessagesEnabled, transportConfigurations, variableValues, name, - firstMessage, voicemailDetection, voicemailMessage, endCallMessage, endCallPhrases, metadata, - serverUrl, - serverUrlSecret, analysisPlan, artifactPlan, messagePlan, @@ -1014,6 +963,7 @@ public AssistantOverrides build() { stopSpeakingPlan, monitorPlan, credentialIds, + server, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/AssistantOverridesClientMessagesItem.java b/src/main/java/com/vapi/api/types/AssistantOverridesClientMessagesItem.java index ad50794..508c48b 100644 --- a/src/main/java/com/vapi/api/types/AssistantOverridesClientMessagesItem.java +++ b/src/main/java/com/vapi/api/types/AssistantOverridesClientMessagesItem.java @@ -30,6 +30,8 @@ public enum AssistantOverridesClientMessagesItem { TOOL_CALLS_RESULT("tool-calls-result"), + TRANSFER_UPDATE("transfer-update"), + USER_INTERRUPTED("user-interrupted"), VOICE_INPUT("voice-input"); diff --git a/src/main/java/com/vapi/api/types/AssistantOverridesModel.java b/src/main/java/com/vapi/api/types/AssistantOverridesModel.java index e0be148..62fb56f 100644 --- a/src/main/java/com/vapi/api/types/AssistantOverridesModel.java +++ b/src/main/java/com/vapi/api/types/AssistantOverridesModel.java @@ -42,10 +42,18 @@ public static AssistantOverridesModel deepinfra(DeepInfraModel value) { return new AssistantOverridesModel(new DeepinfraValue(value)); } + public static AssistantOverridesModel google(GoogleModel value) { + return new AssistantOverridesModel(new GoogleValue(value)); + } + public static AssistantOverridesModel groq(GroqModel value) { return new AssistantOverridesModel(new GroqValue(value)); } + public static AssistantOverridesModel inflectionAi(InflectionAiModel value) { + return new AssistantOverridesModel(new InflectionAiValue(value)); + } + public static AssistantOverridesModel openai(OpenAiModel value) { return new AssistantOverridesModel(new OpenaiValue(value)); } @@ -66,6 +74,10 @@ public static AssistantOverridesModel vapi(VapiModel value) { return new AssistantOverridesModel(new VapiValue(value)); } + public static AssistantOverridesModel xai(XaiModel value) { + return new AssistantOverridesModel(new XaiValue(value)); + } + public boolean isAnyscale() { return value instanceof AnyscaleValue; } @@ -82,10 +94,18 @@ public boolean isDeepinfra() { return value instanceof DeepinfraValue; } + public boolean isGoogle() { + return value instanceof GoogleValue; + } + public boolean isGroq() { return value instanceof GroqValue; } + public boolean isInflectionAi() { + return value instanceof InflectionAiValue; + } + public boolean isOpenai() { return value instanceof OpenaiValue; } @@ -106,6 +126,10 @@ public boolean isVapi() { return value instanceof VapiValue; } + public boolean isXai() { + return value instanceof XaiValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -138,6 +162,13 @@ public Optional getDeepinfra() { return Optional.empty(); } + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + public Optional getGroq() { if (isGroq()) { return Optional.of(((GroqValue) value).value); @@ -145,6 +176,13 @@ public Optional getGroq() { return Optional.empty(); } + public Optional getInflectionAi() { + if (isInflectionAi()) { + return Optional.of(((InflectionAiValue) value).value); + } + return Optional.empty(); + } + public Optional getOpenai() { if (isOpenai()) { return Optional.of(((OpenaiValue) value).value); @@ -180,6 +218,13 @@ public Optional getVapi() { return Optional.empty(); } + public Optional getXai() { + if (isXai()) { + return Optional.of(((XaiValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -201,8 +246,12 @@ public interface Visitor { T visitDeepinfra(DeepInfraModel deepinfra); + T visitGoogle(GoogleModel google); + T visitGroq(GroqModel groq); + T visitInflectionAi(InflectionAiModel inflectionAi); + T visitOpenai(OpenAiModel openai); T visitOpenrouter(OpenRouterModel openrouter); @@ -213,6 +262,8 @@ public interface Visitor { T visitVapi(VapiModel vapi); + T visitXai(XaiModel xai); + T _visitUnknown(Object unknownType); } @@ -222,12 +273,15 @@ public interface Visitor { @JsonSubTypes.Type(AnthropicValue.class), @JsonSubTypes.Type(CustomLlmValue.class), @JsonSubTypes.Type(DeepinfraValue.class), + @JsonSubTypes.Type(GoogleValue.class), @JsonSubTypes.Type(GroqValue.class), + @JsonSubTypes.Type(InflectionAiValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(OpenrouterValue.class), @JsonSubTypes.Type(PerplexityAiValue.class), @JsonSubTypes.Type(TogetherAiValue.class), - @JsonSubTypes.Type(VapiValue.class) + @JsonSubTypes.Type(VapiValue.class), + @JsonSubTypes.Type(XaiValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -386,6 +440,44 @@ public String toString() { } } + @JsonTypeName("google") + private static final class GoogleValue implements Value { + @JsonUnwrapped + private GoogleModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(GoogleModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("groq") private static final class GroqValue implements Value { @JsonUnwrapped @@ -424,6 +516,44 @@ public String toString() { } } + @JsonTypeName("inflection-ai") + private static final class InflectionAiValue implements Value { + @JsonUnwrapped + private InflectionAiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private InflectionAiValue() {} + + private InflectionAiValue(InflectionAiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitInflectionAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InflectionAiValue && equalTo((InflectionAiValue) other); + } + + private boolean equalTo(InflectionAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("openai") private static final class OpenaiValue implements Value { @JsonUnwrapped @@ -614,6 +744,44 @@ public String toString() { } } + @JsonTypeName("xai") + private static final class XaiValue implements Value { + @JsonUnwrapped + private XaiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private XaiValue() {} + + private XaiValue(XaiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitXai(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof XaiValue && equalTo((XaiValue) other); + } + + private boolean equalTo(XaiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesModel{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/AssistantOverridesServerMessagesItem.java b/src/main/java/com/vapi/api/types/AssistantOverridesServerMessagesItem.java index 3d0608b..66551fb 100644 --- a/src/main/java/com/vapi/api/types/AssistantOverridesServerMessagesItem.java +++ b/src/main/java/com/vapi/api/types/AssistantOverridesServerMessagesItem.java @@ -16,6 +16,8 @@ public enum AssistantOverridesServerMessagesItem { LANGUAGE_CHANGED("language-changed"), + LANGUAGE_CHANGE_DETECTED("language-change-detected"), + MODEL_OUTPUT("model-output"), PHONE_CALL_CONTROL("phone-call-control"), diff --git a/src/main/java/com/vapi/api/types/AssistantOverridesTranscriber.java b/src/main/java/com/vapi/api/types/AssistantOverridesTranscriber.java index 03e56c3..33e2b2b 100644 --- a/src/main/java/com/vapi/api/types/AssistantOverridesTranscriber.java +++ b/src/main/java/com/vapi/api/types/AssistantOverridesTranscriber.java @@ -26,6 +26,14 @@ public T visit(Visitor visitor) { return value.visit(visitor); } + public static AssistantOverridesTranscriber assemblyAi(AssemblyAiTranscriber value) { + return new AssistantOverridesTranscriber(new AssemblyAiValue(value)); + } + + public static AssistantOverridesTranscriber customTranscriber(CustomTranscriber value) { + return new AssistantOverridesTranscriber(new CustomTranscriberValue(value)); + } + public static AssistantOverridesTranscriber deepgram(DeepgramTranscriber value) { return new AssistantOverridesTranscriber(new DeepgramValue(value)); } @@ -38,6 +46,14 @@ public static AssistantOverridesTranscriber talkscriber(TalkscriberTranscriber v return new AssistantOverridesTranscriber(new TalkscriberValue(value)); } + public boolean isAssemblyAi() { + return value instanceof AssemblyAiValue; + } + + public boolean isCustomTranscriber() { + return value instanceof CustomTranscriberValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -54,6 +70,20 @@ public boolean _isUnknown() { return value instanceof _UnknownValue; } + public Optional getAssemblyAi() { + if (isAssemblyAi()) { + return Optional.of(((AssemblyAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomTranscriber() { + if (isCustomTranscriber()) { + return Optional.of(((CustomTranscriberValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -88,6 +118,10 @@ private Value getValue() { } public interface Visitor { + T visitAssemblyAi(AssemblyAiTranscriber assemblyAi); + + T visitCustomTranscriber(CustomTranscriber customTranscriber); + T visitDeepgram(DeepgramTranscriber deepgram); T visitGladia(GladiaTranscriber gladia); @@ -99,6 +133,8 @@ public interface Visitor { @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) @JsonSubTypes({ + @JsonSubTypes.Type(AssemblyAiValue.class), + @JsonSubTypes.Type(CustomTranscriberValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(GladiaValue.class), @JsonSubTypes.Type(TalkscriberValue.class) @@ -108,6 +144,82 @@ private interface Value { T visit(Visitor visitor); } + @JsonTypeName("assembly-ai") + private static final class AssemblyAiValue implements Value { + @JsonUnwrapped + private AssemblyAiTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AssemblyAiValue() {} + + private AssemblyAiValue(AssemblyAiTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAssemblyAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssemblyAiValue && equalTo((AssemblyAiValue) other); + } + + private boolean equalTo(AssemblyAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesTranscriber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-transcriber") + private static final class CustomTranscriberValue implements Value { + @JsonUnwrapped + private CustomTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomTranscriberValue() {} + + private CustomTranscriberValue(CustomTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomTranscriber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomTranscriberValue && equalTo((CustomTranscriberValue) other); + } + + private boolean equalTo(CustomTranscriberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesTranscriber{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped diff --git a/src/main/java/com/vapi/api/types/AssistantOverridesVoice.java b/src/main/java/com/vapi/api/types/AssistantOverridesVoice.java index 817aefe..ceb2e78 100644 --- a/src/main/java/com/vapi/api/types/AssistantOverridesVoice.java +++ b/src/main/java/com/vapi/api/types/AssistantOverridesVoice.java @@ -34,6 +34,10 @@ public static AssistantOverridesVoice cartesia(CartesiaVoice value) { return new AssistantOverridesVoice(new CartesiaValue(value)); } + public static AssistantOverridesVoice customVoice(CustomVoice value) { + return new AssistantOverridesVoice(new CustomVoiceValue(value)); + } + public static AssistantOverridesVoice deepgram(DeepgramVoice value) { return new AssistantOverridesVoice(new DeepgramValue(value)); } @@ -62,6 +66,10 @@ public static AssistantOverridesVoice rimeAi(RimeAiVoice value) { return new AssistantOverridesVoice(new RimeAiValue(value)); } + public static AssistantOverridesVoice tavus(TavusVoice value) { + return new AssistantOverridesVoice(new TavusValue(value)); + } + public boolean isAzure() { return value instanceof AzureValue; } @@ -70,6 +78,10 @@ public boolean isCartesia() { return value instanceof CartesiaValue; } + public boolean isCustomVoice() { + return value instanceof CustomVoiceValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -98,6 +110,10 @@ public boolean isRimeAi() { return value instanceof RimeAiValue; } + public boolean isTavus() { + return value instanceof TavusValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -116,6 +132,13 @@ public Optional getCartesia() { return Optional.empty(); } + public Optional getCustomVoice() { + if (isCustomVoice()) { + return Optional.of(((CustomVoiceValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -165,6 +188,13 @@ public Optional getRimeAi() { return Optional.empty(); } + public Optional getTavus() { + if (isTavus()) { + return Optional.of(((TavusValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -182,6 +212,8 @@ public interface Visitor { T visitCartesia(CartesiaVoice cartesia); + T visitCustomVoice(CustomVoice customVoice); + T visitDeepgram(DeepgramVoice deepgram); T visit11Labs(ElevenLabsVoice _11Labs); @@ -196,6 +228,8 @@ public interface Visitor { T visitRimeAi(RimeAiVoice rimeAi); + T visitTavus(TavusVoice tavus); + T _visitUnknown(Object unknownType); } @@ -203,13 +237,15 @@ public interface Visitor { @JsonSubTypes({ @JsonSubTypes.Type(AzureValue.class), @JsonSubTypes.Type(CartesiaValue.class), + @JsonSubTypes.Type(CustomVoiceValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(_11LabsValue.class), @JsonSubTypes.Type(LmntValue.class), @JsonSubTypes.Type(NeetsValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(PlayhtValue.class), - @JsonSubTypes.Type(RimeAiValue.class) + @JsonSubTypes.Type(RimeAiValue.class), + @JsonSubTypes.Type(TavusValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -292,6 +328,44 @@ public String toString() { } } + @JsonTypeName("custom-voice") + private static final class CustomVoiceValue implements Value { + @JsonUnwrapped + private CustomVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomVoiceValue() {} + + private CustomVoiceValue(CustomVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomVoice(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomVoiceValue && equalTo((CustomVoiceValue) other); + } + + private boolean equalTo(CustomVoiceValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesVoice{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped @@ -558,6 +632,44 @@ public String toString() { } } + @JsonTypeName("tavus") + private static final class TavusValue implements Value { + @JsonUnwrapped + private TavusVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TavusValue() {} + + private TavusValue(TavusVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTavus(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusValue && equalTo((TavusValue) other); + } + + private boolean equalTo(TavusValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantOverridesVoice{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/AssistantServerMessagesItem.java b/src/main/java/com/vapi/api/types/AssistantServerMessagesItem.java index 5086ceb..449addd 100644 --- a/src/main/java/com/vapi/api/types/AssistantServerMessagesItem.java +++ b/src/main/java/com/vapi/api/types/AssistantServerMessagesItem.java @@ -16,6 +16,8 @@ public enum AssistantServerMessagesItem { LANGUAGE_CHANGED("language-changed"), + LANGUAGE_CHANGE_DETECTED("language-change-detected"), + MODEL_OUTPUT("model-output"), PHONE_CALL_CONTROL("phone-call-control"), diff --git a/src/main/java/com/vapi/api/types/AssistantTranscriber.java b/src/main/java/com/vapi/api/types/AssistantTranscriber.java index f472650..7e008d6 100644 --- a/src/main/java/com/vapi/api/types/AssistantTranscriber.java +++ b/src/main/java/com/vapi/api/types/AssistantTranscriber.java @@ -26,6 +26,14 @@ public T visit(Visitor visitor) { return value.visit(visitor); } + public static AssistantTranscriber assemblyAi(AssemblyAiTranscriber value) { + return new AssistantTranscriber(new AssemblyAiValue(value)); + } + + public static AssistantTranscriber customTranscriber(CustomTranscriber value) { + return new AssistantTranscriber(new CustomTranscriberValue(value)); + } + public static AssistantTranscriber deepgram(DeepgramTranscriber value) { return new AssistantTranscriber(new DeepgramValue(value)); } @@ -38,6 +46,14 @@ public static AssistantTranscriber talkscriber(TalkscriberTranscriber value) { return new AssistantTranscriber(new TalkscriberValue(value)); } + public boolean isAssemblyAi() { + return value instanceof AssemblyAiValue; + } + + public boolean isCustomTranscriber() { + return value instanceof CustomTranscriberValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -54,6 +70,20 @@ public boolean _isUnknown() { return value instanceof _UnknownValue; } + public Optional getAssemblyAi() { + if (isAssemblyAi()) { + return Optional.of(((AssemblyAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomTranscriber() { + if (isCustomTranscriber()) { + return Optional.of(((CustomTranscriberValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -88,6 +118,10 @@ private Value getValue() { } public interface Visitor { + T visitAssemblyAi(AssemblyAiTranscriber assemblyAi); + + T visitCustomTranscriber(CustomTranscriber customTranscriber); + T visitDeepgram(DeepgramTranscriber deepgram); T visitGladia(GladiaTranscriber gladia); @@ -99,6 +133,8 @@ public interface Visitor { @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) @JsonSubTypes({ + @JsonSubTypes.Type(AssemblyAiValue.class), + @JsonSubTypes.Type(CustomTranscriberValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(GladiaValue.class), @JsonSubTypes.Type(TalkscriberValue.class) @@ -108,6 +144,82 @@ private interface Value { T visit(Visitor visitor); } + @JsonTypeName("assembly-ai") + private static final class AssemblyAiValue implements Value { + @JsonUnwrapped + private AssemblyAiTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AssemblyAiValue() {} + + private AssemblyAiValue(AssemblyAiTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAssemblyAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssemblyAiValue && equalTo((AssemblyAiValue) other); + } + + private boolean equalTo(AssemblyAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantTranscriber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-transcriber") + private static final class CustomTranscriberValue implements Value { + @JsonUnwrapped + private CustomTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomTranscriberValue() {} + + private CustomTranscriberValue(CustomTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomTranscriber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomTranscriberValue && equalTo((CustomTranscriberValue) other); + } + + private boolean equalTo(CustomTranscriberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantTranscriber{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped diff --git a/src/main/java/com/vapi/api/types/AssistantVoice.java b/src/main/java/com/vapi/api/types/AssistantVoice.java index 29d2dfd..c95aa9a 100644 --- a/src/main/java/com/vapi/api/types/AssistantVoice.java +++ b/src/main/java/com/vapi/api/types/AssistantVoice.java @@ -34,6 +34,10 @@ public static AssistantVoice cartesia(CartesiaVoice value) { return new AssistantVoice(new CartesiaValue(value)); } + public static AssistantVoice customVoice(CustomVoice value) { + return new AssistantVoice(new CustomVoiceValue(value)); + } + public static AssistantVoice deepgram(DeepgramVoice value) { return new AssistantVoice(new DeepgramValue(value)); } @@ -62,6 +66,10 @@ public static AssistantVoice rimeAi(RimeAiVoice value) { return new AssistantVoice(new RimeAiValue(value)); } + public static AssistantVoice tavus(TavusVoice value) { + return new AssistantVoice(new TavusValue(value)); + } + public boolean isAzure() { return value instanceof AzureValue; } @@ -70,6 +78,10 @@ public boolean isCartesia() { return value instanceof CartesiaValue; } + public boolean isCustomVoice() { + return value instanceof CustomVoiceValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -98,6 +110,10 @@ public boolean isRimeAi() { return value instanceof RimeAiValue; } + public boolean isTavus() { + return value instanceof TavusValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -116,6 +132,13 @@ public Optional getCartesia() { return Optional.empty(); } + public Optional getCustomVoice() { + if (isCustomVoice()) { + return Optional.of(((CustomVoiceValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -165,6 +188,13 @@ public Optional getRimeAi() { return Optional.empty(); } + public Optional getTavus() { + if (isTavus()) { + return Optional.of(((TavusValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -182,6 +212,8 @@ public interface Visitor { T visitCartesia(CartesiaVoice cartesia); + T visitCustomVoice(CustomVoice customVoice); + T visitDeepgram(DeepgramVoice deepgram); T visit11Labs(ElevenLabsVoice _11Labs); @@ -196,6 +228,8 @@ public interface Visitor { T visitRimeAi(RimeAiVoice rimeAi); + T visitTavus(TavusVoice tavus); + T _visitUnknown(Object unknownType); } @@ -203,13 +237,15 @@ public interface Visitor { @JsonSubTypes({ @JsonSubTypes.Type(AzureValue.class), @JsonSubTypes.Type(CartesiaValue.class), + @JsonSubTypes.Type(CustomVoiceValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(_11LabsValue.class), @JsonSubTypes.Type(LmntValue.class), @JsonSubTypes.Type(NeetsValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(PlayhtValue.class), - @JsonSubTypes.Type(RimeAiValue.class) + @JsonSubTypes.Type(RimeAiValue.class), + @JsonSubTypes.Type(TavusValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -292,6 +328,44 @@ public String toString() { } } + @JsonTypeName("custom-voice") + private static final class CustomVoiceValue implements Value { + @JsonUnwrapped + private CustomVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomVoiceValue() {} + + private CustomVoiceValue(CustomVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomVoice(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomVoiceValue && equalTo((CustomVoiceValue) other); + } + + private boolean equalTo(CustomVoiceValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantVoice{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped @@ -558,6 +632,44 @@ public String toString() { } } + @JsonTypeName("tavus") + private static final class TavusValue implements Value { + @JsonUnwrapped + private TavusVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TavusValue() {} + + private TavusValue(TavusVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTavus(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusValue && equalTo((TavusValue) other); + } + + private boolean equalTo(TavusValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AssistantVoice{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/AutoReloadPlan.java b/src/main/java/com/vapi/api/types/AutoReloadPlan.java new file mode 100644 index 0000000..5576375 --- /dev/null +++ b/src/main/java/com/vapi/api/types/AutoReloadPlan.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AutoReloadPlan.Builder.class) +public final class AutoReloadPlan { + private final double credits; + + private final double threshold; + + private final Map additionalProperties; + + private AutoReloadPlan(double credits, double threshold, Map additionalProperties) { + this.credits = credits; + this.threshold = threshold; + this.additionalProperties = additionalProperties; + } + + /** + * @return This the amount of credits to reload. + */ + @JsonProperty("credits") + public double getCredits() { + return credits; + } + + /** + * @return This is the limit at which the reload is triggered. + */ + @JsonProperty("threshold") + public double getThreshold() { + return threshold; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AutoReloadPlan && equalTo((AutoReloadPlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AutoReloadPlan other) { + return credits == other.credits && threshold == other.threshold; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.credits, this.threshold); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CreditsStage builder() { + return new Builder(); + } + + public interface CreditsStage { + ThresholdStage credits(double credits); + + Builder from(AutoReloadPlan other); + } + + public interface ThresholdStage { + _FinalStage threshold(double threshold); + } + + public interface _FinalStage { + AutoReloadPlan build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CreditsStage, ThresholdStage, _FinalStage { + private double credits; + + private double threshold; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AutoReloadPlan other) { + credits(other.getCredits()); + threshold(other.getThreshold()); + return this; + } + + /** + *

This the amount of credits to reload.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("credits") + public ThresholdStage credits(double credits) { + this.credits = credits; + return this; + } + + /** + *

This is the limit at which the reload is triggered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("threshold") + public _FinalStage threshold(double threshold) { + this.threshold = threshold; + return this; + } + + @java.lang.Override + public AutoReloadPlan build() { + return new AutoReloadPlan(credits, threshold, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/AutoReloadPlanDto.java b/src/main/java/com/vapi/api/types/AutoReloadPlanDto.java new file mode 100644 index 0000000..a954d97 --- /dev/null +++ b/src/main/java/com/vapi/api/types/AutoReloadPlanDto.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AutoReloadPlanDto.Builder.class) +public final class AutoReloadPlanDto { + private final Optional autoReloadPlan; + + private final Map additionalProperties; + + private AutoReloadPlanDto(Optional autoReloadPlan, Map additionalProperties) { + this.autoReloadPlan = autoReloadPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the auto reload plan to be configured for the subscription. + * It can be null if no auto reload plan is set. + */ + @JsonProperty("autoReloadPlan") + public Optional getAutoReloadPlan() { + return autoReloadPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AutoReloadPlanDto && equalTo((AutoReloadPlanDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AutoReloadPlanDto other) { + return autoReloadPlan.equals(other.autoReloadPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.autoReloadPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional autoReloadPlan = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AutoReloadPlanDto other) { + autoReloadPlan(other.getAutoReloadPlan()); + return this; + } + + @JsonSetter(value = "autoReloadPlan", nulls = Nulls.SKIP) + public Builder autoReloadPlan(Optional autoReloadPlan) { + this.autoReloadPlan = autoReloadPlan; + return this; + } + + public Builder autoReloadPlan(AutoReloadPlan autoReloadPlan) { + this.autoReloadPlan = Optional.ofNullable(autoReloadPlan); + return this; + } + + public AutoReloadPlanDto build() { + return new AutoReloadPlanDto(autoReloadPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/AzureCredential.java b/src/main/java/com/vapi/api/types/AzureCredential.java new file mode 100644 index 0000000..aadd666 --- /dev/null +++ b/src/main/java/com/vapi/api/types/AzureCredential.java @@ -0,0 +1,331 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AzureCredential.Builder.class) +public final class AzureCredential { + private final Optional region; + + private final Optional apiKey; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private AzureCredential( + Optional region, + Optional apiKey, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.region = region; + this.apiKey = apiKey; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "azure"; + } + + /** + * @return This is the service being used in Azure. + */ + @JsonProperty("service") + public String getService() { + return "speech"; + } + + /** + * @return This is the region of the Azure resource. + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public Optional getApiKey() { + return apiKey; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AzureCredential && equalTo((AzureCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AzureCredential other) { + return region.equals(other.region) + && apiKey.equals(other.apiKey) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.region, this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + + Builder from(AzureCredential other); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + AzureCredential build(); + + _FinalStage region(Optional region); + + _FinalStage region(AzureCredentialRegion region); + + _FinalStage apiKey(Optional apiKey); + + _FinalStage apiKey(String apiKey); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + private Optional apiKey = Optional.empty(); + + private Optional region = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AzureCredential other) { + region(other.getRegion()); + apiKey(other.getApiKey()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

This is the unique identifier for the credential.

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

This is the unique identifier for the org that this credential belongs to.

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

This is the ISO 8601 date-time string of when the credential was created.

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

This is the ISO 8601 date-time string of when the assistant was last updated.

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

This is the name of credential. This is just for your reference.

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

This is not returned in the API.

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

This is the region of the Azure resource.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage region(AzureCredentialRegion region) { + this.region = Optional.ofNullable(region); + return this; + } + + @java.lang.Override + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public _FinalStage region(Optional region) { + this.region = region; + return this; + } + + @java.lang.Override + public AzureCredential build() { + return new AzureCredential(region, apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/AzureCredentialRegion.java b/src/main/java/com/vapi/api/types/AzureCredentialRegion.java new file mode 100644 index 0000000..20d736b --- /dev/null +++ b/src/main/java/com/vapi/api/types/AzureCredentialRegion.java @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AzureCredentialRegion { + AUSTRALIA("australia"), + + CANADA("canada"), + + EASTUS_2("eastus2"), + + EASTUS("eastus"), + + FRANCE("france"), + + INDIA("india"), + + JAPAN("japan"), + + UAENORTH("uaenorth"), + + NORTHCENTRALUS("northcentralus"), + + NORWAY("norway"), + + SOUTHCENTRALUS("southcentralus"), + + SWEDEN("sweden"), + + SWITZERLAND("switzerland"), + + UK("uk"), + + WESTUS("westus"), + + WESTUS_3("westus3"); + + private final String value; + + AzureCredentialRegion(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/AzureOpenAiCredential.java b/src/main/java/com/vapi/api/types/AzureOpenAiCredential.java index ca0c03f..d2e7228 100644 --- a/src/main/java/com/vapi/api/types/AzureOpenAiCredential.java +++ b/src/main/java/com/vapi/api/types/AzureOpenAiCredential.java @@ -18,6 +18,7 @@ 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) @@ -37,6 +38,8 @@ public final class AzureOpenAiCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final String openAiEndpoint; private final Map additionalProperties; @@ -49,6 +52,7 @@ private AzureOpenAiCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, String openAiEndpoint, Map additionalProperties) { this.region = region; @@ -58,6 +62,7 @@ private AzureOpenAiCredential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.openAiEndpoint = openAiEndpoint; this.additionalProperties = additionalProperties; } @@ -117,6 +122,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @JsonProperty("openAIEndpoint") public String getOpenAiEndpoint() { return openAiEndpoint; @@ -141,6 +154,7 @@ private boolean equalTo(AzureOpenAiCredential other) { && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) + && name.equals(other.name) && openAiEndpoint.equals(other.openAiEndpoint); } @@ -154,6 +168,7 @@ public int hashCode() { this.orgId, this.createdAt, this.updatedAt, + this.name, this.openAiEndpoint); } @@ -204,6 +219,10 @@ public interface _FinalStage { _FinalStage addModels(AzureOpenAiCredentialModelsItem models); _FinalStage addAllModels(List models); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -230,6 +249,8 @@ public static final class Builder private String openAiEndpoint; + private Optional name = Optional.empty(); + private List models = new ArrayList<>(); @JsonAnySetter @@ -246,6 +267,7 @@ public Builder from(AzureOpenAiCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); openAiEndpoint(other.getOpenAiEndpoint()); return this; } @@ -319,6 +341,23 @@ public _FinalStage openAiEndpoint(@NotNull String openAiEndpoint) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public _FinalStage addAllModels(List models) { this.models.addAll(models); @@ -342,7 +381,16 @@ public _FinalStage models(List models) { @java.lang.Override public AzureOpenAiCredential build() { return new AzureOpenAiCredential( - region, models, openAiKey, id, orgId, createdAt, updatedAt, openAiEndpoint, additionalProperties); + region, + models, + openAiKey, + id, + orgId, + createdAt, + updatedAt, + name, + openAiEndpoint, + additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/AzureOpenAiCredentialModelsItem.java b/src/main/java/com/vapi/api/types/AzureOpenAiCredentialModelsItem.java index ecf58e9..37d5066 100644 --- a/src/main/java/com/vapi/api/types/AzureOpenAiCredentialModelsItem.java +++ b/src/main/java/com/vapi/api/types/AzureOpenAiCredentialModelsItem.java @@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum AzureOpenAiCredentialModelsItem { + GPT_4_O_20240806("gpt-4o-2024-08-06"), + GPT_4_O_MINI_20240718("gpt-4o-mini-2024-07-18"), GPT_4_O_20240513("gpt-4o-2024-05-13"), diff --git a/src/main/java/com/vapi/api/types/AzureOpenAiCredentialRegion.java b/src/main/java/com/vapi/api/types/AzureOpenAiCredentialRegion.java index 3ecbcff..2c65949 100644 --- a/src/main/java/com/vapi/api/types/AzureOpenAiCredentialRegion.java +++ b/src/main/java/com/vapi/api/types/AzureOpenAiCredentialRegion.java @@ -20,6 +20,8 @@ public enum AzureOpenAiCredentialRegion { JAPAN("japan"), + UAENORTH("uaenorth"), + NORTHCENTRALUS("northcentralus"), NORWAY("norway"), diff --git a/src/main/java/com/vapi/api/types/AzureVoice.java b/src/main/java/com/vapi/api/types/AzureVoice.java index 1168f10..89334e1 100644 --- a/src/main/java/com/vapi/api/types/AzureVoice.java +++ b/src/main/java/com/vapi/api/types/AzureVoice.java @@ -21,38 +21,29 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AzureVoice.Builder.class) public final class AzureVoice { - private final Optional fillerInjectionEnabled; - private final AzureVoiceId voiceId; + private final Optional chunkPlan; + private final Optional speed; - private final Optional chunkPlan; + private final Optional fallbackPlan; private final Map additionalProperties; private AzureVoice( - Optional fillerInjectionEnabled, AzureVoiceId voiceId, - Optional speed, Optional chunkPlan, + Optional speed, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; - this.speed = speed; this.chunkPlan = chunkPlan; + this.speed = speed; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

Default false because you can achieve better results with prompting the model.

- */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. */ @@ -61,6 +52,14 @@ public AzureVoiceId getVoiceId() { return voiceId; } + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + /** * @return This is the speed multiplier that will be used. */ @@ -70,11 +69,11 @@ public Optional getSpeed() { } /** - * @return This is the plan for chunking the model output before it is sent to the voice provider. + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. */ - @JsonProperty("chunkPlan") - public Optional getChunkPlan() { - return chunkPlan; + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; } @java.lang.Override @@ -89,15 +88,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(AzureVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) + return voiceId.equals(other.voiceId) + && chunkPlan.equals(other.chunkPlan) && speed.equals(other.speed) - && chunkPlan.equals(other.chunkPlan); + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.voiceId, this.speed, this.chunkPlan); + return Objects.hash(this.voiceId, this.chunkPlan, this.speed, this.fallbackPlan); } @java.lang.Override @@ -118,28 +117,28 @@ public interface VoiceIdStage { public interface _FinalStage { AzureVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); + _FinalStage chunkPlan(Optional chunkPlan); - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); + _FinalStage chunkPlan(ChunkPlan chunkPlan); _FinalStage speed(Optional speed); _FinalStage speed(Double speed); - _FinalStage chunkPlan(Optional chunkPlan); + _FinalStage fallbackPlan(Optional fallbackPlan); - _FinalStage chunkPlan(ChunkPlan chunkPlan); + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private AzureVoiceId voiceId; - private Optional chunkPlan = Optional.empty(); + private Optional fallbackPlan = Optional.empty(); private Optional speed = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); + private Optional chunkPlan = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -148,10 +147,10 @@ private Builder() {} @java.lang.Override public Builder from(AzureVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); - speed(other.getSpeed()); chunkPlan(other.getChunkPlan()); + speed(other.getSpeed()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -167,19 +166,19 @@ public _FinalStage voiceId(@NotNull AzureVoiceId voiceId) { } /** - *

This is the plan for chunking the model output before it is sent to the voice provider.

+ *

This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage chunkPlan(ChunkPlan chunkPlan) { - this.chunkPlan = Optional.ofNullable(chunkPlan); + public _FinalStage fallbackPlan(FallbackPlan fallbackPlan) { + this.fallbackPlan = Optional.ofNullable(fallbackPlan); return this; } @java.lang.Override - @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) - public _FinalStage chunkPlan(Optional chunkPlan) { - this.chunkPlan = chunkPlan; + @JsonSetter(value = "fallbackPlan", nulls = Nulls.SKIP) + public _FinalStage fallbackPlan(Optional fallbackPlan) { + this.fallbackPlan = fallbackPlan; return this; } @@ -201,26 +200,25 @@ public _FinalStage speed(Optional speed) { } /** - *

This determines whether fillers are injected into the model output before inputting it into the voice provider.

- *

Default false because you can achieve better results with prompting the model.

+ *

This is the plan for chunking the model output before it is sent to the voice provider.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); return this; } @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; return this; } @java.lang.Override public AzureVoice build() { - return new AzureVoice(fillerInjectionEnabled, voiceId, speed, chunkPlan, additionalProperties); + return new AzureVoice(voiceId, chunkPlan, speed, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/BashTool.java b/src/main/java/com/vapi/api/types/BashTool.java new file mode 100644 index 0000000..4377420 --- /dev/null +++ b/src/main/java/com/vapi/api/types/BashTool.java @@ -0,0 +1,397 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +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 = BashTool.Builder.class) +public final class BashTool { + private final Optional async; + + private final Optional> messages; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional function; + + private final Optional server; + + private final Map additionalProperties; + + private BashTool( + Optional async, + Optional> messages, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional function, + Optional server, + Map additionalProperties) { + this.async = async; + this.messages = messages; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.function = function; + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return This determines if the tool is async. + *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ */ + @JsonProperty("async") + public Optional getAsync() { + return async; + } + + /** + * @return These are the messages that will be spoken to the user as the tool is running. + *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

+ */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return The sub type of tool. + */ + @JsonProperty("subType") + public String getSubType() { + return "bash_20241022"; + } + + /** + * @return This is the unique identifier for the tool. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the organization that this tool belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the tool was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the tool was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the function definition of the tool. + *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

+ */ + @JsonProperty("function") + public Optional getFunction() { + return function; + } + + /** + * @return This is the server that will be hit when this tool is requested by the model. + *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + + /** + * @return The name of the tool, fixed to 'bash' + */ + @JsonProperty("name") + public String getName() { + return "bash"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BashTool && equalTo((BashTool) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BashTool other) { + return async.equals(other.async) + && messages.equals(other.messages) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && function.equals(other.function) + && server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.async, + this.messages, + this.id, + this.orgId, + this.createdAt, + this.updatedAt, + this.function, + this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + + Builder from(BashTool other); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + BashTool build(); + + _FinalStage async(Optional async); + + _FinalStage async(Boolean async); + + _FinalStage messages(Optional> messages); + + _FinalStage messages(List messages); + + _FinalStage function(Optional function); + + _FinalStage function(OpenAiFunction function); + + _FinalStage server(Optional server); + + _FinalStage server(Server server); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional server = Optional.empty(); + + private Optional function = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private Optional async = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BashTool other) { + async(other.getAsync()); + messages(other.getMessages()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + function(other.getFunction()); + server(other.getServer()); + return this; + } + + /** + *

This is the unique identifier for the tool.

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

This is the unique identifier for the organization that this tool belongs to.

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

This is the ISO 8601 date-time string of when the tool was created.

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

This is the ISO 8601 date-time string of when the tool was last updated.

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

This is the server that will be hit when this tool is requested by the model.

+ *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

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

This is the function definition of the tool.

+ *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

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

These are the messages that will be spoken to the user as the tool is running.

+ *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

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

This determines if the tool is async.

+ *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage async(Boolean async) { + this.async = Optional.ofNullable(async); + return this; + } + + @java.lang.Override + @JsonSetter(value = "async", nulls = Nulls.SKIP) + public _FinalStage async(Optional async) { + this.async = async; + return this; + } + + @java.lang.Override + public BashTool build() { + return new BashTool( + async, messages, id, orgId, createdAt, updatedAt, function, server, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/BashToolMessagesItem.java b/src/main/java/com/vapi/api/types/BashToolMessagesItem.java new file mode 100644 index 0000000..c54ccef --- /dev/null +++ b/src/main/java/com/vapi/api/types/BashToolMessagesItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class BashToolMessagesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private BashToolMessagesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static BashToolMessagesItem requestStart(ToolMessageStart value) { + return new BashToolMessagesItem(new RequestStartValue(value)); + } + + public static BashToolMessagesItem requestComplete(ToolMessageComplete value) { + return new BashToolMessagesItem(new RequestCompleteValue(value)); + } + + public static BashToolMessagesItem requestFailed(ToolMessageFailed value) { + return new BashToolMessagesItem(new RequestFailedValue(value)); + } + + public static BashToolMessagesItem requestResponseDelayed(ToolMessageDelayed value) { + return new BashToolMessagesItem(new RequestResponseDelayedValue(value)); + } + + public boolean isRequestStart() { + return value instanceof RequestStartValue; + } + + public boolean isRequestComplete() { + return value instanceof RequestCompleteValue; + } + + public boolean isRequestFailed() { + return value instanceof RequestFailedValue; + } + + public boolean isRequestResponseDelayed() { + return value instanceof RequestResponseDelayedValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getRequestStart() { + if (isRequestStart()) { + return Optional.of(((RequestStartValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestComplete() { + if (isRequestComplete()) { + return Optional.of(((RequestCompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestFailed() { + if (isRequestFailed()) { + return Optional.of(((RequestFailedValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestResponseDelayed() { + if (isRequestResponseDelayed()) { + return Optional.of(((RequestResponseDelayedValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitRequestStart(ToolMessageStart requestStart); + + T visitRequestComplete(ToolMessageComplete requestComplete); + + T visitRequestFailed(ToolMessageFailed requestFailed); + + T visitRequestResponseDelayed(ToolMessageDelayed requestResponseDelayed); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(RequestStartValue.class), + @JsonSubTypes.Type(RequestCompleteValue.class), + @JsonSubTypes.Type(RequestFailedValue.class), + @JsonSubTypes.Type(RequestResponseDelayedValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("request-start") + private static final class RequestStartValue implements Value { + @JsonUnwrapped + private ToolMessageStart value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestStartValue() {} + + private RequestStartValue(ToolMessageStart value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestStart(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestStartValue && equalTo((RequestStartValue) other); + } + + private boolean equalTo(RequestStartValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "BashToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-complete") + private static final class RequestCompleteValue implements Value { + @JsonUnwrapped + private ToolMessageComplete value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestCompleteValue() {} + + private RequestCompleteValue(ToolMessageComplete value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestCompleteValue && equalTo((RequestCompleteValue) other); + } + + private boolean equalTo(RequestCompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "BashToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-failed") + private static final class RequestFailedValue implements Value { + @JsonUnwrapped + private ToolMessageFailed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestFailedValue() {} + + private RequestFailedValue(ToolMessageFailed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestFailed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestFailedValue && equalTo((RequestFailedValue) other); + } + + private boolean equalTo(RequestFailedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "BashToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-response-delayed") + private static final class RequestResponseDelayedValue implements Value { + @JsonUnwrapped + private ToolMessageDelayed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestResponseDelayedValue() {} + + private RequestResponseDelayedValue(ToolMessageDelayed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestResponseDelayed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestResponseDelayedValue && equalTo((RequestResponseDelayedValue) other); + } + + private boolean equalTo(RequestResponseDelayedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "BashToolMessagesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "BashToolMessagesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/BlockCompleteMessage.java b/src/main/java/com/vapi/api/types/BlockCompleteMessage.java index d022004..aab6035 100644 --- a/src/main/java/com/vapi/api/types/BlockCompleteMessage.java +++ b/src/main/java/com/vapi/api/types/BlockCompleteMessage.java @@ -17,26 +17,43 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BlockCompleteMessage.Builder.class) public final class BlockCompleteMessage { + private final Optional> contents; + private final Optional> conditions; - private final String content; + private final Optional content; private final Map additionalProperties; private BlockCompleteMessage( + Optional> contents, Optional> conditions, - String content, + Optional content, Map additionalProperties) { + this.contents = contents; this.conditions = conditions; this.content = content; this.additionalProperties = additionalProperties; } + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

Usage:

+ *
    + *
  • If your assistants are multilingual, you can provide content for each language.
  • + *
  • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
  • + *
+ *

This will override the content property.

+ */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + /** * @return This is an optional array of conditions that must be met for this message to be triggered. */ @@ -49,7 +66,7 @@ public Optional> getConditions() { * @return This is the content that the assistant will say when this message is triggered. */ @JsonProperty("content") - public String getContent() { + public Optional getContent() { return content; } @@ -65,12 +82,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(BlockCompleteMessage other) { - return conditions.equals(other.conditions) && content.equals(other.content); + return contents.equals(other.contents) && conditions.equals(other.conditions) && content.equals(other.content); } @java.lang.Override public int hashCode() { - return Objects.hash(this.conditions, this.content); + return Objects.hash(this.contents, this.conditions, this.content); } @java.lang.Override @@ -78,73 +95,65 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ContentStage builder() { + public static Builder builder() { return new Builder(); } - public interface ContentStage { - _FinalStage content(@NotNull String content); - - Builder from(BlockCompleteMessage other); - } - - public interface _FinalStage { - BlockCompleteMessage build(); - - _FinalStage conditions(Optional> conditions); - - _FinalStage conditions(List conditions); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ContentStage, _FinalStage { - private String content; + public static final class Builder { + private Optional> contents = Optional.empty(); private Optional> conditions = Optional.empty(); + private Optional content = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(BlockCompleteMessage other) { + contents(other.getContents()); conditions(other.getConditions()); content(other.getContent()); return this; } - /** - *

This is the content that the assistant will say when this message is triggered.

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

This is an optional array of conditions that must be met for this message to be triggered.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage conditions(List conditions) { - this.conditions = Optional.ofNullable(conditions); + public Builder contents(List contents) { + this.contents = Optional.ofNullable(contents); return this; } - @java.lang.Override @JsonSetter(value = "conditions", nulls = Nulls.SKIP) - public _FinalStage conditions(Optional> conditions) { + public Builder conditions(Optional> conditions) { this.conditions = conditions; return this; } - @java.lang.Override + public Builder conditions(List conditions) { + this.conditions = Optional.ofNullable(conditions); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + public BlockCompleteMessage build() { - return new BlockCompleteMessage(conditions, content, additionalProperties); + return new BlockCompleteMessage(contents, conditions, content, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/BlockStartMessage.java b/src/main/java/com/vapi/api/types/BlockStartMessage.java index b48dd93..733074c 100644 --- a/src/main/java/com/vapi/api/types/BlockStartMessage.java +++ b/src/main/java/com/vapi/api/types/BlockStartMessage.java @@ -17,26 +17,43 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BlockStartMessage.Builder.class) public final class BlockStartMessage { + private final Optional> contents; + private final Optional> conditions; - private final String content; + private final Optional content; private final Map additionalProperties; private BlockStartMessage( + Optional> contents, Optional> conditions, - String content, + Optional content, Map additionalProperties) { + this.contents = contents; this.conditions = conditions; this.content = content; this.additionalProperties = additionalProperties; } + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

Usage:

+ *
    + *
  • If your assistants are multilingual, you can provide content for each language.
  • + *
  • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
  • + *
+ *

This will override the content property.

+ */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + /** * @return This is an optional array of conditions that must be met for this message to be triggered. */ @@ -49,7 +66,7 @@ public Optional> getConditions() { * @return This is the content that the assistant will say when this message is triggered. */ @JsonProperty("content") - public String getContent() { + public Optional getContent() { return content; } @@ -65,12 +82,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(BlockStartMessage other) { - return conditions.equals(other.conditions) && content.equals(other.content); + return contents.equals(other.contents) && conditions.equals(other.conditions) && content.equals(other.content); } @java.lang.Override public int hashCode() { - return Objects.hash(this.conditions, this.content); + return Objects.hash(this.contents, this.conditions, this.content); } @java.lang.Override @@ -78,73 +95,65 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ContentStage builder() { + public static Builder builder() { return new Builder(); } - public interface ContentStage { - _FinalStage content(@NotNull String content); - - Builder from(BlockStartMessage other); - } - - public interface _FinalStage { - BlockStartMessage build(); - - _FinalStage conditions(Optional> conditions); - - _FinalStage conditions(List conditions); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ContentStage, _FinalStage { - private String content; + public static final class Builder { + private Optional> contents = Optional.empty(); private Optional> conditions = Optional.empty(); + private Optional content = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(BlockStartMessage other) { + contents(other.getContents()); conditions(other.getConditions()); content(other.getContent()); return this; } - /** - *

This is the content that the assistant will say when this message is triggered.

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

This is an optional array of conditions that must be met for this message to be triggered.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage conditions(List conditions) { - this.conditions = Optional.ofNullable(conditions); + public Builder contents(List contents) { + this.contents = Optional.ofNullable(contents); return this; } - @java.lang.Override @JsonSetter(value = "conditions", nulls = Nulls.SKIP) - public _FinalStage conditions(Optional> conditions) { + public Builder conditions(Optional> conditions) { this.conditions = conditions; return this; } - @java.lang.Override + public Builder conditions(List conditions) { + this.conditions = Optional.ofNullable(conditions); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + public BlockStartMessage build() { - return new BlockStartMessage(conditions, content, additionalProperties); + return new BlockStartMessage(contents, conditions, content, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/BothCustomEndpointingRule.java b/src/main/java/com/vapi/api/types/BothCustomEndpointingRule.java new file mode 100644 index 0000000..a3955c9 --- /dev/null +++ b/src/main/java/com/vapi/api/types/BothCustomEndpointingRule.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +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 = BothCustomEndpointingRule.Builder.class) +public final class BothCustomEndpointingRule { + private final String assistantRegex; + + private final Optional> assistantRegexOptions; + + private final String customerRegex; + + private final Optional> customerRegexOptions; + + private final double timeoutSeconds; + + private final Map additionalProperties; + + private BothCustomEndpointingRule( + String assistantRegex, + Optional> assistantRegexOptions, + String customerRegex, + Optional> customerRegexOptions, + double timeoutSeconds, + Map additionalProperties) { + this.assistantRegex = assistantRegex; + this.assistantRegexOptions = assistantRegexOptions; + this.customerRegex = customerRegex; + this.customerRegexOptions = customerRegexOptions; + this.timeoutSeconds = timeoutSeconds; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the regex pattern to match the assistant's message. + *

Note:

+ *
    + *
  • This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
  • + *
+ *

Hot tip:

+ *
    + *
  • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
  • + *
  • RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, send "^cat$".
  • + *
+ */ + @JsonProperty("assistantRegex") + public String getAssistantRegex() { + return assistantRegex; + } + + /** + * @return These are the options for the assistant's message regex match. Defaults to all disabled. + *

@default []

+ */ + @JsonProperty("assistantRegexOptions") + public Optional> getAssistantRegexOptions() { + return assistantRegexOptions; + } + + @JsonProperty("customerRegex") + public String getCustomerRegex() { + return customerRegex; + } + + /** + * @return These are the options for the customer's message regex match. Defaults to all disabled. + *

@default []

+ */ + @JsonProperty("customerRegexOptions") + public Optional> getCustomerRegexOptions() { + return customerRegexOptions; + } + + /** + * @return This is the endpointing timeout in seconds, if the rule is matched. + */ + @JsonProperty("timeoutSeconds") + public double getTimeoutSeconds() { + return timeoutSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BothCustomEndpointingRule && equalTo((BothCustomEndpointingRule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BothCustomEndpointingRule other) { + return assistantRegex.equals(other.assistantRegex) + && assistantRegexOptions.equals(other.assistantRegexOptions) + && customerRegex.equals(other.customerRegex) + && customerRegexOptions.equals(other.customerRegexOptions) + && timeoutSeconds == other.timeoutSeconds; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.assistantRegex, + this.assistantRegexOptions, + this.customerRegex, + this.customerRegexOptions, + this.timeoutSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AssistantRegexStage builder() { + return new Builder(); + } + + public interface AssistantRegexStage { + CustomerRegexStage assistantRegex(@NotNull String assistantRegex); + + Builder from(BothCustomEndpointingRule other); + } + + public interface CustomerRegexStage { + TimeoutSecondsStage customerRegex(@NotNull String customerRegex); + } + + public interface TimeoutSecondsStage { + _FinalStage timeoutSeconds(double timeoutSeconds); + } + + public interface _FinalStage { + BothCustomEndpointingRule build(); + + _FinalStage assistantRegexOptions(Optional> assistantRegexOptions); + + _FinalStage assistantRegexOptions(List assistantRegexOptions); + + _FinalStage customerRegexOptions(Optional> customerRegexOptions); + + _FinalStage customerRegexOptions(List customerRegexOptions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AssistantRegexStage, CustomerRegexStage, TimeoutSecondsStage, _FinalStage { + private String assistantRegex; + + private String customerRegex; + + private double timeoutSeconds; + + private Optional> customerRegexOptions = Optional.empty(); + + private Optional> assistantRegexOptions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BothCustomEndpointingRule other) { + assistantRegex(other.getAssistantRegex()); + assistantRegexOptions(other.getAssistantRegexOptions()); + customerRegex(other.getCustomerRegex()); + customerRegexOptions(other.getCustomerRegexOptions()); + timeoutSeconds(other.getTimeoutSeconds()); + return this; + } + + /** + *

This is the regex pattern to match the assistant's message.

+ *

Note:

+ *
    + *
  • This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
  • + *
+ *

Hot tip:

+ *
    + *
  • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
  • + *
  • RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, send "^cat$".
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("assistantRegex") + public CustomerRegexStage assistantRegex(@NotNull String assistantRegex) { + this.assistantRegex = Objects.requireNonNull(assistantRegex, "assistantRegex must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("customerRegex") + public TimeoutSecondsStage customerRegex(@NotNull String customerRegex) { + this.customerRegex = Objects.requireNonNull(customerRegex, "customerRegex must not be null"); + return this; + } + + /** + *

This is the endpointing timeout in seconds, if the rule is matched.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("timeoutSeconds") + public _FinalStage timeoutSeconds(double timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + *

These are the options for the customer's message regex match. Defaults to all disabled.

+ *

@default []

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

These are the options for the assistant's message regex match. Defaults to all disabled.

+ *

@default []

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assistantRegexOptions(List assistantRegexOptions) { + this.assistantRegexOptions = Optional.ofNullable(assistantRegexOptions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "assistantRegexOptions", nulls = Nulls.SKIP) + public _FinalStage assistantRegexOptions(Optional> assistantRegexOptions) { + this.assistantRegexOptions = assistantRegexOptions; + return this; + } + + @java.lang.Override + public BothCustomEndpointingRule build() { + return new BothCustomEndpointingRule( + assistantRegex, + assistantRegexOptions, + customerRegex, + customerRegexOptions, + timeoutSeconds, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ByoSipTrunkCredential.java b/src/main/java/com/vapi/api/types/ByoSipTrunkCredential.java index 582f4b0..414fdad 100644 --- a/src/main/java/com/vapi/api/types/ByoSipTrunkCredential.java +++ b/src/main/java/com/vapi/api/types/ByoSipTrunkCredential.java @@ -34,14 +34,18 @@ public final class ByoSipTrunkCredential { private final OffsetDateTime updatedAt; - private final List gateways; - private final Optional name; + private final List gateways; + private final Optional outboundAuthenticationPlan; private final Optional outboundLeadingPlusEnabled; + private final Optional techPrefix; + + private final Optional sipDiversionHeader; + private final Optional sbcConfiguration; private final Map additionalProperties; @@ -52,10 +56,12 @@ private ByoSipTrunkCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, - List gateways, Optional name, + List gateways, Optional outboundAuthenticationPlan, Optional outboundLeadingPlusEnabled, + Optional techPrefix, + Optional sipDiversionHeader, Optional sbcConfiguration, Map additionalProperties) { this.provider = provider; @@ -63,10 +69,12 @@ private ByoSipTrunkCredential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; - this.gateways = gateways; this.name = name; + this.gateways = gateways; this.outboundAuthenticationPlan = outboundAuthenticationPlan; this.outboundLeadingPlusEnabled = outboundLeadingPlusEnabled; + this.techPrefix = techPrefix; + this.sipDiversionHeader = sipDiversionHeader; this.sbcConfiguration = sbcConfiguration; this.additionalProperties = additionalProperties; } @@ -112,19 +120,19 @@ public OffsetDateTime getUpdatedAt() { } /** - * @return This is the list of SIP trunk's gateways. + * @return This is the name of credential. This is just for your reference. */ - @JsonProperty("gateways") - public List getGateways() { - return gateways; + @JsonProperty("name") + public Optional getName() { + return name; } /** - * @return This is the name of the SIP trunk. This is just for your reference. + * @return This is the list of SIP trunk's gateways. */ - @JsonProperty("name") - public Optional getName() { - return name; + @JsonProperty("gateways") + public List getGateways() { + return gateways; } /** @@ -148,6 +156,22 @@ public Optional getOutboundLeadingPlusEnabled() { return outboundLeadingPlusEnabled; } + /** + * @return This can be used to configure the tech prefix on outbound calls. This is an advanced property. + */ + @JsonProperty("techPrefix") + public Optional getTechPrefix() { + return techPrefix; + } + + /** + * @return This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property. + */ + @JsonProperty("sipDiversionHeader") + public Optional getSipDiversionHeader() { + return sipDiversionHeader; + } + /** * @return This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's gateways, rather than the managed SBC provided by Vapi. */ @@ -173,10 +197,12 @@ private boolean equalTo(ByoSipTrunkCredential other) { && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) - && gateways.equals(other.gateways) && name.equals(other.name) + && gateways.equals(other.gateways) && outboundAuthenticationPlan.equals(other.outboundAuthenticationPlan) && outboundLeadingPlusEnabled.equals(other.outboundLeadingPlusEnabled) + && techPrefix.equals(other.techPrefix) + && sipDiversionHeader.equals(other.sipDiversionHeader) && sbcConfiguration.equals(other.sbcConfiguration); } @@ -188,10 +214,12 @@ public int hashCode() { this.orgId, this.createdAt, this.updatedAt, - this.gateways, this.name, + this.gateways, this.outboundAuthenticationPlan, this.outboundLeadingPlusEnabled, + this.techPrefix, + this.sipDiversionHeader, this.sbcConfiguration); } @@ -229,16 +257,16 @@ public interface _FinalStage { _FinalStage provider(String provider); + _FinalStage name(Optional name); + + _FinalStage name(String name); + _FinalStage gateways(List gateways); _FinalStage addGateways(SipTrunkGateway gateways); _FinalStage addAllGateways(List gateways); - _FinalStage name(Optional name); - - _FinalStage name(String name); - _FinalStage outboundAuthenticationPlan(Optional outboundAuthenticationPlan); _FinalStage outboundAuthenticationPlan(SipTrunkOutboundAuthenticationPlan outboundAuthenticationPlan); @@ -247,6 +275,14 @@ public interface _FinalStage { _FinalStage outboundLeadingPlusEnabled(Boolean outboundLeadingPlusEnabled); + _FinalStage techPrefix(Optional techPrefix); + + _FinalStage techPrefix(String techPrefix); + + _FinalStage sipDiversionHeader(Optional sipDiversionHeader); + + _FinalStage sipDiversionHeader(String sipDiversionHeader); + _FinalStage sbcConfiguration(Optional sbcConfiguration); _FinalStage sbcConfiguration(SbcConfiguration sbcConfiguration); @@ -264,14 +300,18 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private Optional sbcConfiguration = Optional.empty(); + private Optional sipDiversionHeader = Optional.empty(); + + private Optional techPrefix = Optional.empty(); + private Optional outboundLeadingPlusEnabled = Optional.empty(); private Optional outboundAuthenticationPlan = Optional.empty(); - private Optional name = Optional.empty(); - private List gateways = new ArrayList<>(); + private Optional name = Optional.empty(); + private Optional provider = Optional.empty(); @JsonAnySetter @@ -286,10 +326,12 @@ public Builder from(ByoSipTrunkCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); - gateways(other.getGateways()); name(other.getName()); + gateways(other.getGateways()); outboundAuthenticationPlan(other.getOutboundAuthenticationPlan()); outboundLeadingPlusEnabled(other.getOutboundLeadingPlusEnabled()); + techPrefix(other.getTechPrefix()); + sipDiversionHeader(other.getSipDiversionHeader()); sbcConfiguration(other.getSbcConfiguration()); return this; } @@ -355,6 +397,40 @@ public _FinalStage sbcConfiguration(Optional sbcConfiguration) return this; } + /** + *

This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property.

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

This can be used to configure the tech prefix on outbound calls. This is an advanced property.

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

This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior.

*

Usage:

@@ -395,23 +471,6 @@ public _FinalStage outboundAuthenticationPlan( return this; } - /** - *

This is the name of the SIP trunk. This is just for your reference.

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

This is the list of SIP trunk's gateways.

* @return Reference to {@code this} so that method calls can be chained together. @@ -440,6 +499,23 @@ public _FinalStage gateways(List gateways) { return this; } + /** + *

This is the name of credential. This is just for your reference.

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

This can be used to bring your own SIP trunks or to connect to a Carrier.

* @return Reference to {@code this} so that method calls can be chained together. @@ -465,10 +541,12 @@ public ByoSipTrunkCredential build() { orgId, createdAt, updatedAt, - gateways, name, + gateways, outboundAuthenticationPlan, outboundLeadingPlusEnabled, + techPrefix, + sipDiversionHeader, sbcConfiguration, additionalProperties); } diff --git a/src/main/java/com/vapi/api/types/Call.java b/src/main/java/com/vapi/api/types/Call.java index 0da36d8..b55ded3 100644 --- a/src/main/java/com/vapi/api/types/Call.java +++ b/src/main/java/com/vapi/api/types/Call.java @@ -63,6 +63,8 @@ public final class Call { private final Optional artifact; + private final Optional transport; + private final Optional phoneCallProviderId; private final Optional assistantId; @@ -108,6 +110,7 @@ private Call( Optional analysis, Optional monitor, Optional artifact, + Optional transport, Optional phoneCallProviderId, Optional assistantId, Optional assistant, @@ -140,6 +143,7 @@ private Call( this.analysis = analysis; this.monitor = monitor; this.artifact = artifact; + this.transport = transport; this.phoneCallProviderId = phoneCallProviderId; this.assistantId = assistantId; this.assistant = assistant; @@ -313,6 +317,14 @@ public Optional getArtifact() { return artifact; } + /** + * @return This is the transport used for the call. + */ + @JsonProperty("transport") + public Optional getTransport() { + return transport; + } + /** * @return The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage. *

Only relevant for outboundPhoneCall and inboundPhoneCall type.

@@ -438,6 +450,7 @@ private boolean equalTo(Call other) { && analysis.equals(other.analysis) && monitor.equals(other.monitor) && artifact.equals(other.artifact) + && transport.equals(other.transport) && phoneCallProviderId.equals(other.phoneCallProviderId) && assistantId.equals(other.assistantId) && assistant.equals(other.assistant) @@ -474,6 +487,7 @@ public int hashCode() { this.analysis, this.monitor, this.artifact, + this.transport, this.phoneCallProviderId, this.assistantId, this.assistant, @@ -581,6 +595,10 @@ public interface _FinalStage { _FinalStage artifact(Artifact artifact); + _FinalStage transport(Optional transport); + + _FinalStage transport(Transport transport); + _FinalStage phoneCallProviderId(Optional phoneCallProviderId); _FinalStage phoneCallProviderId(String phoneCallProviderId); @@ -658,6 +676,8 @@ public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage private Optional phoneCallProviderId = Optional.empty(); + private Optional transport = Optional.empty(); + private Optional artifact = Optional.empty(); private Optional monitor = Optional.empty(); @@ -717,6 +737,7 @@ public Builder from(Call other) { analysis(other.getAnalysis()); monitor(other.getMonitor()); artifact(other.getArtifact()); + transport(other.getTransport()); phoneCallProviderId(other.getPhoneCallProviderId()); assistantId(other.getAssistantId()); assistant(other.getAssistant()); @@ -967,6 +988,23 @@ public _FinalStage phoneCallProviderId(Optional phoneCallProviderId) { return this; } + /** + *

This is the transport used for the call.

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

These are the artifacts created from the call. Configure in assistant.artifactPlan.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1260,6 +1298,7 @@ public Call build() { analysis, monitor, artifact, + transport, phoneCallProviderId, assistantId, assistant, diff --git a/src/main/java/com/vapi/api/types/CallEndedReason.java b/src/main/java/com/vapi/api/types/CallEndedReason.java index 04895d9..3363291 100644 --- a/src/main/java/com/vapi/api/types/CallEndedReason.java +++ b/src/main/java/com/vapi/api/types/CallEndedReason.java @@ -6,23 +6,29 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum CallEndedReason { - ASSISTANT_ERROR("assistant-error"), + PIPELINE_ERROR_OPENAI_VOICE_FAILED("pipeline-error-openai-voice-failed"), - ASSISTANT_NOT_FOUND("assistant-not-found"), + PIPELINE_ERROR_CARTESIA_VOICE_FAILED("pipeline-error-cartesia-voice-failed"), - DB_ERROR("db-error"), + PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED("pipeline-error-deepgram-voice-failed"), - NO_SERVER_AVAILABLE("no-server-available"), + PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED("pipeline-error-eleven-labs-voice-failed"), - LICENSE_CHECK_FAILED("license-check-failed"), + PIPELINE_ERROR_PLAYHT_VOICE_FAILED("pipeline-error-playht-voice-failed"), - PIPELINE_ERROR_OPENAI_LLM_FAILED("pipeline-error-openai-llm-failed"), + PIPELINE_ERROR_LMNT_VOICE_FAILED("pipeline-error-lmnt-voice-failed"), - PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED("pipeline-error-azure-openai-llm-failed"), + PIPELINE_ERROR_AZURE_VOICE_FAILED("pipeline-error-azure-voice-failed"), - PIPELINE_ERROR_GROQ_LLM_FAILED("pipeline-error-groq-llm-failed"), + PIPELINE_ERROR_RIME_AI_VOICE_FAILED("pipeline-error-rime-ai-voice-failed"), - PIPELINE_ERROR_ANTHROPIC_LLM_FAILED("pipeline-error-anthropic-llm-failed"), + PIPELINE_ERROR_NEETS_VOICE_FAILED("pipeline-error-neets-voice-failed"), + + DB_ERROR("db-error"), + + ASSISTANT_NOT_FOUND("assistant-not-found"), + + LICENSE_CHECK_FAILED("license-check-failed"), PIPELINE_ERROR_VAPI_LLM_FAILED("pipeline-error-vapi-llm-failed"), @@ -36,28 +42,6 @@ public enum CallEndedReason { PIPELINE_ERROR_VAPI_500_SERVER_ERROR("pipeline-error-vapi-500-server-error"), - PIPELINE_ERROR_OPENAI_VOICE_FAILED("pipeline-error-openai-voice-failed"), - - PIPELINE_ERROR_CARTESIA_VOICE_FAILED("pipeline-error-cartesia-voice-failed"), - - PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED("pipeline-error-deepgram-transcriber-failed"), - - PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED("pipeline-error-deepgram-voice-failed"), - - PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED("pipeline-error-gladia-transcriber-failed"), - - PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED("pipeline-error-eleven-labs-voice-failed"), - - PIPELINE_ERROR_PLAYHT_VOICE_FAILED("pipeline-error-playht-voice-failed"), - - PIPELINE_ERROR_LMNT_VOICE_FAILED("pipeline-error-lmnt-voice-failed"), - - PIPELINE_ERROR_AZURE_VOICE_FAILED("pipeline-error-azure-voice-failed"), - - PIPELINE_ERROR_RIME_AI_VOICE_FAILED("pipeline-error-rime-ai-voice-failed"), - - PIPELINE_ERROR_NEETS_VOICE_FAILED("pipeline-error-neets-voice-failed"), - PIPELINE_NO_AVAILABLE_MODEL("pipeline-no-available-model"), WORKER_SHUTDOWN("worker-shutdown"), @@ -82,6 +66,27 @@ public enum CallEndedReason { VAPIFAULT_TRANSPORT_CONNECTED_BUT_CALL_NOT_ACTIVE("vapifault-transport-connected-but-call-not-active"), + VAPIFAULT_CALL_STARTED_BUT_CONNECTION_TO_TRANSPORT_MISSING( + "vapifault-call-started-but-connection-to-transport-missing"), + + PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED("pipeline-error-deepgram-transcriber-failed"), + + PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED("pipeline-error-gladia-transcriber-failed"), + + PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED("pipeline-error-assembly-ai-transcriber-failed"), + + PIPELINE_ERROR_OPENAI_LLM_FAILED("pipeline-error-openai-llm-failed"), + + PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED("pipeline-error-azure-openai-llm-failed"), + + PIPELINE_ERROR_GROQ_LLM_FAILED("pipeline-error-groq-llm-failed"), + + PIPELINE_ERROR_GOOGLE_LLM_FAILED("pipeline-error-google-llm-failed"), + + PIPELINE_ERROR_XAI_LLM_FAILED("pipeline-error-xai-llm-failed"), + + PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED("pipeline-error-inflection-ai-llm-failed"), + ASSISTANT_NOT_INVALID("assistant-not-invalid"), ASSISTANT_NOT_PROVIDED("assistant-not-provided"), @@ -134,6 +139,37 @@ public enum CallEndedReason { PIPELINE_ERROR_OPENAI_500_SERVER_ERROR("pipeline-error-openai-500-server-error"), + PIPELINE_ERROR_GOOGLE_400_BAD_REQUEST_VALIDATION_FAILED("pipeline-error-google-400-bad-request-validation-failed"), + + PIPELINE_ERROR_GOOGLE_401_UNAUTHORIZED("pipeline-error-google-401-unauthorized"), + + PIPELINE_ERROR_GOOGLE_403_MODEL_ACCESS_DENIED("pipeline-error-google-403-model-access-denied"), + + PIPELINE_ERROR_GOOGLE_429_EXCEEDED_QUOTA("pipeline-error-google-429-exceeded-quota"), + + PIPELINE_ERROR_GOOGLE_500_SERVER_ERROR("pipeline-error-google-500-server-error"), + + PIPELINE_ERROR_XAI_400_BAD_REQUEST_VALIDATION_FAILED("pipeline-error-xai-400-bad-request-validation-failed"), + + PIPELINE_ERROR_XAI_401_UNAUTHORIZED("pipeline-error-xai-401-unauthorized"), + + PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED("pipeline-error-xai-403-model-access-denied"), + + PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA("pipeline-error-xai-429-exceeded-quota"), + + PIPELINE_ERROR_XAI_500_SERVER_ERROR("pipeline-error-xai-500-server-error"), + + PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED( + "pipeline-error-inflection-ai-400-bad-request-validation-failed"), + + PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED("pipeline-error-inflection-ai-401-unauthorized"), + + PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED("pipeline-error-inflection-ai-403-model-access-denied"), + + PIPELINE_ERROR_INFLECTION_AI_429_EXCEEDED_QUOTA("pipeline-error-inflection-ai-429-exceeded-quota"), + + PIPELINE_ERROR_INFLECTION_AI_500_SERVER_ERROR("pipeline-error-inflection-ai-500-server-error"), + PIPELINE_ERROR_AZURE_OPENAI_400_BAD_REQUEST_VALIDATION_FAILED( "pipeline-error-azure-openai-400-bad-request-validation-failed"), @@ -166,6 +202,8 @@ public enum CallEndedReason { PIPELINE_ERROR_ANTHROPIC_500_SERVER_ERROR("pipeline-error-anthropic-500-server-error"), + PIPELINE_ERROR_ANTHROPIC_LLM_FAILED("pipeline-error-anthropic-llm-failed"), + PIPELINE_ERROR_TOGETHER_AI_400_BAD_REQUEST_VALIDATION_FAILED( "pipeline-error-together-ai-400-bad-request-validation-failed"), @@ -256,6 +294,8 @@ public enum CallEndedReason { PIPELINE_ERROR_CUSTOM_LLM_LLM_FAILED("pipeline-error-custom-llm-llm-failed"), + PIPELINE_ERROR_CUSTOM_VOICE_FAILED("pipeline-error-custom-voice-failed"), + PIPELINE_ERROR_CARTESIA_SOCKET_HANG_UP("pipeline-error-cartesia-socket-hang-up"), PIPELINE_ERROR_CARTESIA_REQUESTED_PAYMENT("pipeline-error-cartesia-requested-payment"), @@ -266,8 +306,6 @@ public enum CallEndedReason { PIPELINE_ERROR_CARTESIA_522_SERVER_ERROR("pipeline-error-cartesia-522-server-error"), - PIPELINE_ERROR_CUSTOM_VOICE_FAILED("pipeline-error-custom-voice-failed"), - PIPELINE_ERROR_ELEVEN_LABS_VOICE_NOT_FOUND("pipeline-error-eleven-labs-voice-not-found"), PIPELINE_ERROR_ELEVEN_LABS_QUOTA_EXCEEDED("pipeline-error-eleven-labs-quota-exceeded"), @@ -317,6 +355,9 @@ public enum CallEndedReason { PIPELINE_ERROR_ELEVEN_LABS_MAX_CHARACTER_LIMIT_EXCEEDED("pipeline-error-eleven-labs-max-character-limit-exceeded"), + PIPELINE_ERROR_ELEVEN_LABS_BLOCKED_VOICE_POTENTIALLY_AGAINST_TERMS_OF_SERVICE_AND_AWAITING_VERIFICATION( + "pipeline-error-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification"), + PIPELINE_ERROR_PLAYHT_REQUEST_TIMED_OUT("pipeline-error-playht-request-timed-out"), PIPELINE_ERROR_PLAYHT_INVALID_VOICE("pipeline-error-playht-invalid-voice"), @@ -325,6 +366,8 @@ public enum CallEndedReason { PIPELINE_ERROR_PLAYHT_OUT_OF_CREDITS("pipeline-error-playht-out-of-credits"), + PIPELINE_ERROR_PLAYHT_INVALID_EMOTION("pipeline-error-playht-invalid-emotion"), + PIPELINE_ERROR_PLAYHT_VOICE_MUST_BE_A_VALID_VOICE_MANIFEST_URI( "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri"), @@ -341,26 +384,39 @@ public enum CallEndedReason { PIPELINE_ERROR_PLAYHT_504_GATEWAY_ERROR("pipeline-error-playht-504-gateway-error"), - PIPELINE_ERROR_DEEPGRAM_403_MODEL_ACCESS_DENIED("pipeline-error-deepgram-403-model-access-denied"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_403_MODEL_ACCESS_DENIED( + "pipeline-error-deepgram-returning-403-model-access-denied"), - PIPELINE_ERROR_DEEPGRAM_404_NOT_FOUND("pipeline-error-deepgram-404-not-found"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_401_INVALID_CREDENTIALS( + "pipeline-error-deepgram-returning-401-invalid-credentials"), - PIPELINE_ERROR_DEEPGRAM_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION( - "pipeline-error-deepgram-400-no-such-model-language-tier-combination"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_404_NOT_FOUND("pipeline-error-deepgram-returning-404-not-found"), - PIPELINE_ERROR_DEEPGRAM_500_RETURNING_INVALID_JSON("pipeline-error-deepgram-500-returning-invalid-json"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION( + "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination"), - SIP_GATEWAY_FAILED_TO_CONNECT_CALL("sip-gateway-failed-to-connect-call"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_500_INVALID_JSON("pipeline-error-deepgram-returning-500-invalid-json"), + + PIPELINE_ERROR_DEEPGRAM_RETURNING_502_NETWORK_ERROR("pipeline-error-deepgram-returning-502-network-error"), + + PIPELINE_ERROR_DEEPGRAM_RETURNING_502_BAD_GATEWAY_EHOSTUNREACH( + "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach"), + + PIPELINE_ERROR_TAVUS_VIDEO_FAILED("pipeline-error-tavus-video-failed"), + + PIPELINE_ERROR_CUSTOM_TRANSCRIBER_FAILED("pipeline-error-custom-transcriber-failed"), SILENCE_TIMED_OUT("silence-timed-out"), + SIP_GATEWAY_FAILED_TO_CONNECT_CALL("sip-gateway-failed-to-connect-call"), + TWILIO_FAILED_TO_CONNECT_CALL("twilio-failed-to-connect-call"), TWILIO_REPORTED_CUSTOMER_MISDIALED("twilio-reported-customer-misdialed"), - VOICEMAIL("voicemail"), + VONAGE_REJECTED("vonage-rejected"), - VONAGE_REJECTED("vonage-rejected"); + VOICEMAIL("voicemail"); private final String value; diff --git a/src/main/java/com/vapi/api/types/CallLogPrivileged.java b/src/main/java/com/vapi/api/types/CallLogPrivileged.java new file mode 100644 index 0000000..d63845c --- /dev/null +++ b/src/main/java/com/vapi/api/types/CallLogPrivileged.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CallLogPrivileged.Builder.class) +public final class CallLogPrivileged { + private final String callId; + + private final String orgId; + + private final String log; + + private final CallLogPrivilegedLevel level; + + private final OffsetDateTime time; + + private final Map additionalProperties; + + private CallLogPrivileged( + String callId, + String orgId, + String log, + CallLogPrivilegedLevel level, + OffsetDateTime time, + Map additionalProperties) { + this.callId = callId; + this.orgId = orgId; + this.log = log; + this.level = level; + this.time = time; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the unique identifier for the call. + */ + @JsonProperty("callId") + public String getCallId() { + return callId; + } + + /** + * @return This is the unique identifier for the org that this call log belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the log message associated with the call. + */ + @JsonProperty("log") + public String getLog() { + return log; + } + + /** + * @return This is the level of the log message. + */ + @JsonProperty("level") + public CallLogPrivilegedLevel getLevel() { + return level; + } + + /** + * @return This is the ISO 8601 date-time string of when the log was created. + */ + @JsonProperty("time") + public OffsetDateTime getTime() { + return time; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CallLogPrivileged && equalTo((CallLogPrivileged) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CallLogPrivileged other) { + return callId.equals(other.callId) + && orgId.equals(other.orgId) + && log.equals(other.log) + && level.equals(other.level) + && time.equals(other.time); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.callId, this.orgId, this.log, this.level, this.time); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CallIdStage builder() { + return new Builder(); + } + + public interface CallIdStage { + OrgIdStage callId(@NotNull String callId); + + Builder from(CallLogPrivileged other); + } + + public interface OrgIdStage { + LogStage orgId(@NotNull String orgId); + } + + public interface LogStage { + LevelStage log(@NotNull String log); + } + + public interface LevelStage { + TimeStage level(@NotNull CallLogPrivilegedLevel level); + } + + public interface TimeStage { + _FinalStage time(@NotNull OffsetDateTime time); + } + + public interface _FinalStage { + CallLogPrivileged build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CallIdStage, OrgIdStage, LogStage, LevelStage, TimeStage, _FinalStage { + private String callId; + + private String orgId; + + private String log; + + private CallLogPrivilegedLevel level; + + private OffsetDateTime time; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CallLogPrivileged other) { + callId(other.getCallId()); + orgId(other.getOrgId()); + log(other.getLog()); + level(other.getLevel()); + time(other.getTime()); + return this; + } + + /** + *

This is the unique identifier for the call.

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

This is the unique identifier for the org that this call log belongs to.

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

This is the log message associated with the call.

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

This is the level of the log message.

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

This is the ISO 8601 date-time string of when the log was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("time") + public _FinalStage time(@NotNull OffsetDateTime time) { + this.time = Objects.requireNonNull(time, "time must not be null"); + return this; + } + + @java.lang.Override + public CallLogPrivileged build() { + return new CallLogPrivileged(callId, orgId, log, level, time, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CallLogPrivilegedLevel.java b/src/main/java/com/vapi/api/types/CallLogPrivilegedLevel.java new file mode 100644 index 0000000..fd7dc66 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CallLogPrivilegedLevel.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CallLogPrivilegedLevel { + INFO("INFO"), + + LOG("LOG"), + + WARN("WARN"), + + ERROR("ERROR"), + + CHECKPOINT("CHECKPOINT"); + + private final String value; + + CallLogPrivilegedLevel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/CallLogsPaginatedResponse.java b/src/main/java/com/vapi/api/types/CallLogsPaginatedResponse.java new file mode 100644 index 0000000..ea6dd01 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CallLogsPaginatedResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CallLogsPaginatedResponse.Builder.class) +public final class CallLogsPaginatedResponse { + private final List results; + + private final PaginationMeta metadata; + + private final Map additionalProperties; + + private CallLogsPaginatedResponse( + List results, PaginationMeta metadata, Map additionalProperties) { + this.results = results; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("results") + public List getResults() { + return results; + } + + @JsonProperty("metadata") + public PaginationMeta getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CallLogsPaginatedResponse && equalTo((CallLogsPaginatedResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CallLogsPaginatedResponse other) { + return results.equals(other.results) && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.results, this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MetadataStage builder() { + return new Builder(); + } + + public interface MetadataStage { + _FinalStage metadata(@NotNull PaginationMeta metadata); + + Builder from(CallLogsPaginatedResponse other); + } + + public interface _FinalStage { + CallLogsPaginatedResponse build(); + + _FinalStage results(List results); + + _FinalStage addResults(CallLogPrivileged results); + + _FinalStage addAllResults(List results); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MetadataStage, _FinalStage { + private PaginationMeta metadata; + + private List results = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CallLogsPaginatedResponse other) { + results(other.getResults()); + metadata(other.getMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("metadata") + public _FinalStage metadata(@NotNull PaginationMeta metadata) { + this.metadata = Objects.requireNonNull(metadata, "metadata must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllResults(List results) { + this.results.addAll(results); + return this; + } + + @java.lang.Override + public _FinalStage addResults(CallLogPrivileged results) { + this.results.add(results); + return this; + } + + @java.lang.Override + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public _FinalStage results(List results) { + this.results.clear(); + this.results.addAll(results); + return this; + } + + @java.lang.Override + public CallLogsPaginatedResponse build() { + return new CallLogsPaginatedResponse(results, metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CartesiaCredential.java b/src/main/java/com/vapi/api/types/CartesiaCredential.java index b60bbde..53ab7b7 100644 --- a/src/main/java/com/vapi/api/types/CartesiaCredential.java +++ b/src/main/java/com/vapi/api/types/CartesiaCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class CartesiaCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private CartesiaCredential( @@ -38,12 +42,14 @@ private CartesiaCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(CartesiaCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { CartesiaCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(CartesiaCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CartesiaCredential build() { - return new CartesiaCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new CartesiaCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CartesiaVoice.java b/src/main/java/com/vapi/api/types/CartesiaVoice.java index a2b7355..4762239 100644 --- a/src/main/java/com/vapi/api/types/CartesiaVoice.java +++ b/src/main/java/com/vapi/api/types/CartesiaVoice.java @@ -21,42 +21,33 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CartesiaVoice.Builder.class) public final class CartesiaVoice { - private final Optional fillerInjectionEnabled; - private final Optional model; private final Optional language; + private final Optional chunkPlan; + private final String voiceId; - private final Optional chunkPlan; + private final Optional fallbackPlan; private final Map additionalProperties; private CartesiaVoice( - Optional fillerInjectionEnabled, Optional model, Optional language, - String voiceId, Optional chunkPlan, + String voiceId, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.model = model; this.language = language; - this.voiceId = voiceId; this.chunkPlan = chunkPlan; + this.voiceId = voiceId; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

Default false because you can achieve better results with prompting the model.

- */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the model that will be used. This is optional and will default to the correct model for the voiceId. */ @@ -73,6 +64,14 @@ public Optional getLanguage() { return language; } + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + /** * @return This is the provider-specific ID that will be used. */ @@ -82,11 +81,11 @@ public String getVoiceId() { } /** - * @return This is the plan for chunking the model output before it is sent to the voice provider. + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. */ - @JsonProperty("chunkPlan") - public Optional getChunkPlan() { - return chunkPlan; + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; } @java.lang.Override @@ -101,16 +100,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(CartesiaVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && model.equals(other.model) + return model.equals(other.model) && language.equals(other.language) + && chunkPlan.equals(other.chunkPlan) && voiceId.equals(other.voiceId) - && chunkPlan.equals(other.chunkPlan); + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.model, this.language, this.voiceId, this.chunkPlan); + return Objects.hash(this.model, this.language, this.chunkPlan, this.voiceId, this.fallbackPlan); } @java.lang.Override @@ -131,10 +130,6 @@ public interface VoiceIdStage { public interface _FinalStage { CartesiaVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage model(Optional model); _FinalStage model(CartesiaVoiceModel model); @@ -146,20 +141,24 @@ public interface _FinalStage { _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private String voiceId; + private Optional fallbackPlan = Optional.empty(); + private Optional chunkPlan = Optional.empty(); private Optional language = Optional.empty(); private Optional model = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -167,11 +166,11 @@ private Builder() {} @java.lang.Override public Builder from(CartesiaVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); model(other.getModel()); language(other.getLanguage()); - voiceId(other.getVoiceId()); chunkPlan(other.getChunkPlan()); + voiceId(other.getVoiceId()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -186,6 +185,23 @@ public _FinalStage voiceId(@NotNull String voiceId) { return this; } + /** + *

This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

This is the plan for chunking the model output before it is sent to the voice provider.

* @return Reference to {@code this} so that method calls can be chained together. @@ -237,27 +253,9 @@ public _FinalStage model(Optional model) { return this; } - /** - *

This determines whether fillers are injected into the model output before inputting it into the voice provider.

- *

Default false because you can achieve better results with prompting the model.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; - return this; - } - @java.lang.Override public CartesiaVoice build() { - return new CartesiaVoice(fillerInjectionEnabled, model, language, voiceId, chunkPlan, additionalProperties); + return new CartesiaVoice(model, language, chunkPlan, voiceId, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CartesiaVoiceLanguage.java b/src/main/java/com/vapi/api/types/CartesiaVoiceLanguage.java index 566f142..f7574c5 100644 --- a/src/main/java/com/vapi/api/types/CartesiaVoiceLanguage.java +++ b/src/main/java/com/vapi/api/types/CartesiaVoiceLanguage.java @@ -6,10 +6,10 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum CartesiaVoiceLanguage { - DE("de"), - EN("en"), + DE("de"), + ES("es"), FR("fr"), @@ -18,7 +18,23 @@ public enum CartesiaVoiceLanguage { PT("pt"), - ZH("zh"); + ZH("zh"), + + HI("hi"), + + IT("it"), + + KO("ko"), + + NL("nl"), + + PL("pl"), + + RU("ru"), + + SV("sv"), + + TR("tr"); private final String value; diff --git a/src/main/java/com/vapi/api/types/ClientInboundMessageAddMessage.java b/src/main/java/com/vapi/api/types/ClientInboundMessageAddMessage.java index b986761..f5493f3 100644 --- a/src/main/java/com/vapi/api/types/ClientInboundMessageAddMessage.java +++ b/src/main/java/com/vapi/api/types/ClientInboundMessageAddMessage.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class ClientInboundMessageAddMessage { private final OpenAiMessage message; + private final Optional triggerResponseEnabled; + private final Map additionalProperties; - private ClientInboundMessageAddMessage(OpenAiMessage message, Map additionalProperties) { + private ClientInboundMessageAddMessage( + OpenAiMessage message, Optional triggerResponseEnabled, Map additionalProperties) { this.message = message; + this.triggerResponseEnabled = triggerResponseEnabled; this.additionalProperties = additionalProperties; } @@ -36,6 +42,20 @@ public OpenAiMessage getMessage() { return message; } + /** + * @return This is the flag to trigger a response, or to insert the message into the conversation history silently. Defaults to true. + *

Usage:

+ *
    + *
  • Use true to trigger a response.
  • + *
  • Use false to insert the message into the conversation history silently.
  • + *
+ *

@default true

+ */ + @JsonProperty("triggerResponseEnabled") + public Optional getTriggerResponseEnabled() { + return triggerResponseEnabled; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -48,12 +68,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ClientInboundMessageAddMessage other) { - return message.equals(other.message); + return message.equals(other.message) && triggerResponseEnabled.equals(other.triggerResponseEnabled); } @java.lang.Override public int hashCode() { - return Objects.hash(this.message); + return Objects.hash(this.message, this.triggerResponseEnabled); } @java.lang.Override @@ -73,12 +93,18 @@ public interface MessageStage { public interface _FinalStage { ClientInboundMessageAddMessage build(); + + _FinalStage triggerResponseEnabled(Optional triggerResponseEnabled); + + _FinalStage triggerResponseEnabled(Boolean triggerResponseEnabled); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements MessageStage, _FinalStage { private OpenAiMessage message; + private Optional triggerResponseEnabled = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -87,6 +113,7 @@ private Builder() {} @java.lang.Override public Builder from(ClientInboundMessageAddMessage other) { message(other.getMessage()); + triggerResponseEnabled(other.getTriggerResponseEnabled()); return this; } @@ -101,9 +128,32 @@ public _FinalStage message(@NotNull OpenAiMessage message) { return this; } + /** + *

This is the flag to trigger a response, or to insert the message into the conversation history silently. Defaults to true.

+ *

Usage:

+ *
    + *
  • Use true to trigger a response.
  • + *
  • Use false to insert the message into the conversation history silently.
  • + *
+ *

@default true

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage triggerResponseEnabled(Boolean triggerResponseEnabled) { + this.triggerResponseEnabled = Optional.ofNullable(triggerResponseEnabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "triggerResponseEnabled", nulls = Nulls.SKIP) + public _FinalStage triggerResponseEnabled(Optional triggerResponseEnabled) { + this.triggerResponseEnabled = triggerResponseEnabled; + return this; + } + @java.lang.Override public ClientInboundMessageAddMessage build() { - return new ClientInboundMessageAddMessage(message, additionalProperties); + return new ClientInboundMessageAddMessage(message, triggerResponseEnabled, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ClientInboundMessageMessage.java b/src/main/java/com/vapi/api/types/ClientInboundMessageMessage.java index f4b5761..e86e627 100644 --- a/src/main/java/com/vapi/api/types/ClientInboundMessageMessage.java +++ b/src/main/java/com/vapi/api/types/ClientInboundMessageMessage.java @@ -38,6 +38,10 @@ public static ClientInboundMessageMessage say(ClientInboundMessageSay value) { return new ClientInboundMessageMessage(new SayValue(value)); } + public static ClientInboundMessageMessage transfer(ClientInboundMessageTransfer value) { + return new ClientInboundMessageMessage(new TransferValue(value)); + } + public boolean isAddMessage() { return value instanceof AddMessageValue; } @@ -50,6 +54,10 @@ public boolean isSay() { return value instanceof SayValue; } + public boolean isTransfer() { + return value instanceof TransferValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -75,6 +83,13 @@ public Optional getSay() { return Optional.empty(); } + public Optional getTransfer() { + if (isTransfer()) { + return Optional.of(((TransferValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -94,6 +109,8 @@ public interface Visitor { T visitSay(ClientInboundMessageSay say); + T visitTransfer(ClientInboundMessageTransfer transfer); + T _visitUnknown(Object unknownType); } @@ -101,7 +118,8 @@ public interface Visitor { @JsonSubTypes({ @JsonSubTypes.Type(AddMessageValue.class), @JsonSubTypes.Type(ControlValue.class), - @JsonSubTypes.Type(SayValue.class) + @JsonSubTypes.Type(SayValue.class), + @JsonSubTypes.Type(TransferValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -222,6 +240,44 @@ public String toString() { } } + @JsonTypeName("transfer") + private static final class TransferValue implements Value { + @JsonUnwrapped + private ClientInboundMessageTransfer value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TransferValue() {} + + private TransferValue(ClientInboundMessageTransfer value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTransfer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferValue && equalTo((TransferValue) other); + } + + private boolean equalTo(TransferValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientInboundMessageMessage{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/ClientInboundMessageTransfer.java b/src/main/java/com/vapi/api/types/ClientInboundMessageTransfer.java new file mode 100644 index 0000000..2ffd78a --- /dev/null +++ b/src/main/java/com/vapi/api/types/ClientInboundMessageTransfer.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientInboundMessageTransfer.Builder.class) +public final class ClientInboundMessageTransfer { + private final Optional destination; + + private final Map additionalProperties; + + private ClientInboundMessageTransfer( + Optional destination, Map additionalProperties) { + this.destination = destination; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the destination to transfer the call to. + */ + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientInboundMessageTransfer && equalTo((ClientInboundMessageTransfer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientInboundMessageTransfer other) { + return destination.equals(other.destination); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.destination); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional destination = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientInboundMessageTransfer other) { + destination(other.getDestination()); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(ClientInboundMessageTransferDestination destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + public ClientInboundMessageTransfer build() { + return new ClientInboundMessageTransfer(destination, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ClientInboundMessageTransferDestination.java b/src/main/java/com/vapi/api/types/ClientInboundMessageTransferDestination.java new file mode 100644 index 0000000..f5396bb --- /dev/null +++ b/src/main/java/com/vapi/api/types/ClientInboundMessageTransferDestination.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class ClientInboundMessageTransferDestination { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private ClientInboundMessageTransferDestination(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static ClientInboundMessageTransferDestination number(TransferDestinationNumber value) { + return new ClientInboundMessageTransferDestination(new NumberValue(value)); + } + + public static ClientInboundMessageTransferDestination sip(TransferDestinationSip value) { + return new ClientInboundMessageTransferDestination(new SipValue(value)); + } + + public boolean isNumber() { + return value instanceof NumberValue; + } + + public boolean isSip() { + return value instanceof SipValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getNumber() { + if (isNumber()) { + return Optional.of(((NumberValue) value).value); + } + return Optional.empty(); + } + + public Optional getSip() { + if (isSip()) { + return Optional.of(((SipValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitNumber(TransferDestinationNumber number); + + T visitSip(TransferDestinationSip sip); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(NumberValue.class), @JsonSubTypes.Type(SipValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("number") + private static final class NumberValue implements Value { + @JsonUnwrapped + private TransferDestinationNumber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private NumberValue() {} + + private NumberValue(TransferDestinationNumber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitNumber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NumberValue && equalTo((NumberValue) other); + } + + private boolean equalTo(NumberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientInboundMessageTransferDestination{" + "value: " + value + "}"; + } + } + + @JsonTypeName("sip") + private static final class SipValue implements Value { + @JsonUnwrapped + private TransferDestinationSip value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private SipValue() {} + + private SipValue(TransferDestinationSip value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitSip(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SipValue && equalTo((SipValue) other); + } + + private boolean equalTo(SipValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientInboundMessageTransferDestination{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "ClientInboundMessageTransferDestination{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/ClientMessageLanguageChanged.java b/src/main/java/com/vapi/api/types/ClientMessageLanguageChangeDetected.java similarity index 77% rename from src/main/java/com/vapi/api/types/ClientMessageLanguageChanged.java rename to src/main/java/com/vapi/api/types/ClientMessageLanguageChangeDetected.java index c747a9c..6c94bee 100644 --- a/src/main/java/com/vapi/api/types/ClientMessageLanguageChanged.java +++ b/src/main/java/com/vapi/api/types/ClientMessageLanguageChangeDetected.java @@ -17,13 +17,13 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ClientMessageLanguageChanged.Builder.class) -public final class ClientMessageLanguageChanged { +@JsonDeserialize(builder = ClientMessageLanguageChangeDetected.Builder.class) +public final class ClientMessageLanguageChangeDetected { private final String language; private final Map additionalProperties; - private ClientMessageLanguageChanged(String language, Map additionalProperties) { + private ClientMessageLanguageChangeDetected(String language, Map additionalProperties) { this.language = language; this.additionalProperties = additionalProperties; } @@ -39,7 +39,8 @@ public String getLanguage() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ClientMessageLanguageChanged && equalTo((ClientMessageLanguageChanged) other); + return other instanceof ClientMessageLanguageChangeDetected + && equalTo((ClientMessageLanguageChangeDetected) other); } @JsonAnyGetter @@ -47,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ClientMessageLanguageChanged other) { + private boolean equalTo(ClientMessageLanguageChangeDetected other) { return language.equals(other.language); } @@ -68,11 +69,11 @@ public static LanguageStage builder() { public interface LanguageStage { _FinalStage language(@NotNull String language); - Builder from(ClientMessageLanguageChanged other); + Builder from(ClientMessageLanguageChangeDetected other); } public interface _FinalStage { - ClientMessageLanguageChanged build(); + ClientMessageLanguageChangeDetected build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -85,7 +86,7 @@ public static final class Builder implements LanguageStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(ClientMessageLanguageChanged other) { + public Builder from(ClientMessageLanguageChangeDetected other) { language(other.getLanguage()); return this; } @@ -102,8 +103,8 @@ public _FinalStage language(@NotNull String language) { } @java.lang.Override - public ClientMessageLanguageChanged build() { - return new ClientMessageLanguageChanged(language, additionalProperties); + public ClientMessageLanguageChangeDetected build() { + return new ClientMessageLanguageChangeDetected(language, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ClientMessageMessage.java b/src/main/java/com/vapi/api/types/ClientMessageMessage.java index 3a7cef6..166440e 100644 --- a/src/main/java/com/vapi/api/types/ClientMessageMessage.java +++ b/src/main/java/com/vapi/api/types/ClientMessageMessage.java @@ -58,12 +58,16 @@ public static ClientMessageMessage toolCallsResult(ClientMessageToolCallsResult return new ClientMessageMessage(new ToolCallsResultValue(value)); } + public static ClientMessageMessage transferUpdate(ClientMessageTransferUpdate value) { + return new ClientMessageMessage(new TransferUpdateValue(value)); + } + public static ClientMessageMessage userInterrupted(ClientMessageUserInterrupted value) { return new ClientMessageMessage(new UserInterruptedValue(value)); } - public static ClientMessageMessage languageChanged(ClientMessageLanguageChanged value) { - return new ClientMessageMessage(new LanguageChangedValue(value)); + public static ClientMessageMessage languageChangeDetected(ClientMessageLanguageChangeDetected value) { + return new ClientMessageMessage(new LanguageChangeDetectedValue(value)); } public static ClientMessageMessage voiceInput(ClientMessageVoiceInput value) { @@ -102,12 +106,16 @@ public boolean isToolCallsResult() { return value instanceof ToolCallsResultValue; } + public boolean isTransferUpdate() { + return value instanceof TransferUpdateValue; + } + public boolean isUserInterrupted() { return value instanceof UserInterruptedValue; } - public boolean isLanguageChanged() { - return value instanceof LanguageChangedValue; + public boolean isLanguageChangeDetected() { + return value instanceof LanguageChangeDetectedValue; } public boolean isVoiceInput() { @@ -174,6 +182,13 @@ public Optional getToolCallsResult() { return Optional.empty(); } + public Optional getTransferUpdate() { + if (isTransferUpdate()) { + return Optional.of(((TransferUpdateValue) value).value); + } + return Optional.empty(); + } + public Optional getUserInterrupted() { if (isUserInterrupted()) { return Optional.of(((UserInterruptedValue) value).value); @@ -181,9 +196,9 @@ public Optional getUserInterrupted() { return Optional.empty(); } - public Optional getLanguageChanged() { - if (isLanguageChanged()) { - return Optional.of(((LanguageChangedValue) value).value); + public Optional getLanguageChangeDetected() { + if (isLanguageChangeDetected()) { + return Optional.of(((LanguageChangeDetectedValue) value).value); } return Optional.empty(); } @@ -224,9 +239,11 @@ public interface Visitor { T visitToolCallsResult(ClientMessageToolCallsResult toolCallsResult); + T visitTransferUpdate(ClientMessageTransferUpdate transferUpdate); + T visitUserInterrupted(ClientMessageUserInterrupted userInterrupted); - T visitLanguageChanged(ClientMessageLanguageChanged languageChanged); + T visitLanguageChangeDetected(ClientMessageLanguageChangeDetected languageChangeDetected); T visitVoiceInput(ClientMessageVoiceInput voiceInput); @@ -243,8 +260,9 @@ public interface Visitor { @JsonSubTypes.Type(TranscriptValue.class), @JsonSubTypes.Type(ToolCallsValue.class), @JsonSubTypes.Type(ToolCallsResultValue.class), + @JsonSubTypes.Type(TransferUpdateValue.class), @JsonSubTypes.Type(UserInterruptedValue.class), - @JsonSubTypes.Type(LanguageChangedValue.class), + @JsonSubTypes.Type(LanguageChangeDetectedValue.class), @JsonSubTypes.Type(VoiceInputValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) @@ -556,6 +574,44 @@ public String toString() { } } + @JsonTypeName("transfer-update") + private static final class TransferUpdateValue implements Value { + @JsonUnwrapped + private ClientMessageTransferUpdate value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TransferUpdateValue() {} + + private TransferUpdateValue(ClientMessageTransferUpdate value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTransferUpdate(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferUpdateValue && equalTo((TransferUpdateValue) other); + } + + private boolean equalTo(TransferUpdateValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientMessageMessage{" + "value: " + value + "}"; + } + } + @JsonTypeName("user-interrupted") private static final class UserInterruptedValue implements Value { @JsonUnwrapped @@ -594,30 +650,30 @@ public String toString() { } } - @JsonTypeName("language-changed") - private static final class LanguageChangedValue implements Value { + @JsonTypeName("language-change-detected") + private static final class LanguageChangeDetectedValue implements Value { @JsonUnwrapped - private ClientMessageLanguageChanged value; + private ClientMessageLanguageChangeDetected value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private LanguageChangedValue() {} + private LanguageChangeDetectedValue() {} - private LanguageChangedValue(ClientMessageLanguageChanged value) { + private LanguageChangeDetectedValue(ClientMessageLanguageChangeDetected value) { this.value = value; } @java.lang.Override public T visit(Visitor visitor) { - return visitor.visitLanguageChanged(value); + return visitor.visitLanguageChangeDetected(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof LanguageChangedValue && equalTo((LanguageChangedValue) other); + return other instanceof LanguageChangeDetectedValue && equalTo((LanguageChangeDetectedValue) other); } - private boolean equalTo(LanguageChangedValue other) { + private boolean equalTo(LanguageChangeDetectedValue other) { return value.equals(other.value); } diff --git a/src/main/java/com/vapi/api/types/ClientMessageToolCallsToolWithToolCallListItem.java b/src/main/java/com/vapi/api/types/ClientMessageToolCallsToolWithToolCallListItem.java index 633ccf2..952e942 100644 --- a/src/main/java/com/vapi/api/types/ClientMessageToolCallsToolWithToolCallListItem.java +++ b/src/main/java/com/vapi/api/types/ClientMessageToolCallsToolWithToolCallListItem.java @@ -3,257 +3,142 @@ */ package com.vapi.api.types; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; import java.util.Objects; -import java.util.Optional; +@JsonDeserialize(using = ClientMessageToolCallsToolWithToolCallListItem.Deserializer.class) public final class ClientMessageToolCallsToolWithToolCallListItem { - private final Value value; + private final Object value; - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private ClientMessageToolCallsToolWithToolCallListItem(Value value) { - this.value = value; - } + private final int type; - public T visit(Visitor visitor) { - return value.visit(visitor); + private ClientMessageToolCallsToolWithToolCallListItem(Object value, int type) { + this.value = value; + this.type = type; } - public static ClientMessageToolCallsToolWithToolCallListItem function(FunctionToolWithToolCall value) { - return new ClientMessageToolCallsToolWithToolCallListItem(new FunctionValue(value)); + @JsonValue + public Object get() { + return this.value; } - public static ClientMessageToolCallsToolWithToolCallListItem ghl(GhlToolWithToolCall value) { - return new ClientMessageToolCallsToolWithToolCallListItem(new GhlValue(value)); + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FunctionToolWithToolCall) this.value); + } else if (this.type == 1) { + return visitor.visit((GhlToolWithToolCall) this.value); + } else if (this.type == 2) { + return visitor.visit((MakeToolWithToolCall) this.value); + } else if (this.type == 3) { + return visitor.visit((Object) this.value); + } else if (this.type == 4) { + return visitor.visit((Object) this.value); + } else if (this.type == 5) { + return visitor.visit((Object) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); } - public static ClientMessageToolCallsToolWithToolCallListItem make(MakeToolWithToolCall value) { - return new ClientMessageToolCallsToolWithToolCallListItem(new MakeValue(value)); + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientMessageToolCallsToolWithToolCallListItem + && equalTo((ClientMessageToolCallsToolWithToolCallListItem) other); } - public boolean isFunction() { - return value instanceof FunctionValue; + private boolean equalTo(ClientMessageToolCallsToolWithToolCallListItem other) { + return value.equals(other.value); } - public boolean isGhl() { - return value instanceof GhlValue; + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); } - public boolean isMake() { - return value instanceof MakeValue; + @java.lang.Override + public String toString() { + return this.value.toString(); } - public boolean _isUnknown() { - return value instanceof _UnknownValue; + public static ClientMessageToolCallsToolWithToolCallListItem of(FunctionToolWithToolCall value) { + return new ClientMessageToolCallsToolWithToolCallListItem(value, 0); } - public Optional getFunction() { - if (isFunction()) { - return Optional.of(((FunctionValue) value).value); - } - return Optional.empty(); + public static ClientMessageToolCallsToolWithToolCallListItem of(GhlToolWithToolCall value) { + return new ClientMessageToolCallsToolWithToolCallListItem(value, 1); } - public Optional getGhl() { - if (isGhl()) { - return Optional.of(((GhlValue) value).value); - } - return Optional.empty(); + public static ClientMessageToolCallsToolWithToolCallListItem of(MakeToolWithToolCall value) { + return new ClientMessageToolCallsToolWithToolCallListItem(value, 2); } - public Optional getMake() { - if (isMake()) { - return Optional.of(((MakeValue) value).value); - } - return Optional.empty(); + public static ClientMessageToolCallsToolWithToolCallListItem of(Object value) { + return new ClientMessageToolCallsToolWithToolCallListItem(value, 3); } - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); + public static ClientMessageToolCallsToolWithToolCallListItem of(Object value) { + return new ClientMessageToolCallsToolWithToolCallListItem(value, 4); } - @JsonValue - private Value getValue() { - return this.value; + public static ClientMessageToolCallsToolWithToolCallListItem of(Object value) { + return new ClientMessageToolCallsToolWithToolCallListItem(value, 5); } public interface Visitor { - T visitFunction(FunctionToolWithToolCall function); - - T visitGhl(GhlToolWithToolCall ghl); - - T visitMake(MakeToolWithToolCall make); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({ - @JsonSubTypes.Type(FunctionValue.class), - @JsonSubTypes.Type(GhlValue.class), - @JsonSubTypes.Type(MakeValue.class) - }) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("function") - private static final class FunctionValue implements Value { - @JsonUnwrapped - private FunctionToolWithToolCall value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private FunctionValue() {} - - private FunctionValue(FunctionToolWithToolCall value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitFunction(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FunctionValue && equalTo((FunctionValue) other); - } - - private boolean equalTo(FunctionValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "ClientMessageToolCallsToolWithToolCallListItem{" + "value: " + value + "}"; - } - } - - @JsonTypeName("ghl") - private static final class GhlValue implements Value { - @JsonUnwrapped - private GhlToolWithToolCall value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private GhlValue() {} - - private GhlValue(GhlToolWithToolCall value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitGhl(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GhlValue && equalTo((GhlValue) other); - } - - private boolean equalTo(GhlValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "ClientMessageToolCallsToolWithToolCallListItem{" + "value: " + value + "}"; - } - } - - @JsonTypeName("make") - private static final class MakeValue implements Value { - @JsonUnwrapped - private MakeToolWithToolCall value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private MakeValue() {} - - private MakeValue(MakeToolWithToolCall value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitMake(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MakeValue && equalTo((MakeValue) other); - } - - private boolean equalTo(MakeValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "ClientMessageToolCallsToolWithToolCallListItem{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "ClientMessageToolCallsToolWithToolCallListItem{" + "type: " + type + ", value: " + value + "}"; + T visit(FunctionToolWithToolCall value); + + T visit(GhlToolWithToolCall value); + + T visit(MakeToolWithToolCall value); + + T visit(Object value); + + T visit(Object value); + + T visit(Object value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ClientMessageToolCallsToolWithToolCallListItem.class); + } + + @java.lang.Override + public ClientMessageToolCallsToolWithToolCallListItem deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FunctionToolWithToolCall.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, GhlToolWithToolCall.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, MakeToolWithToolCall.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/src/main/java/com/vapi/api/types/ClientMessageTransferUpdate.java b/src/main/java/com/vapi/api/types/ClientMessageTransferUpdate.java new file mode 100644 index 0000000..9decfa9 --- /dev/null +++ b/src/main/java/com/vapi/api/types/ClientMessageTransferUpdate.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientMessageTransferUpdate.Builder.class) +public final class ClientMessageTransferUpdate { + private final Optional destination; + + private final Optional toAssistant; + + private final Optional fromAssistant; + + private final Optional> toStepRecord; + + private final Optional> fromStepRecord; + + private final Map additionalProperties; + + private ClientMessageTransferUpdate( + Optional destination, + Optional toAssistant, + Optional fromAssistant, + Optional> toStepRecord, + Optional> fromStepRecord, + Map additionalProperties) { + this.destination = destination; + this.toAssistant = toAssistant; + this.fromAssistant = fromAssistant; + this.toStepRecord = toStepRecord; + this.fromStepRecord = fromStepRecord; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the destination of the transfer. + */ + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + /** + * @return This is the assistant that the call is being transferred to. This is only sent if destination.type is "assistant". + */ + @JsonProperty("toAssistant") + public Optional getToAssistant() { + return toAssistant; + } + + /** + * @return This is the assistant that the call is being transferred from. This is only sent if destination.type is "assistant". + */ + @JsonProperty("fromAssistant") + public Optional getFromAssistant() { + return fromAssistant; + } + + /** + * @return This is the step that the conversation moved to. + */ + @JsonProperty("toStepRecord") + public Optional> getToStepRecord() { + return toStepRecord; + } + + /** + * @return This is the step that the conversation moved from. = + */ + @JsonProperty("fromStepRecord") + public Optional> getFromStepRecord() { + return fromStepRecord; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientMessageTransferUpdate && equalTo((ClientMessageTransferUpdate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientMessageTransferUpdate other) { + return destination.equals(other.destination) + && toAssistant.equals(other.toAssistant) + && fromAssistant.equals(other.fromAssistant) + && toStepRecord.equals(other.toStepRecord) + && fromStepRecord.equals(other.fromStepRecord); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.destination, this.toAssistant, this.fromAssistant, this.toStepRecord, this.fromStepRecord); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional destination = Optional.empty(); + + private Optional toAssistant = Optional.empty(); + + private Optional fromAssistant = Optional.empty(); + + private Optional> toStepRecord = Optional.empty(); + + private Optional> fromStepRecord = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientMessageTransferUpdate other) { + destination(other.getDestination()); + toAssistant(other.getToAssistant()); + fromAssistant(other.getFromAssistant()); + toStepRecord(other.getToStepRecord()); + fromStepRecord(other.getFromStepRecord()); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(ClientMessageTransferUpdateDestination destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + @JsonSetter(value = "toAssistant", nulls = Nulls.SKIP) + public Builder toAssistant(Optional toAssistant) { + this.toAssistant = toAssistant; + return this; + } + + public Builder toAssistant(CreateAssistantDto toAssistant) { + this.toAssistant = Optional.ofNullable(toAssistant); + return this; + } + + @JsonSetter(value = "fromAssistant", nulls = Nulls.SKIP) + public Builder fromAssistant(Optional fromAssistant) { + this.fromAssistant = fromAssistant; + return this; + } + + public Builder fromAssistant(CreateAssistantDto fromAssistant) { + this.fromAssistant = Optional.ofNullable(fromAssistant); + return this; + } + + @JsonSetter(value = "toStepRecord", nulls = Nulls.SKIP) + public Builder toStepRecord(Optional> toStepRecord) { + this.toStepRecord = toStepRecord; + return this; + } + + public Builder toStepRecord(Map toStepRecord) { + this.toStepRecord = Optional.ofNullable(toStepRecord); + return this; + } + + @JsonSetter(value = "fromStepRecord", nulls = Nulls.SKIP) + public Builder fromStepRecord(Optional> fromStepRecord) { + this.fromStepRecord = fromStepRecord; + return this; + } + + public Builder fromStepRecord(Map fromStepRecord) { + this.fromStepRecord = Optional.ofNullable(fromStepRecord); + return this; + } + + public ClientMessageTransferUpdate build() { + return new ClientMessageTransferUpdate( + destination, toAssistant, fromAssistant, toStepRecord, fromStepRecord, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ClientMessageTransferUpdateDestination.java b/src/main/java/com/vapi/api/types/ClientMessageTransferUpdateDestination.java new file mode 100644 index 0000000..9f665ad --- /dev/null +++ b/src/main/java/com/vapi/api/types/ClientMessageTransferUpdateDestination.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class ClientMessageTransferUpdateDestination { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private ClientMessageTransferUpdateDestination(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static ClientMessageTransferUpdateDestination assistant(TransferDestinationAssistant value) { + return new ClientMessageTransferUpdateDestination(new AssistantValue(value)); + } + + public static ClientMessageTransferUpdateDestination step(TransferDestinationStep value) { + return new ClientMessageTransferUpdateDestination(new StepValue(value)); + } + + public static ClientMessageTransferUpdateDestination number(TransferDestinationNumber value) { + return new ClientMessageTransferUpdateDestination(new NumberValue(value)); + } + + public static ClientMessageTransferUpdateDestination sip(TransferDestinationSip value) { + return new ClientMessageTransferUpdateDestination(new SipValue(value)); + } + + public boolean isAssistant() { + return value instanceof AssistantValue; + } + + public boolean isStep() { + return value instanceof StepValue; + } + + public boolean isNumber() { + return value instanceof NumberValue; + } + + public boolean isSip() { + return value instanceof SipValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getAssistant() { + if (isAssistant()) { + return Optional.of(((AssistantValue) value).value); + } + return Optional.empty(); + } + + public Optional getStep() { + if (isStep()) { + return Optional.of(((StepValue) value).value); + } + return Optional.empty(); + } + + public Optional getNumber() { + if (isNumber()) { + return Optional.of(((NumberValue) value).value); + } + return Optional.empty(); + } + + public Optional getSip() { + if (isSip()) { + return Optional.of(((SipValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitAssistant(TransferDestinationAssistant assistant); + + T visitStep(TransferDestinationStep step); + + T visitNumber(TransferDestinationNumber number); + + T visitSip(TransferDestinationSip sip); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(AssistantValue.class), + @JsonSubTypes.Type(StepValue.class), + @JsonSubTypes.Type(NumberValue.class), + @JsonSubTypes.Type(SipValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("assistant") + private static final class AssistantValue implements Value { + @JsonUnwrapped + private TransferDestinationAssistant value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AssistantValue() {} + + private AssistantValue(TransferDestinationAssistant value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAssistant(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssistantValue && equalTo((AssistantValue) other); + } + + private boolean equalTo(AssistantValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientMessageTransferUpdateDestination{" + "value: " + value + "}"; + } + } + + @JsonTypeName("step") + private static final class StepValue implements Value { + @JsonUnwrapped + private TransferDestinationStep value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private StepValue() {} + + private StepValue(TransferDestinationStep value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitStep(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof StepValue && equalTo((StepValue) other); + } + + private boolean equalTo(StepValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientMessageTransferUpdateDestination{" + "value: " + value + "}"; + } + } + + @JsonTypeName("number") + private static final class NumberValue implements Value { + @JsonUnwrapped + private TransferDestinationNumber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private NumberValue() {} + + private NumberValue(TransferDestinationNumber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitNumber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NumberValue && equalTo((NumberValue) other); + } + + private boolean equalTo(NumberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientMessageTransferUpdateDestination{" + "value: " + value + "}"; + } + } + + @JsonTypeName("sip") + private static final class SipValue implements Value { + @JsonUnwrapped + private TransferDestinationSip value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private SipValue() {} + + private SipValue(TransferDestinationSip value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitSip(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SipValue && equalTo((SipValue) other); + } + + private boolean equalTo(SipValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ClientMessageTransferUpdateDestination{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "ClientMessageTransferUpdateDestination{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/ComputerTool.java b/src/main/java/com/vapi/api/types/ComputerTool.java new file mode 100644 index 0000000..b8ceef6 --- /dev/null +++ b/src/main/java/com/vapi/api/types/ComputerTool.java @@ -0,0 +1,517 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +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 = ComputerTool.Builder.class) +public final class ComputerTool { + private final Optional async; + + private final Optional> messages; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional function; + + private final Optional server; + + private final double displayWidthPx; + + private final double displayHeightPx; + + private final Optional displayNumber; + + private final Map additionalProperties; + + private ComputerTool( + Optional async, + Optional> messages, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional function, + Optional server, + double displayWidthPx, + double displayHeightPx, + Optional displayNumber, + Map additionalProperties) { + this.async = async; + this.messages = messages; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.function = function; + this.server = server; + this.displayWidthPx = displayWidthPx; + this.displayHeightPx = displayHeightPx; + this.displayNumber = displayNumber; + this.additionalProperties = additionalProperties; + } + + /** + * @return This determines if the tool is async. + *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ */ + @JsonProperty("async") + public Optional getAsync() { + return async; + } + + /** + * @return These are the messages that will be spoken to the user as the tool is running. + *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

+ */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return The sub type of tool. + */ + @JsonProperty("subType") + public String getSubType() { + return "computer_20241022"; + } + + /** + * @return This is the unique identifier for the tool. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the organization that this tool belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the tool was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the tool was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the function definition of the tool. + *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

+ */ + @JsonProperty("function") + public Optional getFunction() { + return function; + } + + /** + * @return This is the server that will be hit when this tool is requested by the model. + *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + + /** + * @return The name of the tool, fixed to 'computer' + */ + @JsonProperty("name") + public String getName() { + return "computer"; + } + + /** + * @return The display width in pixels + */ + @JsonProperty("displayWidthPx") + public double getDisplayWidthPx() { + return displayWidthPx; + } + + /** + * @return The display height in pixels + */ + @JsonProperty("displayHeightPx") + public double getDisplayHeightPx() { + return displayHeightPx; + } + + /** + * @return Optional display number + */ + @JsonProperty("displayNumber") + public Optional getDisplayNumber() { + return displayNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ComputerTool && equalTo((ComputerTool) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ComputerTool other) { + return async.equals(other.async) + && messages.equals(other.messages) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && function.equals(other.function) + && server.equals(other.server) + && displayWidthPx == other.displayWidthPx + && displayHeightPx == other.displayHeightPx + && displayNumber.equals(other.displayNumber); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.async, + this.messages, + this.id, + this.orgId, + this.createdAt, + this.updatedAt, + this.function, + this.server, + this.displayWidthPx, + this.displayHeightPx, + this.displayNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + + Builder from(ComputerTool other); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + DisplayWidthPxStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface DisplayWidthPxStage { + DisplayHeightPxStage displayWidthPx(double displayWidthPx); + } + + public interface DisplayHeightPxStage { + _FinalStage displayHeightPx(double displayHeightPx); + } + + public interface _FinalStage { + ComputerTool build(); + + _FinalStage async(Optional async); + + _FinalStage async(Boolean async); + + _FinalStage messages(Optional> messages); + + _FinalStage messages(List messages); + + _FinalStage function(Optional function); + + _FinalStage function(OpenAiFunction function); + + _FinalStage server(Optional server); + + _FinalStage server(Server server); + + _FinalStage displayNumber(Optional displayNumber); + + _FinalStage displayNumber(Double displayNumber); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + OrgIdStage, + CreatedAtStage, + UpdatedAtStage, + DisplayWidthPxStage, + DisplayHeightPxStage, + _FinalStage { + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private double displayWidthPx; + + private double displayHeightPx; + + private Optional displayNumber = Optional.empty(); + + private Optional server = Optional.empty(); + + private Optional function = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private Optional async = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ComputerTool other) { + async(other.getAsync()); + messages(other.getMessages()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + function(other.getFunction()); + server(other.getServer()); + displayWidthPx(other.getDisplayWidthPx()); + displayHeightPx(other.getDisplayHeightPx()); + displayNumber(other.getDisplayNumber()); + return this; + } + + /** + *

This is the unique identifier for the tool.

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

This is the unique identifier for the organization that this tool belongs to.

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

This is the ISO 8601 date-time string of when the tool was created.

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

This is the ISO 8601 date-time string of when the tool was last updated.

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

The display width in pixels

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayWidthPx") + public DisplayHeightPxStage displayWidthPx(double displayWidthPx) { + this.displayWidthPx = displayWidthPx; + return this; + } + + /** + *

The display height in pixels

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayHeightPx") + public _FinalStage displayHeightPx(double displayHeightPx) { + this.displayHeightPx = displayHeightPx; + return this; + } + + /** + *

Optional display number

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

This is the server that will be hit when this tool is requested by the model.

+ *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

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

This is the function definition of the tool.

+ *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

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

These are the messages that will be spoken to the user as the tool is running.

+ *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

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

This determines if the tool is async.

+ *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage async(Boolean async) { + this.async = Optional.ofNullable(async); + return this; + } + + @java.lang.Override + @JsonSetter(value = "async", nulls = Nulls.SKIP) + public _FinalStage async(Optional async) { + this.async = async; + return this; + } + + @java.lang.Override + public ComputerTool build() { + return new ComputerTool( + async, + messages, + id, + orgId, + createdAt, + updatedAt, + function, + server, + displayWidthPx, + displayHeightPx, + displayNumber, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ComputerToolMessagesItem.java b/src/main/java/com/vapi/api/types/ComputerToolMessagesItem.java new file mode 100644 index 0000000..0e41eae --- /dev/null +++ b/src/main/java/com/vapi/api/types/ComputerToolMessagesItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class ComputerToolMessagesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private ComputerToolMessagesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static ComputerToolMessagesItem requestStart(ToolMessageStart value) { + return new ComputerToolMessagesItem(new RequestStartValue(value)); + } + + public static ComputerToolMessagesItem requestComplete(ToolMessageComplete value) { + return new ComputerToolMessagesItem(new RequestCompleteValue(value)); + } + + public static ComputerToolMessagesItem requestFailed(ToolMessageFailed value) { + return new ComputerToolMessagesItem(new RequestFailedValue(value)); + } + + public static ComputerToolMessagesItem requestResponseDelayed(ToolMessageDelayed value) { + return new ComputerToolMessagesItem(new RequestResponseDelayedValue(value)); + } + + public boolean isRequestStart() { + return value instanceof RequestStartValue; + } + + public boolean isRequestComplete() { + return value instanceof RequestCompleteValue; + } + + public boolean isRequestFailed() { + return value instanceof RequestFailedValue; + } + + public boolean isRequestResponseDelayed() { + return value instanceof RequestResponseDelayedValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getRequestStart() { + if (isRequestStart()) { + return Optional.of(((RequestStartValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestComplete() { + if (isRequestComplete()) { + return Optional.of(((RequestCompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestFailed() { + if (isRequestFailed()) { + return Optional.of(((RequestFailedValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestResponseDelayed() { + if (isRequestResponseDelayed()) { + return Optional.of(((RequestResponseDelayedValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitRequestStart(ToolMessageStart requestStart); + + T visitRequestComplete(ToolMessageComplete requestComplete); + + T visitRequestFailed(ToolMessageFailed requestFailed); + + T visitRequestResponseDelayed(ToolMessageDelayed requestResponseDelayed); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(RequestStartValue.class), + @JsonSubTypes.Type(RequestCompleteValue.class), + @JsonSubTypes.Type(RequestFailedValue.class), + @JsonSubTypes.Type(RequestResponseDelayedValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("request-start") + private static final class RequestStartValue implements Value { + @JsonUnwrapped + private ToolMessageStart value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestStartValue() {} + + private RequestStartValue(ToolMessageStart value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestStart(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestStartValue && equalTo((RequestStartValue) other); + } + + private boolean equalTo(RequestStartValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ComputerToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-complete") + private static final class RequestCompleteValue implements Value { + @JsonUnwrapped + private ToolMessageComplete value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestCompleteValue() {} + + private RequestCompleteValue(ToolMessageComplete value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestCompleteValue && equalTo((RequestCompleteValue) other); + } + + private boolean equalTo(RequestCompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ComputerToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-failed") + private static final class RequestFailedValue implements Value { + @JsonUnwrapped + private ToolMessageFailed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestFailedValue() {} + + private RequestFailedValue(ToolMessageFailed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestFailed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestFailedValue && equalTo((RequestFailedValue) other); + } + + private boolean equalTo(RequestFailedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ComputerToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-response-delayed") + private static final class RequestResponseDelayedValue implements Value { + @JsonUnwrapped + private ToolMessageDelayed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestResponseDelayedValue() {} + + private RequestResponseDelayedValue(ToolMessageDelayed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestResponseDelayed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestResponseDelayedValue && equalTo((RequestResponseDelayedValue) other); + } + + private boolean equalTo(RequestResponseDelayedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ComputerToolMessagesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "ComputerToolMessagesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/Condition.java b/src/main/java/com/vapi/api/types/Condition.java index b610ebe..8e30266 100644 --- a/src/main/java/com/vapi/api/types/Condition.java +++ b/src/main/java/com/vapi/api/types/Condition.java @@ -9,9 +9,11 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @@ -19,30 +21,25 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Condition.Builder.class) public final class Condition { - private final String value; - private final ConditionOperator operator; private final String param; + private final Map value; + private final Map additionalProperties; private Condition( - String value, ConditionOperator operator, String param, Map additionalProperties) { - this.value = value; + ConditionOperator operator, + String param, + Map value, + Map additionalProperties) { this.operator = operator; this.param = param; + this.value = value; this.additionalProperties = additionalProperties; } - /** - * @return This is the value you want to compare against the parameter. - */ - @JsonProperty("value") - public String getValue() { - return value; - } - /** * @return This is the operator you want to use to compare the parameter and value. */ @@ -59,6 +56,14 @@ public String getParam() { return param; } + /** + * @return This is the value you want to compare against the parameter. + */ + @JsonProperty("value") + public Map getValue() { + return value; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -71,12 +76,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(Condition other) { - return value.equals(other.value) && operator.equals(other.operator) && param.equals(other.param); + return operator.equals(other.operator) && param.equals(other.param) && value.equals(other.value); } @java.lang.Override public int hashCode() { - return Objects.hash(this.value, this.operator, this.param); + return Objects.hash(this.operator, this.param, this.value); } @java.lang.Override @@ -84,18 +89,14 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ValueStage builder() { + public static OperatorStage builder() { return new Builder(); } - public interface ValueStage { - OperatorStage value(@NotNull String value); - - Builder from(Condition other); - } - public interface OperatorStage { ParamStage operator(@NotNull ConditionOperator operator); + + Builder from(Condition other); } public interface ParamStage { @@ -104,16 +105,22 @@ public interface ParamStage { public interface _FinalStage { Condition build(); + + _FinalStage value(Map value); + + _FinalStage putAllValue(Map value); + + _FinalStage value(String key, Object value); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ValueStage, OperatorStage, ParamStage, _FinalStage { - private String value; - + public static final class Builder implements OperatorStage, ParamStage, _FinalStage { private ConditionOperator operator; private String param; + private Map value = new LinkedHashMap<>(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -121,20 +128,9 @@ private Builder() {} @java.lang.Override public Builder from(Condition other) { - value(other.getValue()); operator(other.getOperator()); param(other.getParam()); - return this; - } - - /** - *

This is the value you want to compare against the parameter.

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

This is the value you want to compare against the parameter.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage value(String key, Object value) { + this.value.put(key, value); + return this; + } + + /** + *

This is the value you want to compare against the parameter.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage putAllValue(Map value) { + this.value.putAll(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Map value) { + this.value.clear(); + this.value.putAll(value); + return this; + } + @java.lang.Override public Condition build() { - return new Condition(value, operator, param, additionalProperties); + return new Condition(operator, param, value, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateAnthropicCredentialDto.java b/src/main/java/com/vapi/api/types/CreateAnthropicCredentialDto.java index 5b35cd2..d9cc488 100644 --- a/src/main/java/com/vapi/api/types/CreateAnthropicCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateAnthropicCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateAnthropicCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateAnthropicCredentialDto(String apiKey, Map additionalProperties) { + private CreateAnthropicCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateAnthropicCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateAnthropicCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateAnthropicCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateAnthropicCredentialDto build() { - return new CreateAnthropicCredentialDto(apiKey, additionalProperties); + return new CreateAnthropicCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateAnyscaleCredentialDto.java b/src/main/java/com/vapi/api/types/CreateAnyscaleCredentialDto.java index 57d763c..5595240 100644 --- a/src/main/java/com/vapi/api/types/CreateAnyscaleCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateAnyscaleCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateAnyscaleCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateAnyscaleCredentialDto(String apiKey, Map additionalProperties) { + private CreateAnyscaleCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateAnyscaleCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateAnyscaleCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateAnyscaleCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateAnyscaleCredentialDto build() { - return new CreateAnyscaleCredentialDto(apiKey, additionalProperties); + return new CreateAnyscaleCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateAssemblyAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateAssemblyAiCredentialDto.java new file mode 100644 index 0000000..a2a56e2 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateAssemblyAiCredentialDto.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateAssemblyAiCredentialDto.Builder.class) +public final class CreateAssemblyAiCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private CreateAssemblyAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "assembly-ai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateAssemblyAiCredentialDto && equalTo((CreateAssemblyAiCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateAssemblyAiCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(CreateAssemblyAiCredentialDto other); + } + + public interface _FinalStage { + CreateAssemblyAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateAssemblyAiCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

This is not returned in the API.

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

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateAssemblyAiCredentialDto build() { + return new CreateAssemblyAiCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateAssistantDto.java b/src/main/java/com/vapi/api/types/CreateAssistantDto.java index 8d05243..fcd3906 100644 --- a/src/main/java/com/vapi/api/types/CreateAssistantDto.java +++ b/src/main/java/com/vapi/api/types/CreateAssistantDto.java @@ -27,6 +27,8 @@ public final class CreateAssistantDto { private final Optional voice; + private final Optional firstMessage; + private final Optional firstMessageMode; private final Optional hipaaEnabled; @@ -41,8 +43,6 @@ public final class CreateAssistantDto { private final Optional backgroundSound; - private final Optional backchannelingEnabled; - private final Optional backgroundDenoisingEnabled; private final Optional modelOutputInMessagesEnabled; @@ -51,8 +51,6 @@ public final class CreateAssistantDto { private final Optional name; - private final Optional firstMessage; - private final Optional voicemailDetection; private final Optional voicemailMessage; @@ -63,10 +61,6 @@ public final class CreateAssistantDto { private final Optional> metadata; - private final Optional serverUrl; - - private final Optional serverUrlSecret; - private final Optional analysisPlan; private final Optional artifactPlan; @@ -81,12 +75,15 @@ public final class CreateAssistantDto { private final Optional> credentialIds; + private final Optional server; + private final Map additionalProperties; private CreateAssistantDto( Optional transcriber, Optional model, Optional voice, + Optional firstMessage, Optional firstMessageMode, Optional hipaaEnabled, Optional> clientMessages, @@ -94,19 +91,15 @@ private CreateAssistantDto( Optional silenceTimeoutSeconds, Optional maxDurationSeconds, Optional backgroundSound, - Optional backchannelingEnabled, Optional backgroundDenoisingEnabled, Optional modelOutputInMessagesEnabled, Optional> transportConfigurations, Optional name, - Optional firstMessage, Optional voicemailDetection, Optional voicemailMessage, Optional endCallMessage, Optional> endCallPhrases, Optional> metadata, - Optional serverUrl, - Optional serverUrlSecret, Optional analysisPlan, Optional artifactPlan, Optional messagePlan, @@ -114,10 +107,12 @@ private CreateAssistantDto( Optional stopSpeakingPlan, Optional monitorPlan, Optional> credentialIds, + Optional server, Map additionalProperties) { this.transcriber = transcriber; this.model = model; this.voice = voice; + this.firstMessage = firstMessage; this.firstMessageMode = firstMessageMode; this.hipaaEnabled = hipaaEnabled; this.clientMessages = clientMessages; @@ -125,19 +120,15 @@ private CreateAssistantDto( this.silenceTimeoutSeconds = silenceTimeoutSeconds; this.maxDurationSeconds = maxDurationSeconds; this.backgroundSound = backgroundSound; - this.backchannelingEnabled = backchannelingEnabled; this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; this.modelOutputInMessagesEnabled = modelOutputInMessagesEnabled; this.transportConfigurations = transportConfigurations; this.name = name; - this.firstMessage = firstMessage; this.voicemailDetection = voicemailDetection; this.voicemailMessage = voicemailMessage; this.endCallMessage = endCallMessage; this.endCallPhrases = endCallPhrases; this.metadata = metadata; - this.serverUrl = serverUrl; - this.serverUrlSecret = serverUrlSecret; this.analysisPlan = analysisPlan; this.artifactPlan = artifactPlan; this.messagePlan = messagePlan; @@ -145,6 +136,7 @@ private CreateAssistantDto( this.stopSpeakingPlan = stopSpeakingPlan; this.monitorPlan = monitorPlan; this.credentialIds = credentialIds; + this.server = server; this.additionalProperties = additionalProperties; } @@ -172,6 +164,15 @@ public Optional getVoice() { return voice; } + /** + * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

+ */ + @JsonProperty("firstMessage") + public Optional getFirstMessage() { + return firstMessage; + } + /** * @return This is the mode for the first message. Default is 'assistant-speaks-first'. *

Use:

@@ -196,7 +197,7 @@ public Optional getHipaaEnabled() { } /** - * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + * @return These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. */ @JsonProperty("clientMessages") public Optional> getClientMessages() { @@ -237,16 +238,6 @@ public Optional getBackgroundSound() { return backgroundSound; } - /** - * @return This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. - *

Default false while in beta.

- *

@default false

- */ - @JsonProperty("backchannelingEnabled") - public Optional getBackchannelingEnabled() { - return backchannelingEnabled; - } - /** * @return This enables filtering of noise and background speech while the user is talking. *

Default false while in beta.

@@ -284,15 +275,6 @@ public Optional getName() { return name; } - /** - * @return This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). - *

If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

- */ - @JsonProperty("firstMessage") - public Optional getFirstMessage() { - return firstMessage; - } - /** * @return These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. * This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. @@ -337,25 +319,6 @@ public Optional> getMetadata() { return metadata; } - /** - * @return This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. - *

All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

- *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl

- */ - @JsonProperty("serverUrl") - public Optional getServerUrl() { - return serverUrl; - } - - /** - * @return This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. - *

Same precedence logic as serverUrl.

- */ - @JsonProperty("serverUrlSecret") - public Optional getServerUrlSecret() { - return serverUrlSecret; - } - /** * @return This is the plan for analysis of assistant's calls. Stored in call.analysis. */ @@ -434,6 +397,20 @@ public Optional> getCredentialIds() { return credentialIds; } + /** + * @return This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + *

The order of precedence is:

+ *
    + *
  1. assistant.server.url
  2. + *
  3. phoneNumber.serverUrl
  4. + *
  5. org.serverUrl
  6. + *
+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -449,6 +426,7 @@ private boolean equalTo(CreateAssistantDto other) { return transcriber.equals(other.transcriber) && model.equals(other.model) && voice.equals(other.voice) + && firstMessage.equals(other.firstMessage) && firstMessageMode.equals(other.firstMessageMode) && hipaaEnabled.equals(other.hipaaEnabled) && clientMessages.equals(other.clientMessages) @@ -456,26 +434,23 @@ private boolean equalTo(CreateAssistantDto other) { && silenceTimeoutSeconds.equals(other.silenceTimeoutSeconds) && maxDurationSeconds.equals(other.maxDurationSeconds) && backgroundSound.equals(other.backgroundSound) - && backchannelingEnabled.equals(other.backchannelingEnabled) && backgroundDenoisingEnabled.equals(other.backgroundDenoisingEnabled) && modelOutputInMessagesEnabled.equals(other.modelOutputInMessagesEnabled) && transportConfigurations.equals(other.transportConfigurations) && name.equals(other.name) - && firstMessage.equals(other.firstMessage) && voicemailDetection.equals(other.voicemailDetection) && voicemailMessage.equals(other.voicemailMessage) && endCallMessage.equals(other.endCallMessage) && endCallPhrases.equals(other.endCallPhrases) && metadata.equals(other.metadata) - && serverUrl.equals(other.serverUrl) - && serverUrlSecret.equals(other.serverUrlSecret) && analysisPlan.equals(other.analysisPlan) && artifactPlan.equals(other.artifactPlan) && messagePlan.equals(other.messagePlan) && startSpeakingPlan.equals(other.startSpeakingPlan) && stopSpeakingPlan.equals(other.stopSpeakingPlan) && monitorPlan.equals(other.monitorPlan) - && credentialIds.equals(other.credentialIds); + && credentialIds.equals(other.credentialIds) + && server.equals(other.server); } @java.lang.Override @@ -484,6 +459,7 @@ public int hashCode() { this.transcriber, this.model, this.voice, + this.firstMessage, this.firstMessageMode, this.hipaaEnabled, this.clientMessages, @@ -491,26 +467,23 @@ public int hashCode() { this.silenceTimeoutSeconds, this.maxDurationSeconds, this.backgroundSound, - this.backchannelingEnabled, this.backgroundDenoisingEnabled, this.modelOutputInMessagesEnabled, this.transportConfigurations, this.name, - this.firstMessage, this.voicemailDetection, this.voicemailMessage, this.endCallMessage, this.endCallPhrases, this.metadata, - this.serverUrl, - this.serverUrlSecret, this.analysisPlan, this.artifactPlan, this.messagePlan, this.startSpeakingPlan, this.stopSpeakingPlan, this.monitorPlan, - this.credentialIds); + this.credentialIds, + this.server); } @java.lang.Override @@ -530,6 +503,8 @@ public static final class Builder { private Optional voice = Optional.empty(); + private Optional firstMessage = Optional.empty(); + private Optional firstMessageMode = Optional.empty(); private Optional hipaaEnabled = Optional.empty(); @@ -544,8 +519,6 @@ public static final class Builder { private Optional backgroundSound = Optional.empty(); - private Optional backchannelingEnabled = Optional.empty(); - private Optional backgroundDenoisingEnabled = Optional.empty(); private Optional modelOutputInMessagesEnabled = Optional.empty(); @@ -554,8 +527,6 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional firstMessage = Optional.empty(); - private Optional voicemailDetection = Optional.empty(); private Optional voicemailMessage = Optional.empty(); @@ -566,10 +537,6 @@ public static final class Builder { private Optional> metadata = Optional.empty(); - private Optional serverUrl = Optional.empty(); - - private Optional serverUrlSecret = Optional.empty(); - private Optional analysisPlan = Optional.empty(); private Optional artifactPlan = Optional.empty(); @@ -584,6 +551,8 @@ public static final class Builder { private Optional> credentialIds = Optional.empty(); + private Optional server = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -593,6 +562,7 @@ public Builder from(CreateAssistantDto other) { transcriber(other.getTranscriber()); model(other.getModel()); voice(other.getVoice()); + firstMessage(other.getFirstMessage()); firstMessageMode(other.getFirstMessageMode()); hipaaEnabled(other.getHipaaEnabled()); clientMessages(other.getClientMessages()); @@ -600,19 +570,15 @@ public Builder from(CreateAssistantDto other) { silenceTimeoutSeconds(other.getSilenceTimeoutSeconds()); maxDurationSeconds(other.getMaxDurationSeconds()); backgroundSound(other.getBackgroundSound()); - backchannelingEnabled(other.getBackchannelingEnabled()); backgroundDenoisingEnabled(other.getBackgroundDenoisingEnabled()); modelOutputInMessagesEnabled(other.getModelOutputInMessagesEnabled()); transportConfigurations(other.getTransportConfigurations()); name(other.getName()); - firstMessage(other.getFirstMessage()); voicemailDetection(other.getVoicemailDetection()); voicemailMessage(other.getVoicemailMessage()); endCallMessage(other.getEndCallMessage()); endCallPhrases(other.getEndCallPhrases()); metadata(other.getMetadata()); - serverUrl(other.getServerUrl()); - serverUrlSecret(other.getServerUrlSecret()); analysisPlan(other.getAnalysisPlan()); artifactPlan(other.getArtifactPlan()); messagePlan(other.getMessagePlan()); @@ -620,6 +586,7 @@ public Builder from(CreateAssistantDto other) { stopSpeakingPlan(other.getStopSpeakingPlan()); monitorPlan(other.getMonitorPlan()); credentialIds(other.getCredentialIds()); + server(other.getServer()); return this; } @@ -656,6 +623,17 @@ public Builder voice(CreateAssistantDtoVoice voice) { return this; } + @JsonSetter(value = "firstMessage", nulls = Nulls.SKIP) + public Builder firstMessage(Optional firstMessage) { + this.firstMessage = firstMessage; + return this; + } + + public Builder firstMessage(String firstMessage) { + this.firstMessage = Optional.ofNullable(firstMessage); + return this; + } + @JsonSetter(value = "firstMessageMode", nulls = Nulls.SKIP) public Builder firstMessageMode(Optional firstMessageMode) { this.firstMessageMode = firstMessageMode; @@ -733,17 +711,6 @@ public Builder backgroundSound(CreateAssistantDtoBackgroundSound backgroundSound return this; } - @JsonSetter(value = "backchannelingEnabled", nulls = Nulls.SKIP) - public Builder backchannelingEnabled(Optional backchannelingEnabled) { - this.backchannelingEnabled = backchannelingEnabled; - return this; - } - - public Builder backchannelingEnabled(Boolean backchannelingEnabled) { - this.backchannelingEnabled = Optional.ofNullable(backchannelingEnabled); - return this; - } - @JsonSetter(value = "backgroundDenoisingEnabled", nulls = Nulls.SKIP) public Builder backgroundDenoisingEnabled(Optional backgroundDenoisingEnabled) { this.backgroundDenoisingEnabled = backgroundDenoisingEnabled; @@ -788,17 +755,6 @@ public Builder name(String name) { return this; } - @JsonSetter(value = "firstMessage", nulls = Nulls.SKIP) - public Builder firstMessage(Optional firstMessage) { - this.firstMessage = firstMessage; - return this; - } - - public Builder firstMessage(String firstMessage) { - this.firstMessage = Optional.ofNullable(firstMessage); - return this; - } - @JsonSetter(value = "voicemailDetection", nulls = Nulls.SKIP) public Builder voicemailDetection(Optional voicemailDetection) { this.voicemailDetection = voicemailDetection; @@ -854,28 +810,6 @@ public Builder metadata(Map metadata) { return this; } - @JsonSetter(value = "serverUrl", nulls = Nulls.SKIP) - public Builder serverUrl(Optional serverUrl) { - this.serverUrl = serverUrl; - return this; - } - - public Builder serverUrl(String serverUrl) { - this.serverUrl = Optional.ofNullable(serverUrl); - return this; - } - - @JsonSetter(value = "serverUrlSecret", nulls = Nulls.SKIP) - public Builder serverUrlSecret(Optional serverUrlSecret) { - this.serverUrlSecret = serverUrlSecret; - return this; - } - - public Builder serverUrlSecret(String serverUrlSecret) { - this.serverUrlSecret = Optional.ofNullable(serverUrlSecret); - return this; - } - @JsonSetter(value = "analysisPlan", nulls = Nulls.SKIP) public Builder analysisPlan(Optional analysisPlan) { this.analysisPlan = analysisPlan; @@ -953,11 +887,23 @@ public Builder credentialIds(List credentialIds) { return this; } + @JsonSetter(value = "server", nulls = Nulls.SKIP) + public Builder server(Optional server) { + this.server = server; + return this; + } + + public Builder server(Server server) { + this.server = Optional.ofNullable(server); + return this; + } + public CreateAssistantDto build() { return new CreateAssistantDto( transcriber, model, voice, + firstMessage, firstMessageMode, hipaaEnabled, clientMessages, @@ -965,19 +911,15 @@ public CreateAssistantDto build() { silenceTimeoutSeconds, maxDurationSeconds, backgroundSound, - backchannelingEnabled, backgroundDenoisingEnabled, modelOutputInMessagesEnabled, transportConfigurations, name, - firstMessage, voicemailDetection, voicemailMessage, endCallMessage, endCallPhrases, metadata, - serverUrl, - serverUrlSecret, analysisPlan, artifactPlan, messagePlan, @@ -985,6 +927,7 @@ public CreateAssistantDto build() { stopSpeakingPlan, monitorPlan, credentialIds, + server, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/CreateAssistantDtoClientMessagesItem.java b/src/main/java/com/vapi/api/types/CreateAssistantDtoClientMessagesItem.java index 134da7a..c96a190 100644 --- a/src/main/java/com/vapi/api/types/CreateAssistantDtoClientMessagesItem.java +++ b/src/main/java/com/vapi/api/types/CreateAssistantDtoClientMessagesItem.java @@ -30,6 +30,8 @@ public enum CreateAssistantDtoClientMessagesItem { TOOL_CALLS_RESULT("tool-calls-result"), + TRANSFER_UPDATE("transfer-update"), + USER_INTERRUPTED("user-interrupted"), VOICE_INPUT("voice-input"); diff --git a/src/main/java/com/vapi/api/types/CreateAssistantDtoModel.java b/src/main/java/com/vapi/api/types/CreateAssistantDtoModel.java index bb64a1e..4ca6acf 100644 --- a/src/main/java/com/vapi/api/types/CreateAssistantDtoModel.java +++ b/src/main/java/com/vapi/api/types/CreateAssistantDtoModel.java @@ -42,10 +42,18 @@ public static CreateAssistantDtoModel deepinfra(DeepInfraModel value) { return new CreateAssistantDtoModel(new DeepinfraValue(value)); } + public static CreateAssistantDtoModel google(GoogleModel value) { + return new CreateAssistantDtoModel(new GoogleValue(value)); + } + public static CreateAssistantDtoModel groq(GroqModel value) { return new CreateAssistantDtoModel(new GroqValue(value)); } + public static CreateAssistantDtoModel inflectionAi(InflectionAiModel value) { + return new CreateAssistantDtoModel(new InflectionAiValue(value)); + } + public static CreateAssistantDtoModel openai(OpenAiModel value) { return new CreateAssistantDtoModel(new OpenaiValue(value)); } @@ -66,6 +74,10 @@ public static CreateAssistantDtoModel vapi(VapiModel value) { return new CreateAssistantDtoModel(new VapiValue(value)); } + public static CreateAssistantDtoModel xai(XaiModel value) { + return new CreateAssistantDtoModel(new XaiValue(value)); + } + public boolean isAnyscale() { return value instanceof AnyscaleValue; } @@ -82,10 +94,18 @@ public boolean isDeepinfra() { return value instanceof DeepinfraValue; } + public boolean isGoogle() { + return value instanceof GoogleValue; + } + public boolean isGroq() { return value instanceof GroqValue; } + public boolean isInflectionAi() { + return value instanceof InflectionAiValue; + } + public boolean isOpenai() { return value instanceof OpenaiValue; } @@ -106,6 +126,10 @@ public boolean isVapi() { return value instanceof VapiValue; } + public boolean isXai() { + return value instanceof XaiValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -138,6 +162,13 @@ public Optional getDeepinfra() { return Optional.empty(); } + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + public Optional getGroq() { if (isGroq()) { return Optional.of(((GroqValue) value).value); @@ -145,6 +176,13 @@ public Optional getGroq() { return Optional.empty(); } + public Optional getInflectionAi() { + if (isInflectionAi()) { + return Optional.of(((InflectionAiValue) value).value); + } + return Optional.empty(); + } + public Optional getOpenai() { if (isOpenai()) { return Optional.of(((OpenaiValue) value).value); @@ -180,6 +218,13 @@ public Optional getVapi() { return Optional.empty(); } + public Optional getXai() { + if (isXai()) { + return Optional.of(((XaiValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -201,8 +246,12 @@ public interface Visitor { T visitDeepinfra(DeepInfraModel deepinfra); + T visitGoogle(GoogleModel google); + T visitGroq(GroqModel groq); + T visitInflectionAi(InflectionAiModel inflectionAi); + T visitOpenai(OpenAiModel openai); T visitOpenrouter(OpenRouterModel openrouter); @@ -213,6 +262,8 @@ public interface Visitor { T visitVapi(VapiModel vapi); + T visitXai(XaiModel xai); + T _visitUnknown(Object unknownType); } @@ -222,12 +273,15 @@ public interface Visitor { @JsonSubTypes.Type(AnthropicValue.class), @JsonSubTypes.Type(CustomLlmValue.class), @JsonSubTypes.Type(DeepinfraValue.class), + @JsonSubTypes.Type(GoogleValue.class), @JsonSubTypes.Type(GroqValue.class), + @JsonSubTypes.Type(InflectionAiValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(OpenrouterValue.class), @JsonSubTypes.Type(PerplexityAiValue.class), @JsonSubTypes.Type(TogetherAiValue.class), - @JsonSubTypes.Type(VapiValue.class) + @JsonSubTypes.Type(VapiValue.class), + @JsonSubTypes.Type(XaiValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -386,6 +440,44 @@ public String toString() { } } + @JsonTypeName("google") + private static final class GoogleValue implements Value { + @JsonUnwrapped + private GoogleModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(GoogleModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("groq") private static final class GroqValue implements Value { @JsonUnwrapped @@ -424,6 +516,44 @@ public String toString() { } } + @JsonTypeName("inflection-ai") + private static final class InflectionAiValue implements Value { + @JsonUnwrapped + private InflectionAiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private InflectionAiValue() {} + + private InflectionAiValue(InflectionAiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitInflectionAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InflectionAiValue && equalTo((InflectionAiValue) other); + } + + private boolean equalTo(InflectionAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoModel{" + "value: " + value + "}"; + } + } + @JsonTypeName("openai") private static final class OpenaiValue implements Value { @JsonUnwrapped @@ -614,6 +744,44 @@ public String toString() { } } + @JsonTypeName("xai") + private static final class XaiValue implements Value { + @JsonUnwrapped + private XaiModel value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private XaiValue() {} + + private XaiValue(XaiModel value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitXai(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof XaiValue && equalTo((XaiValue) other); + } + + private boolean equalTo(XaiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoModel{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/CreateAssistantDtoServerMessagesItem.java b/src/main/java/com/vapi/api/types/CreateAssistantDtoServerMessagesItem.java index cf3c83c..bcacc35 100644 --- a/src/main/java/com/vapi/api/types/CreateAssistantDtoServerMessagesItem.java +++ b/src/main/java/com/vapi/api/types/CreateAssistantDtoServerMessagesItem.java @@ -16,6 +16,8 @@ public enum CreateAssistantDtoServerMessagesItem { LANGUAGE_CHANGED("language-changed"), + LANGUAGE_CHANGE_DETECTED("language-change-detected"), + MODEL_OUTPUT("model-output"), PHONE_CALL_CONTROL("phone-call-control"), diff --git a/src/main/java/com/vapi/api/types/CreateAssistantDtoTranscriber.java b/src/main/java/com/vapi/api/types/CreateAssistantDtoTranscriber.java index 6d13ac4..1b8f612 100644 --- a/src/main/java/com/vapi/api/types/CreateAssistantDtoTranscriber.java +++ b/src/main/java/com/vapi/api/types/CreateAssistantDtoTranscriber.java @@ -26,6 +26,14 @@ public T visit(Visitor visitor) { return value.visit(visitor); } + public static CreateAssistantDtoTranscriber assemblyAi(AssemblyAiTranscriber value) { + return new CreateAssistantDtoTranscriber(new AssemblyAiValue(value)); + } + + public static CreateAssistantDtoTranscriber customTranscriber(CustomTranscriber value) { + return new CreateAssistantDtoTranscriber(new CustomTranscriberValue(value)); + } + public static CreateAssistantDtoTranscriber deepgram(DeepgramTranscriber value) { return new CreateAssistantDtoTranscriber(new DeepgramValue(value)); } @@ -38,6 +46,14 @@ public static CreateAssistantDtoTranscriber talkscriber(TalkscriberTranscriber v return new CreateAssistantDtoTranscriber(new TalkscriberValue(value)); } + public boolean isAssemblyAi() { + return value instanceof AssemblyAiValue; + } + + public boolean isCustomTranscriber() { + return value instanceof CustomTranscriberValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -54,6 +70,20 @@ public boolean _isUnknown() { return value instanceof _UnknownValue; } + public Optional getAssemblyAi() { + if (isAssemblyAi()) { + return Optional.of(((AssemblyAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomTranscriber() { + if (isCustomTranscriber()) { + return Optional.of(((CustomTranscriberValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -88,6 +118,10 @@ private Value getValue() { } public interface Visitor { + T visitAssemblyAi(AssemblyAiTranscriber assemblyAi); + + T visitCustomTranscriber(CustomTranscriber customTranscriber); + T visitDeepgram(DeepgramTranscriber deepgram); T visitGladia(GladiaTranscriber gladia); @@ -99,6 +133,8 @@ public interface Visitor { @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) @JsonSubTypes({ + @JsonSubTypes.Type(AssemblyAiValue.class), + @JsonSubTypes.Type(CustomTranscriberValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(GladiaValue.class), @JsonSubTypes.Type(TalkscriberValue.class) @@ -108,6 +144,82 @@ private interface Value { T visit(Visitor visitor); } + @JsonTypeName("assembly-ai") + private static final class AssemblyAiValue implements Value { + @JsonUnwrapped + private AssemblyAiTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AssemblyAiValue() {} + + private AssemblyAiValue(AssemblyAiTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAssemblyAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssemblyAiValue && equalTo((AssemblyAiValue) other); + } + + private boolean equalTo(AssemblyAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoTranscriber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-transcriber") + private static final class CustomTranscriberValue implements Value { + @JsonUnwrapped + private CustomTranscriber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomTranscriberValue() {} + + private CustomTranscriberValue(CustomTranscriber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomTranscriber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomTranscriberValue && equalTo((CustomTranscriberValue) other); + } + + private boolean equalTo(CustomTranscriberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoTranscriber{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped diff --git a/src/main/java/com/vapi/api/types/CreateAssistantDtoVoice.java b/src/main/java/com/vapi/api/types/CreateAssistantDtoVoice.java index cc75d91..303ccca 100644 --- a/src/main/java/com/vapi/api/types/CreateAssistantDtoVoice.java +++ b/src/main/java/com/vapi/api/types/CreateAssistantDtoVoice.java @@ -34,6 +34,10 @@ public static CreateAssistantDtoVoice cartesia(CartesiaVoice value) { return new CreateAssistantDtoVoice(new CartesiaValue(value)); } + public static CreateAssistantDtoVoice customVoice(CustomVoice value) { + return new CreateAssistantDtoVoice(new CustomVoiceValue(value)); + } + public static CreateAssistantDtoVoice deepgram(DeepgramVoice value) { return new CreateAssistantDtoVoice(new DeepgramValue(value)); } @@ -62,6 +66,10 @@ public static CreateAssistantDtoVoice rimeAi(RimeAiVoice value) { return new CreateAssistantDtoVoice(new RimeAiValue(value)); } + public static CreateAssistantDtoVoice tavus(TavusVoice value) { + return new CreateAssistantDtoVoice(new TavusValue(value)); + } + public boolean isAzure() { return value instanceof AzureValue; } @@ -70,6 +78,10 @@ public boolean isCartesia() { return value instanceof CartesiaValue; } + public boolean isCustomVoice() { + return value instanceof CustomVoiceValue; + } + public boolean isDeepgram() { return value instanceof DeepgramValue; } @@ -98,6 +110,10 @@ public boolean isRimeAi() { return value instanceof RimeAiValue; } + public boolean isTavus() { + return value instanceof TavusValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -116,6 +132,13 @@ public Optional getCartesia() { return Optional.empty(); } + public Optional getCustomVoice() { + if (isCustomVoice()) { + return Optional.of(((CustomVoiceValue) value).value); + } + return Optional.empty(); + } + public Optional getDeepgram() { if (isDeepgram()) { return Optional.of(((DeepgramValue) value).value); @@ -165,6 +188,13 @@ public Optional getRimeAi() { return Optional.empty(); } + public Optional getTavus() { + if (isTavus()) { + return Optional.of(((TavusValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -182,6 +212,8 @@ public interface Visitor { T visitCartesia(CartesiaVoice cartesia); + T visitCustomVoice(CustomVoice customVoice); + T visitDeepgram(DeepgramVoice deepgram); T visit11Labs(ElevenLabsVoice _11Labs); @@ -196,6 +228,8 @@ public interface Visitor { T visitRimeAi(RimeAiVoice rimeAi); + T visitTavus(TavusVoice tavus); + T _visitUnknown(Object unknownType); } @@ -203,13 +237,15 @@ public interface Visitor { @JsonSubTypes({ @JsonSubTypes.Type(AzureValue.class), @JsonSubTypes.Type(CartesiaValue.class), + @JsonSubTypes.Type(CustomVoiceValue.class), @JsonSubTypes.Type(DeepgramValue.class), @JsonSubTypes.Type(_11LabsValue.class), @JsonSubTypes.Type(LmntValue.class), @JsonSubTypes.Type(NeetsValue.class), @JsonSubTypes.Type(OpenaiValue.class), @JsonSubTypes.Type(PlayhtValue.class), - @JsonSubTypes.Type(RimeAiValue.class) + @JsonSubTypes.Type(RimeAiValue.class), + @JsonSubTypes.Type(TavusValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { @@ -292,6 +328,44 @@ public String toString() { } } + @JsonTypeName("custom-voice") + private static final class CustomVoiceValue implements Value { + @JsonUnwrapped + private CustomVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomVoiceValue() {} + + private CustomVoiceValue(CustomVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomVoice(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomVoiceValue && equalTo((CustomVoiceValue) other); + } + + private boolean equalTo(CustomVoiceValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoVoice{" + "value: " + value + "}"; + } + } + @JsonTypeName("deepgram") private static final class DeepgramValue implements Value { @JsonUnwrapped @@ -558,6 +632,44 @@ public String toString() { } } + @JsonTypeName("tavus") + private static final class TavusValue implements Value { + @JsonUnwrapped + private TavusVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TavusValue() {} + + private TavusValue(TavusVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTavus(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusValue && equalTo((TavusValue) other); + } + + private boolean equalTo(TavusValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateAssistantDtoVoice{" + "value: " + value + "}"; + } + } + private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/vapi/api/types/CreateAzureCredentialDto.java b/src/main/java/com/vapi/api/types/CreateAzureCredentialDto.java new file mode 100644 index 0000000..0744777 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateAzureCredentialDto.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateAzureCredentialDto.Builder.class) +public final class CreateAzureCredentialDto { + private final Optional region; + + private final Optional apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private CreateAzureCredentialDto( + Optional region, + Optional apiKey, + Optional name, + Map additionalProperties) { + this.region = region; + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "azure"; + } + + /** + * @return This is the service being used in Azure. + */ + @JsonProperty("service") + public String getService() { + return "speech"; + } + + /** + * @return This is the region of the Azure resource. + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public Optional getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateAzureCredentialDto && equalTo((CreateAzureCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateAzureCredentialDto other) { + return region.equals(other.region) && apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.region, this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional region = Optional.empty(); + + private Optional apiKey = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateAzureCredentialDto other) { + region(other.getRegion()); + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public Builder region(Optional region) { + this.region = region; + return this; + } + + public Builder region(CreateAzureCredentialDtoRegion region) { + this.region = Optional.ofNullable(region); + return this; + } + + @JsonSetter(value = "apiKey", nulls = Nulls.SKIP) + public Builder apiKey(Optional apiKey) { + this.apiKey = apiKey; + return this; + } + + public Builder apiKey(String apiKey) { + this.apiKey = Optional.ofNullable(apiKey); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + public CreateAzureCredentialDto build() { + return new CreateAzureCredentialDto(region, apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateAzureCredentialDtoRegion.java b/src/main/java/com/vapi/api/types/CreateAzureCredentialDtoRegion.java new file mode 100644 index 0000000..e2bdd2e --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateAzureCredentialDtoRegion.java @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreateAzureCredentialDtoRegion { + AUSTRALIA("australia"), + + CANADA("canada"), + + EASTUS_2("eastus2"), + + EASTUS("eastus"), + + FRANCE("france"), + + INDIA("india"), + + JAPAN("japan"), + + UAENORTH("uaenorth"), + + NORTHCENTRALUS("northcentralus"), + + NORWAY("norway"), + + SOUTHCENTRALUS("southcentralus"), + + SWEDEN("sweden"), + + SWITZERLAND("switzerland"), + + UK("uk"), + + WESTUS("westus"), + + WESTUS_3("westus3"); + + private final String value; + + CreateAzureCredentialDtoRegion(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDto.java index 9ecdaa1..542f98a 100644 --- a/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDto.java @@ -17,6 +17,7 @@ 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) @@ -30,6 +31,8 @@ public final class CreateAzureOpenAiCredentialDto { private final String openAiEndpoint; + private final Optional name; + private final Map additionalProperties; private CreateAzureOpenAiCredentialDto( @@ -37,11 +40,13 @@ private CreateAzureOpenAiCredentialDto( List models, String openAiKey, String openAiEndpoint, + Optional name, Map additionalProperties) { this.region = region; this.models = models; this.openAiKey = openAiKey; this.openAiEndpoint = openAiEndpoint; + this.name = name; this.additionalProperties = additionalProperties; } @@ -73,6 +78,14 @@ public String getOpenAiEndpoint() { return openAiEndpoint; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -88,12 +101,13 @@ private boolean equalTo(CreateAzureOpenAiCredentialDto other) { return region.equals(other.region) && models.equals(other.models) && openAiKey.equals(other.openAiKey) - && openAiEndpoint.equals(other.openAiEndpoint); + && openAiEndpoint.equals(other.openAiEndpoint) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.region, this.models, this.openAiKey, this.openAiEndpoint); + return Objects.hash(this.region, this.models, this.openAiKey, this.openAiEndpoint, this.name); } @java.lang.Override @@ -127,6 +141,10 @@ public interface _FinalStage { _FinalStage addModels(CreateAzureOpenAiCredentialDtoModelsItem models); _FinalStage addAllModels(List models); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -137,6 +155,8 @@ public static final class Builder implements RegionStage, OpenAiKeyStage, OpenAi private String openAiEndpoint; + private Optional name = Optional.empty(); + private List models = new ArrayList<>(); @JsonAnySetter @@ -150,6 +170,7 @@ public Builder from(CreateAzureOpenAiCredentialDto other) { models(other.getModels()); openAiKey(other.getOpenAiKey()); openAiEndpoint(other.getOpenAiEndpoint()); + name(other.getName()); return this; } @@ -178,6 +199,23 @@ public _FinalStage openAiEndpoint(@NotNull String openAiEndpoint) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public _FinalStage addAllModels(List models) { this.models.addAll(models); @@ -200,7 +238,8 @@ public _FinalStage models(List models) @java.lang.Override public CreateAzureOpenAiCredentialDto build() { - return new CreateAzureOpenAiCredentialDto(region, models, openAiKey, openAiEndpoint, additionalProperties); + return new CreateAzureOpenAiCredentialDto( + region, models, openAiKey, openAiEndpoint, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoModelsItem.java b/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoModelsItem.java index 23d211b..2f0ace0 100644 --- a/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoModelsItem.java +++ b/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoModelsItem.java @@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum CreateAzureOpenAiCredentialDtoModelsItem { + GPT_4_O_20240806("gpt-4o-2024-08-06"), + GPT_4_O_MINI_20240718("gpt-4o-mini-2024-07-18"), GPT_4_O_20240513("gpt-4o-2024-05-13"), diff --git a/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoRegion.java b/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoRegion.java index 4592cd6..a7a1100 100644 --- a/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoRegion.java +++ b/src/main/java/com/vapi/api/types/CreateAzureOpenAiCredentialDtoRegion.java @@ -20,6 +20,8 @@ public enum CreateAzureOpenAiCredentialDtoRegion { JAPAN("japan"), + UAENORTH("uaenorth"), + NORTHCENTRALUS("northcentralus"), NORWAY("norway"), diff --git a/src/main/java/com/vapi/api/types/CreateBashToolDto.java b/src/main/java/com/vapi/api/types/CreateBashToolDto.java new file mode 100644 index 0000000..acebeeb --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateBashToolDto.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateBashToolDto.Builder.class) +public final class CreateBashToolDto { + private final Optional async; + + private final Optional> messages; + + private final Optional function; + + private final Optional server; + + private final Map additionalProperties; + + private CreateBashToolDto( + Optional async, + Optional> messages, + Optional function, + Optional server, + Map additionalProperties) { + this.async = async; + this.messages = messages; + this.function = function; + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return This determines if the tool is async. + *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ */ + @JsonProperty("async") + public Optional getAsync() { + return async; + } + + /** + * @return These are the messages that will be spoken to the user as the tool is running. + *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

+ */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return The sub type of tool. + */ + @JsonProperty("subType") + public String getSubType() { + return "bash_20241022"; + } + + /** + * @return The name of the tool, fixed to 'bash' + */ + @JsonProperty("name") + public String getName() { + return "bash"; + } + + /** + * @return This is the function definition of the tool. + *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

+ */ + @JsonProperty("function") + public Optional getFunction() { + return function; + } + + /** + * @return This is the server that will be hit when this tool is requested by the model. + *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateBashToolDto && equalTo((CreateBashToolDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateBashToolDto other) { + return async.equals(other.async) + && messages.equals(other.messages) + && function.equals(other.function) + && server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.async, this.messages, this.function, this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional async = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private Optional function = Optional.empty(); + + private Optional server = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateBashToolDto other) { + async(other.getAsync()); + messages(other.getMessages()); + function(other.getFunction()); + server(other.getServer()); + return this; + } + + @JsonSetter(value = "async", nulls = Nulls.SKIP) + public Builder async(Optional async) { + this.async = async; + return this; + } + + public Builder async(Boolean async) { + this.async = Optional.ofNullable(async); + return this; + } + + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public Builder messages(Optional> messages) { + this.messages = messages; + return this; + } + + public Builder messages(List messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @JsonSetter(value = "function", nulls = Nulls.SKIP) + public Builder function(Optional function) { + this.function = function; + return this; + } + + public Builder function(OpenAiFunction function) { + this.function = Optional.ofNullable(function); + return this; + } + + @JsonSetter(value = "server", nulls = Nulls.SKIP) + public Builder server(Optional server) { + this.server = server; + return this; + } + + public Builder server(Server server) { + this.server = Optional.ofNullable(server); + return this; + } + + public CreateBashToolDto build() { + return new CreateBashToolDto(async, messages, function, server, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateBashToolDtoMessagesItem.java b/src/main/java/com/vapi/api/types/CreateBashToolDtoMessagesItem.java new file mode 100644 index 0000000..8f2421e --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateBashToolDtoMessagesItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class CreateBashToolDtoMessagesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private CreateBashToolDtoMessagesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static CreateBashToolDtoMessagesItem requestStart(ToolMessageStart value) { + return new CreateBashToolDtoMessagesItem(new RequestStartValue(value)); + } + + public static CreateBashToolDtoMessagesItem requestComplete(ToolMessageComplete value) { + return new CreateBashToolDtoMessagesItem(new RequestCompleteValue(value)); + } + + public static CreateBashToolDtoMessagesItem requestFailed(ToolMessageFailed value) { + return new CreateBashToolDtoMessagesItem(new RequestFailedValue(value)); + } + + public static CreateBashToolDtoMessagesItem requestResponseDelayed(ToolMessageDelayed value) { + return new CreateBashToolDtoMessagesItem(new RequestResponseDelayedValue(value)); + } + + public boolean isRequestStart() { + return value instanceof RequestStartValue; + } + + public boolean isRequestComplete() { + return value instanceof RequestCompleteValue; + } + + public boolean isRequestFailed() { + return value instanceof RequestFailedValue; + } + + public boolean isRequestResponseDelayed() { + return value instanceof RequestResponseDelayedValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getRequestStart() { + if (isRequestStart()) { + return Optional.of(((RequestStartValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestComplete() { + if (isRequestComplete()) { + return Optional.of(((RequestCompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestFailed() { + if (isRequestFailed()) { + return Optional.of(((RequestFailedValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestResponseDelayed() { + if (isRequestResponseDelayed()) { + return Optional.of(((RequestResponseDelayedValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitRequestStart(ToolMessageStart requestStart); + + T visitRequestComplete(ToolMessageComplete requestComplete); + + T visitRequestFailed(ToolMessageFailed requestFailed); + + T visitRequestResponseDelayed(ToolMessageDelayed requestResponseDelayed); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(RequestStartValue.class), + @JsonSubTypes.Type(RequestCompleteValue.class), + @JsonSubTypes.Type(RequestFailedValue.class), + @JsonSubTypes.Type(RequestResponseDelayedValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("request-start") + private static final class RequestStartValue implements Value { + @JsonUnwrapped + private ToolMessageStart value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestStartValue() {} + + private RequestStartValue(ToolMessageStart value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestStart(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestStartValue && equalTo((RequestStartValue) other); + } + + private boolean equalTo(RequestStartValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateBashToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-complete") + private static final class RequestCompleteValue implements Value { + @JsonUnwrapped + private ToolMessageComplete value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestCompleteValue() {} + + private RequestCompleteValue(ToolMessageComplete value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestCompleteValue && equalTo((RequestCompleteValue) other); + } + + private boolean equalTo(RequestCompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateBashToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-failed") + private static final class RequestFailedValue implements Value { + @JsonUnwrapped + private ToolMessageFailed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestFailedValue() {} + + private RequestFailedValue(ToolMessageFailed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestFailed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestFailedValue && equalTo((RequestFailedValue) other); + } + + private boolean equalTo(RequestFailedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateBashToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-response-delayed") + private static final class RequestResponseDelayedValue implements Value { + @JsonUnwrapped + private ToolMessageDelayed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestResponseDelayedValue() {} + + private RequestResponseDelayedValue(ToolMessageDelayed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestResponseDelayed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestResponseDelayedValue && equalTo((RequestResponseDelayedValue) other); + } + + private boolean equalTo(RequestResponseDelayedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateBashToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "CreateBashToolDtoMessagesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateByoSipTrunkCredentialDto.java b/src/main/java/com/vapi/api/types/CreateByoSipTrunkCredentialDto.java index 2e2cc0f..da68dfb 100644 --- a/src/main/java/com/vapi/api/types/CreateByoSipTrunkCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateByoSipTrunkCredentialDto.java @@ -26,30 +26,38 @@ public final class CreateByoSipTrunkCredentialDto { private final List gateways; - private final Optional name; - private final Optional outboundAuthenticationPlan; private final Optional outboundLeadingPlusEnabled; + private final Optional techPrefix; + + private final Optional sipDiversionHeader; + private final Optional sbcConfiguration; + private final Optional name; + private final Map additionalProperties; private CreateByoSipTrunkCredentialDto( Optional provider, List gateways, - Optional name, Optional outboundAuthenticationPlan, Optional outboundLeadingPlusEnabled, + Optional techPrefix, + Optional sipDiversionHeader, Optional sbcConfiguration, + Optional name, Map additionalProperties) { this.provider = provider; this.gateways = gateways; - this.name = name; this.outboundAuthenticationPlan = outboundAuthenticationPlan; this.outboundLeadingPlusEnabled = outboundLeadingPlusEnabled; + this.techPrefix = techPrefix; + this.sipDiversionHeader = sipDiversionHeader; this.sbcConfiguration = sbcConfiguration; + this.name = name; this.additionalProperties = additionalProperties; } @@ -69,14 +77,6 @@ public List getGateways() { return gateways; } - /** - * @return This is the name of the SIP trunk. This is just for your reference. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - /** * @return This can be used to configure the outbound authentication if required by the SIP trunk. */ @@ -98,6 +98,22 @@ public Optional getOutboundLeadingPlusEnabled() { return outboundLeadingPlusEnabled; } + /** + * @return This can be used to configure the tech prefix on outbound calls. This is an advanced property. + */ + @JsonProperty("techPrefix") + public Optional getTechPrefix() { + return techPrefix; + } + + /** + * @return This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property. + */ + @JsonProperty("sipDiversionHeader") + public Optional getSipDiversionHeader() { + return sipDiversionHeader; + } + /** * @return This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's gateways, rather than the managed SBC provided by Vapi. */ @@ -106,6 +122,14 @@ public Optional getSbcConfiguration() { return sbcConfiguration; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -120,10 +144,12 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateByoSipTrunkCredentialDto other) { return provider.equals(other.provider) && gateways.equals(other.gateways) - && name.equals(other.name) && outboundAuthenticationPlan.equals(other.outboundAuthenticationPlan) && outboundLeadingPlusEnabled.equals(other.outboundLeadingPlusEnabled) - && sbcConfiguration.equals(other.sbcConfiguration); + && techPrefix.equals(other.techPrefix) + && sipDiversionHeader.equals(other.sipDiversionHeader) + && sbcConfiguration.equals(other.sbcConfiguration) + && name.equals(other.name); } @java.lang.Override @@ -131,10 +157,12 @@ public int hashCode() { return Objects.hash( this.provider, this.gateways, - this.name, this.outboundAuthenticationPlan, this.outboundLeadingPlusEnabled, - this.sbcConfiguration); + this.techPrefix, + this.sipDiversionHeader, + this.sbcConfiguration, + this.name); } @java.lang.Override @@ -152,14 +180,18 @@ public static final class Builder { private List gateways = new ArrayList<>(); - private Optional name = Optional.empty(); - private Optional outboundAuthenticationPlan = Optional.empty(); private Optional outboundLeadingPlusEnabled = Optional.empty(); + private Optional techPrefix = Optional.empty(); + + private Optional sipDiversionHeader = Optional.empty(); + private Optional sbcConfiguration = Optional.empty(); + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -168,10 +200,12 @@ private Builder() {} public Builder from(CreateByoSipTrunkCredentialDto other) { provider(other.getProvider()); gateways(other.getGateways()); - name(other.getName()); outboundAuthenticationPlan(other.getOutboundAuthenticationPlan()); outboundLeadingPlusEnabled(other.getOutboundLeadingPlusEnabled()); + techPrefix(other.getTechPrefix()); + sipDiversionHeader(other.getSipDiversionHeader()); sbcConfiguration(other.getSbcConfiguration()); + name(other.getName()); return this; } @@ -203,17 +237,6 @@ public Builder addAllGateways(List gateways) { return this; } - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - @JsonSetter(value = "outboundAuthenticationPlan", nulls = Nulls.SKIP) public Builder outboundAuthenticationPlan( Optional outboundAuthenticationPlan) { @@ -237,6 +260,28 @@ public Builder outboundLeadingPlusEnabled(Boolean outboundLeadingPlusEnabled) { return this; } + @JsonSetter(value = "techPrefix", nulls = Nulls.SKIP) + public Builder techPrefix(Optional techPrefix) { + this.techPrefix = techPrefix; + return this; + } + + public Builder techPrefix(String techPrefix) { + this.techPrefix = Optional.ofNullable(techPrefix); + return this; + } + + @JsonSetter(value = "sipDiversionHeader", nulls = Nulls.SKIP) + public Builder sipDiversionHeader(Optional sipDiversionHeader) { + this.sipDiversionHeader = sipDiversionHeader; + return this; + } + + public Builder sipDiversionHeader(String sipDiversionHeader) { + this.sipDiversionHeader = Optional.ofNullable(sipDiversionHeader); + return this; + } + @JsonSetter(value = "sbcConfiguration", nulls = Nulls.SKIP) public Builder sbcConfiguration(Optional sbcConfiguration) { this.sbcConfiguration = sbcConfiguration; @@ -248,14 +293,27 @@ public Builder sbcConfiguration(SbcConfiguration sbcConfiguration) { return this; } + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + public CreateByoSipTrunkCredentialDto build() { return new CreateByoSipTrunkCredentialDto( provider, gateways, - name, outboundAuthenticationPlan, outboundLeadingPlusEnabled, + techPrefix, + sipDiversionHeader, sbcConfiguration, + name, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/CreateCartesiaCredentialDto.java b/src/main/java/com/vapi/api/types/CreateCartesiaCredentialDto.java index ea875b1..34a819e 100644 --- a/src/main/java/com/vapi/api/types/CreateCartesiaCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateCartesiaCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateCartesiaCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateCartesiaCredentialDto(String apiKey, Map additionalProperties) { + private CreateCartesiaCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateCartesiaCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateCartesiaCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateCartesiaCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateCartesiaCredentialDto build() { - return new CreateCartesiaCredentialDto(apiKey, additionalProperties); + return new CreateCartesiaCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateComputerToolDto.java b/src/main/java/com/vapi/api/types/CreateComputerToolDto.java new file mode 100644 index 0000000..4707fc9 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateComputerToolDto.java @@ -0,0 +1,376 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateComputerToolDto.Builder.class) +public final class CreateComputerToolDto { + private final Optional async; + + private final Optional> messages; + + private final double displayWidthPx; + + private final double displayHeightPx; + + private final Optional displayNumber; + + private final Optional function; + + private final Optional server; + + private final Map additionalProperties; + + private CreateComputerToolDto( + Optional async, + Optional> messages, + double displayWidthPx, + double displayHeightPx, + Optional displayNumber, + Optional function, + Optional server, + Map additionalProperties) { + this.async = async; + this.messages = messages; + this.displayWidthPx = displayWidthPx; + this.displayHeightPx = displayHeightPx; + this.displayNumber = displayNumber; + this.function = function; + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return This determines if the tool is async. + *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ */ + @JsonProperty("async") + public Optional getAsync() { + return async; + } + + /** + * @return These are the messages that will be spoken to the user as the tool is running. + *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

+ */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return The sub type of tool. + */ + @JsonProperty("subType") + public String getSubType() { + return "computer_20241022"; + } + + /** + * @return The name of the tool, fixed to 'computer' + */ + @JsonProperty("name") + public String getName() { + return "computer"; + } + + /** + * @return The display width in pixels + */ + @JsonProperty("displayWidthPx") + public double getDisplayWidthPx() { + return displayWidthPx; + } + + /** + * @return The display height in pixels + */ + @JsonProperty("displayHeightPx") + public double getDisplayHeightPx() { + return displayHeightPx; + } + + /** + * @return Optional display number + */ + @JsonProperty("displayNumber") + public Optional getDisplayNumber() { + return displayNumber; + } + + /** + * @return This is the function definition of the tool. + *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

+ */ + @JsonProperty("function") + public Optional getFunction() { + return function; + } + + /** + * @return This is the server that will be hit when this tool is requested by the model. + *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateComputerToolDto && equalTo((CreateComputerToolDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateComputerToolDto other) { + return async.equals(other.async) + && messages.equals(other.messages) + && displayWidthPx == other.displayWidthPx + && displayHeightPx == other.displayHeightPx + && displayNumber.equals(other.displayNumber) + && function.equals(other.function) + && server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.async, + this.messages, + this.displayWidthPx, + this.displayHeightPx, + this.displayNumber, + this.function, + this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DisplayWidthPxStage builder() { + return new Builder(); + } + + public interface DisplayWidthPxStage { + DisplayHeightPxStage displayWidthPx(double displayWidthPx); + + Builder from(CreateComputerToolDto other); + } + + public interface DisplayHeightPxStage { + _FinalStage displayHeightPx(double displayHeightPx); + } + + public interface _FinalStage { + CreateComputerToolDto build(); + + _FinalStage async(Optional async); + + _FinalStage async(Boolean async); + + _FinalStage messages(Optional> messages); + + _FinalStage messages(List messages); + + _FinalStage displayNumber(Optional displayNumber); + + _FinalStage displayNumber(Double displayNumber); + + _FinalStage function(Optional function); + + _FinalStage function(OpenAiFunction function); + + _FinalStage server(Optional server); + + _FinalStage server(Server server); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DisplayWidthPxStage, DisplayHeightPxStage, _FinalStage { + private double displayWidthPx; + + private double displayHeightPx; + + private Optional server = Optional.empty(); + + private Optional function = Optional.empty(); + + private Optional displayNumber = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private Optional async = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateComputerToolDto other) { + async(other.getAsync()); + messages(other.getMessages()); + displayWidthPx(other.getDisplayWidthPx()); + displayHeightPx(other.getDisplayHeightPx()); + displayNumber(other.getDisplayNumber()); + function(other.getFunction()); + server(other.getServer()); + return this; + } + + /** + *

The display width in pixels

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayWidthPx") + public DisplayHeightPxStage displayWidthPx(double displayWidthPx) { + this.displayWidthPx = displayWidthPx; + return this; + } + + /** + *

The display height in pixels

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayHeightPx") + public _FinalStage displayHeightPx(double displayHeightPx) { + this.displayHeightPx = displayHeightPx; + return this; + } + + /** + *

This is the server that will be hit when this tool is requested by the model.

+ *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

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

This is the function definition of the tool.

+ *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

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

Optional display number

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

These are the messages that will be spoken to the user as the tool is running.

+ *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

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

This determines if the tool is async.

+ *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage async(Boolean async) { + this.async = Optional.ofNullable(async); + return this; + } + + @java.lang.Override + @JsonSetter(value = "async", nulls = Nulls.SKIP) + public _FinalStage async(Optional async) { + this.async = async; + return this; + } + + @java.lang.Override + public CreateComputerToolDto build() { + return new CreateComputerToolDto( + async, + messages, + displayWidthPx, + displayHeightPx, + displayNumber, + function, + server, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateComputerToolDtoMessagesItem.java b/src/main/java/com/vapi/api/types/CreateComputerToolDtoMessagesItem.java new file mode 100644 index 0000000..71653c4 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateComputerToolDtoMessagesItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class CreateComputerToolDtoMessagesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private CreateComputerToolDtoMessagesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static CreateComputerToolDtoMessagesItem requestStart(ToolMessageStart value) { + return new CreateComputerToolDtoMessagesItem(new RequestStartValue(value)); + } + + public static CreateComputerToolDtoMessagesItem requestComplete(ToolMessageComplete value) { + return new CreateComputerToolDtoMessagesItem(new RequestCompleteValue(value)); + } + + public static CreateComputerToolDtoMessagesItem requestFailed(ToolMessageFailed value) { + return new CreateComputerToolDtoMessagesItem(new RequestFailedValue(value)); + } + + public static CreateComputerToolDtoMessagesItem requestResponseDelayed(ToolMessageDelayed value) { + return new CreateComputerToolDtoMessagesItem(new RequestResponseDelayedValue(value)); + } + + public boolean isRequestStart() { + return value instanceof RequestStartValue; + } + + public boolean isRequestComplete() { + return value instanceof RequestCompleteValue; + } + + public boolean isRequestFailed() { + return value instanceof RequestFailedValue; + } + + public boolean isRequestResponseDelayed() { + return value instanceof RequestResponseDelayedValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getRequestStart() { + if (isRequestStart()) { + return Optional.of(((RequestStartValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestComplete() { + if (isRequestComplete()) { + return Optional.of(((RequestCompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestFailed() { + if (isRequestFailed()) { + return Optional.of(((RequestFailedValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestResponseDelayed() { + if (isRequestResponseDelayed()) { + return Optional.of(((RequestResponseDelayedValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitRequestStart(ToolMessageStart requestStart); + + T visitRequestComplete(ToolMessageComplete requestComplete); + + T visitRequestFailed(ToolMessageFailed requestFailed); + + T visitRequestResponseDelayed(ToolMessageDelayed requestResponseDelayed); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(RequestStartValue.class), + @JsonSubTypes.Type(RequestCompleteValue.class), + @JsonSubTypes.Type(RequestFailedValue.class), + @JsonSubTypes.Type(RequestResponseDelayedValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("request-start") + private static final class RequestStartValue implements Value { + @JsonUnwrapped + private ToolMessageStart value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestStartValue() {} + + private RequestStartValue(ToolMessageStart value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestStart(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestStartValue && equalTo((RequestStartValue) other); + } + + private boolean equalTo(RequestStartValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateComputerToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-complete") + private static final class RequestCompleteValue implements Value { + @JsonUnwrapped + private ToolMessageComplete value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestCompleteValue() {} + + private RequestCompleteValue(ToolMessageComplete value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestCompleteValue && equalTo((RequestCompleteValue) other); + } + + private boolean equalTo(RequestCompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateComputerToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-failed") + private static final class RequestFailedValue implements Value { + @JsonUnwrapped + private ToolMessageFailed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestFailedValue() {} + + private RequestFailedValue(ToolMessageFailed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestFailed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestFailedValue && equalTo((RequestFailedValue) other); + } + + private boolean equalTo(RequestFailedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateComputerToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-response-delayed") + private static final class RequestResponseDelayedValue implements Value { + @JsonUnwrapped + private ToolMessageDelayed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestResponseDelayedValue() {} + + private RequestResponseDelayedValue(ToolMessageDelayed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestResponseDelayed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestResponseDelayedValue && equalTo((RequestResponseDelayedValue) other); + } + + private boolean equalTo(RequestResponseDelayedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateComputerToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "CreateComputerToolDtoMessagesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateCustomKnowledgeBaseDto.java b/src/main/java/com/vapi/api/types/CreateCustomKnowledgeBaseDto.java new file mode 100644 index 0000000..69ebc30 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateCustomKnowledgeBaseDto.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateCustomKnowledgeBaseDto.Builder.class) +public final class CreateCustomKnowledgeBaseDto { + private final Server server; + + private final Map additionalProperties; + + private CreateCustomKnowledgeBaseDto(Server server, Map additionalProperties) { + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return /** + * This is where the knowledge base request will be sent. + *

Request Example:

+ *

POST https://{server.url} + * Content-Type: application/json

+ *

{ + * "messsage": { + * "type": "knowledge-base-request", + * "messages": [ + * { + * "role": "user", + * "content": "Why is ocean blue?" + * } + * ], + * ...other metadata about the call... + * } + * }

+ *

Response Expected:

+ *
{
+     *   "message": {
+     *      "role": "assistant",
+     *      "content": "The ocean is blue because water absorbs everything but blue.",
+     *   }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK
+     *   "documents": [
+     *     {
+     *       "content": "The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.",
+     *       "similarity": 1
+     *     },
+     *     {
+     *       "content": "Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.",
+     *       "similarity": .5
+     *     }
+     *   ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL
+     * }
+     * 
+ */ + @JsonProperty("server") + public Server getServer() { + return server; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateCustomKnowledgeBaseDto && equalTo((CreateCustomKnowledgeBaseDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateCustomKnowledgeBaseDto other) { + return server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ServerStage builder() { + return new Builder(); + } + + public interface ServerStage { + _FinalStage server(@NotNull Server server); + + Builder from(CreateCustomKnowledgeBaseDto other); + } + + public interface _FinalStage { + CreateCustomKnowledgeBaseDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ServerStage, _FinalStage { + private Server server; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateCustomKnowledgeBaseDto other) { + server(other.getServer()); + return this; + } + + /** + *

/** + * This is where the knowledge base request will be sent.

+ *

Request Example:

+ *

POST https://{server.url} + * Content-Type: application/json

+ *

{ + * "messsage": { + * "type": "knowledge-base-request", + * "messages": [ + * { + * "role": "user", + * "content": "Why is ocean blue?" + * } + * ], + * ...other metadata about the call... + * } + * }

+ *

Response Expected:

+ *
{
+         *   "message": {
+         *      "role": "assistant",
+         *      "content": "The ocean is blue because water absorbs everything but blue.",
+         *   }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK
+         *   "documents": [
+         *     {
+         *       "content": "The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.",
+         *       "similarity": 1
+         *     },
+         *     {
+         *       "content": "Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.",
+         *       "similarity": .5
+         *     }
+         *   ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL
+         * }
+         * 
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("server") + public _FinalStage server(@NotNull Server server) { + this.server = Objects.requireNonNull(server, "server must not be null"); + return this; + } + + @java.lang.Override + public CreateCustomKnowledgeBaseDto build() { + return new CreateCustomKnowledgeBaseDto(server, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateCustomLlmCredentialDto.java b/src/main/java/com/vapi/api/types/CreateCustomLlmCredentialDto.java index 84faf56..cc271d0 100644 --- a/src/main/java/com/vapi/api/types/CreateCustomLlmCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateCustomLlmCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,20 @@ public final class CreateCustomLlmCredentialDto { private final String apiKey; + private final Optional authenticationPlan; + + private final Optional name; + private final Map additionalProperties; - private CreateCustomLlmCredentialDto(String apiKey, Map additionalProperties) { + private CreateCustomLlmCredentialDto( + String apiKey, + Optional authenticationPlan, + Optional name, + Map additionalProperties) { this.apiKey = apiKey; + this.authenticationPlan = authenticationPlan; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +53,22 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey + */ + @JsonProperty("authenticationPlan") + public Optional getAuthenticationPlan() { + return authenticationPlan; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +81,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateCustomLlmCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) + && authenticationPlan.equals(other.authenticationPlan) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.authenticationPlan, this.name); } @java.lang.Override @@ -78,12 +108,24 @@ public interface ApiKeyStage { public interface _FinalStage { CreateCustomLlmCredentialDto build(); + + _FinalStage authenticationPlan(Optional authenticationPlan); + + _FinalStage authenticationPlan(OAuth2AuthenticationPlan authenticationPlan); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + + private Optional authenticationPlan = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +134,8 @@ private Builder() {} @java.lang.Override public Builder from(CreateCustomLlmCredentialDto other) { apiKey(other.getApiKey()); + authenticationPlan(other.getAuthenticationPlan()); + name(other.getName()); return this; } @@ -106,9 +150,43 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

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

This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage authenticationPlan(OAuth2AuthenticationPlan authenticationPlan) { + this.authenticationPlan = Optional.ofNullable(authenticationPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authenticationPlan", nulls = Nulls.SKIP) + public _FinalStage authenticationPlan(Optional authenticationPlan) { + this.authenticationPlan = authenticationPlan; + return this; + } + @java.lang.Override public CreateCustomLlmCredentialDto build() { - return new CreateCustomLlmCredentialDto(apiKey, additionalProperties); + return new CreateCustomLlmCredentialDto(apiKey, authenticationPlan, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateDeepInfraCredentialDto.java b/src/main/java/com/vapi/api/types/CreateDeepInfraCredentialDto.java index e546d6b..a974247 100644 --- a/src/main/java/com/vapi/api/types/CreateDeepInfraCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateDeepInfraCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateDeepInfraCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateDeepInfraCredentialDto(String apiKey, Map additionalProperties) { + private CreateDeepInfraCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateDeepInfraCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateDeepInfraCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateDeepInfraCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateDeepInfraCredentialDto build() { - return new CreateDeepInfraCredentialDto(apiKey, additionalProperties); + return new CreateDeepInfraCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateDeepgramCredentialDto.java b/src/main/java/com/vapi/api/types/CreateDeepgramCredentialDto.java index 532be9b..6abb397 100644 --- a/src/main/java/com/vapi/api/types/CreateDeepgramCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateDeepgramCredentialDto.java @@ -25,12 +25,15 @@ public final class CreateDeepgramCredentialDto { private final Optional apiUrl; + private final Optional name; + private final Map additionalProperties; private CreateDeepgramCredentialDto( - String apiKey, Optional apiUrl, Map additionalProperties) { + String apiKey, Optional apiUrl, Optional name, Map additionalProperties) { this.apiKey = apiKey; this.apiUrl = apiUrl; + this.name = name; this.additionalProperties = additionalProperties; } @@ -55,6 +58,14 @@ public Optional getApiUrl() { return apiUrl; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -67,12 +78,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateDeepgramCredentialDto other) { - return apiKey.equals(other.apiKey) && apiUrl.equals(other.apiUrl); + return apiKey.equals(other.apiKey) && apiUrl.equals(other.apiUrl) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.apiUrl); + return Objects.hash(this.apiKey, this.apiUrl, this.name); } @java.lang.Override @@ -96,12 +107,18 @@ public interface _FinalStage { _FinalStage apiUrl(Optional apiUrl); _FinalStage apiUrl(String apiUrl); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + private Optional apiUrl = Optional.empty(); @JsonAnySetter @@ -113,6 +130,7 @@ private Builder() {} public Builder from(CreateDeepgramCredentialDto other) { apiKey(other.getApiKey()); apiUrl(other.getApiUrl()); + name(other.getName()); return this; } @@ -127,6 +145,23 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

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

This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com.

* @return Reference to {@code this} so that method calls can be chained together. @@ -146,7 +181,7 @@ public _FinalStage apiUrl(Optional apiUrl) { @java.lang.Override public CreateDeepgramCredentialDto build() { - return new CreateDeepgramCredentialDto(apiKey, apiUrl, additionalProperties); + return new CreateDeepgramCredentialDto(apiKey, apiUrl, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateElevenLabsCredentialDto.java b/src/main/java/com/vapi/api/types/CreateElevenLabsCredentialDto.java index 914fdaf..9c18830 100644 --- a/src/main/java/com/vapi/api/types/CreateElevenLabsCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateElevenLabsCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateElevenLabsCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateElevenLabsCredentialDto(String apiKey, Map additionalProperties) { + private CreateElevenLabsCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateElevenLabsCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateElevenLabsCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateElevenLabsCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateElevenLabsCredentialDto build() { - return new CreateElevenLabsCredentialDto(apiKey, additionalProperties); + return new CreateElevenLabsCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateGcpCredentialDto.java b/src/main/java/com/vapi/api/types/CreateGcpCredentialDto.java index 1e2eb1e..7015e4c 100644 --- a/src/main/java/com/vapi/api/types/CreateGcpCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateGcpCredentialDto.java @@ -21,22 +21,22 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CreateGcpCredentialDto.Builder.class) public final class CreateGcpCredentialDto { - private final Optional name; - private final GcpKey gcpKey; private final Optional bucketPlan; + private final Optional name; + private final Map additionalProperties; private CreateGcpCredentialDto( - Optional name, GcpKey gcpKey, Optional bucketPlan, + Optional name, Map additionalProperties) { - this.name = name; this.gcpKey = gcpKey; this.bucketPlan = bucketPlan; + this.name = name; this.additionalProperties = additionalProperties; } @@ -45,14 +45,6 @@ public String getProvider() { return "gcp"; } - /** - * @return This is the name of the GCP credential. This is just for your reference. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - /** * @return This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details/<service-account-id>/keys. *

The schema is identical to the JSON that GCP outputs.

@@ -70,6 +62,14 @@ public Optional getBucketPlan() { return bucketPlan; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -82,12 +82,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateGcpCredentialDto other) { - return name.equals(other.name) && gcpKey.equals(other.gcpKey) && bucketPlan.equals(other.bucketPlan); + return gcpKey.equals(other.gcpKey) && bucketPlan.equals(other.bucketPlan) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.gcpKey, this.bucketPlan); + return Objects.hash(this.gcpKey, this.bucketPlan, this.name); } @java.lang.Override @@ -108,23 +108,23 @@ public interface GcpKeyStage { public interface _FinalStage { CreateGcpCredentialDto build(); - _FinalStage name(Optional name); - - _FinalStage name(String name); - _FinalStage bucketPlan(Optional bucketPlan); _FinalStage bucketPlan(BucketPlan bucketPlan); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements GcpKeyStage, _FinalStage { private GcpKey gcpKey; - private Optional bucketPlan = Optional.empty(); - private Optional name = Optional.empty(); + private Optional bucketPlan = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -132,9 +132,9 @@ private Builder() {} @java.lang.Override public Builder from(CreateGcpCredentialDto other) { - name(other.getName()); gcpKey(other.getGcpKey()); bucketPlan(other.getBucketPlan()); + name(other.getName()); return this; } @@ -151,42 +151,42 @@ public _FinalStage gcpKey(@NotNull GcpKey gcpKey) { } /** - *

This is the bucket plan that can be provided to store call artifacts in GCP.

+ *

This is the name of credential. This is just for your reference.

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

This is the name of the GCP credential. This is just for your reference.

+ *

This is the bucket plan that can be provided to store call artifacts in GCP.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage name(String name) { - this.name = Optional.ofNullable(name); + public _FinalStage bucketPlan(BucketPlan bucketPlan) { + this.bucketPlan = Optional.ofNullable(bucketPlan); return this; } @java.lang.Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; + @JsonSetter(value = "bucketPlan", nulls = Nulls.SKIP) + public _FinalStage bucketPlan(Optional bucketPlan) { + this.bucketPlan = bucketPlan; return this; } @java.lang.Override public CreateGcpCredentialDto build() { - return new CreateGcpCredentialDto(name, gcpKey, bucketPlan, additionalProperties); + return new CreateGcpCredentialDto(gcpKey, bucketPlan, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateGladiaCredentialDto.java b/src/main/java/com/vapi/api/types/CreateGladiaCredentialDto.java index 238d468..c06bfb1 100644 --- a/src/main/java/com/vapi/api/types/CreateGladiaCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateGladiaCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class CreateGladiaCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateGladiaCredentialDto(String apiKey, Map additionalProperties) { + private CreateGladiaCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateGladiaCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateGladiaCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateGladiaCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateGladiaCredentialDto build() { - return new CreateGladiaCredentialDto(apiKey, additionalProperties); + return new CreateGladiaCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateGoHighLevelCredentialDto.java b/src/main/java/com/vapi/api/types/CreateGoHighLevelCredentialDto.java index 966a947..52a08f4 100644 --- a/src/main/java/com/vapi/api/types/CreateGoHighLevelCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateGoHighLevelCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateGoHighLevelCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateGoHighLevelCredentialDto(String apiKey, Map additionalProperties) { + private CreateGoHighLevelCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateGoHighLevelCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateGoHighLevelCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateGoHighLevelCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateGoHighLevelCredentialDto build() { - return new CreateGoHighLevelCredentialDto(apiKey, additionalProperties); + return new CreateGoHighLevelCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateGoogleCredentialDto.java b/src/main/java/com/vapi/api/types/CreateGoogleCredentialDto.java new file mode 100644 index 0000000..0bc0367 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateGoogleCredentialDto.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateGoogleCredentialDto.Builder.class) +public final class CreateGoogleCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private CreateGoogleCredentialDto(String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey + */ + @JsonProperty("provider") + public String getProvider() { + return "google"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateGoogleCredentialDto && equalTo((CreateGoogleCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateGoogleCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(CreateGoogleCredentialDto other); + } + + public interface _FinalStage { + CreateGoogleCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateGoogleCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

This is not returned in the API.

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

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateGoogleCredentialDto build() { + return new CreateGoogleCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateGroqCredentialDto.java b/src/main/java/com/vapi/api/types/CreateGroqCredentialDto.java index d8a37a0..bda6cce 100644 --- a/src/main/java/com/vapi/api/types/CreateGroqCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateGroqCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class CreateGroqCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateGroqCredentialDto(String apiKey, Map additionalProperties) { + private CreateGroqCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateGroqCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateGroqCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateGroqCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateGroqCredentialDto build() { - return new CreateGroqCredentialDto(apiKey, additionalProperties); + return new CreateGroqCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateInflectionAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateInflectionAiCredentialDto.java new file mode 100644 index 0000000..2337a1a --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateInflectionAiCredentialDto.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateInflectionAiCredentialDto.Builder.class) +public final class CreateInflectionAiCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private CreateInflectionAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup + */ + @JsonProperty("provider") + public String getProvider() { + return "inflection-ai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateInflectionAiCredentialDto && equalTo((CreateInflectionAiCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateInflectionAiCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(CreateInflectionAiCredentialDto other); + } + + public interface _FinalStage { + CreateInflectionAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateInflectionAiCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

This is not returned in the API.

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

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateInflectionAiCredentialDto build() { + return new CreateInflectionAiCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateLangfuseCredentialDto.java b/src/main/java/com/vapi/api/types/CreateLangfuseCredentialDto.java new file mode 100644 index 0000000..e0b5135 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateLangfuseCredentialDto.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLangfuseCredentialDto.Builder.class) +public final class CreateLangfuseCredentialDto { + private final String publicKey; + + private final String apiKey; + + private final String apiUrl; + + private final Optional name; + + private final Map additionalProperties; + + private CreateLangfuseCredentialDto( + String publicKey, + String apiKey, + String apiUrl, + Optional name, + Map additionalProperties) { + this.publicKey = publicKey; + this.apiKey = apiKey; + this.apiUrl = apiUrl; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "langfuse"; + } + + /** + * @return The public key for Langfuse project. Eg: pk-lf-... + */ + @JsonProperty("publicKey") + public String getPublicKey() { + return publicKey; + } + + /** + * @return The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return The host URL for Langfuse project. Eg: https://cloud.langfuse.com + */ + @JsonProperty("apiUrl") + public String getApiUrl() { + return apiUrl; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLangfuseCredentialDto && equalTo((CreateLangfuseCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLangfuseCredentialDto other) { + return publicKey.equals(other.publicKey) + && apiKey.equals(other.apiKey) + && apiUrl.equals(other.apiUrl) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.publicKey, this.apiKey, this.apiUrl, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PublicKeyStage builder() { + return new Builder(); + } + + public interface PublicKeyStage { + ApiKeyStage publicKey(@NotNull String publicKey); + + Builder from(CreateLangfuseCredentialDto other); + } + + public interface ApiKeyStage { + ApiUrlStage apiKey(@NotNull String apiKey); + } + + public interface ApiUrlStage { + _FinalStage apiUrl(@NotNull String apiUrl); + } + + public interface _FinalStage { + CreateLangfuseCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PublicKeyStage, ApiKeyStage, ApiUrlStage, _FinalStage { + private String publicKey; + + private String apiKey; + + private String apiUrl; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLangfuseCredentialDto other) { + publicKey(other.getPublicKey()); + apiKey(other.getApiKey()); + apiUrl(other.getApiUrl()); + name(other.getName()); + return this; + } + + /** + *

The public key for Langfuse project. Eg: pk-lf-...

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

The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API.

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

The host URL for Langfuse project. Eg: https://cloud.langfuse.com

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

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLangfuseCredentialDto build() { + return new CreateLangfuseCredentialDto(publicKey, apiKey, apiUrl, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateLmntCredentialDto.java b/src/main/java/com/vapi/api/types/CreateLmntCredentialDto.java index 331fab5..7469277 100644 --- a/src/main/java/com/vapi/api/types/CreateLmntCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateLmntCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class CreateLmntCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateLmntCredentialDto(String apiKey, Map additionalProperties) { + private CreateLmntCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateLmntCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateLmntCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateLmntCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateLmntCredentialDto build() { - return new CreateLmntCredentialDto(apiKey, additionalProperties); + return new CreateLmntCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateMakeCredentialDto.java b/src/main/java/com/vapi/api/types/CreateMakeCredentialDto.java index d82f518..c4327d1 100644 --- a/src/main/java/com/vapi/api/types/CreateMakeCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateMakeCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -25,13 +27,20 @@ public final class CreateMakeCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; private CreateMakeCredentialDto( - String teamId, String region, String apiKey, Map additionalProperties) { + String teamId, + String region, + String apiKey, + Optional name, + Map additionalProperties) { this.teamId = teamId; this.region = region; this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -64,6 +73,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -76,12 +93,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateMakeCredentialDto other) { - return teamId.equals(other.teamId) && region.equals(other.region) && apiKey.equals(other.apiKey); + return teamId.equals(other.teamId) + && region.equals(other.region) + && apiKey.equals(other.apiKey) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.teamId, this.region, this.apiKey); + return Objects.hash(this.teamId, this.region, this.apiKey, this.name); } @java.lang.Override @@ -109,6 +129,10 @@ public interface ApiKeyStage { public interface _FinalStage { CreateMakeCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -119,6 +143,8 @@ public static final class Builder implements TeamIdStage, RegionStage, ApiKeySta private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -129,6 +155,7 @@ public Builder from(CreateMakeCredentialDto other) { teamId(other.getTeamId()); region(other.getRegion()); apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -165,9 +192,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateMakeCredentialDto build() { - return new CreateMakeCredentialDto(teamId, region, apiKey, additionalProperties); + return new CreateMakeCredentialDto(teamId, region, apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateOpenAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateOpenAiCredentialDto.java index dafb714..480d90e 100644 --- a/src/main/java/com/vapi/api/types/CreateOpenAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateOpenAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class CreateOpenAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateOpenAiCredentialDto(String apiKey, Map additionalProperties) { + private CreateOpenAiCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateOpenAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateOpenAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateOpenAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateOpenAiCredentialDto build() { - return new CreateOpenAiCredentialDto(apiKey, additionalProperties); + return new CreateOpenAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateOpenRouterCredentialDto.java b/src/main/java/com/vapi/api/types/CreateOpenRouterCredentialDto.java index e3dbb09..c2b3dd8 100644 --- a/src/main/java/com/vapi/api/types/CreateOpenRouterCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateOpenRouterCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateOpenRouterCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateOpenRouterCredentialDto(String apiKey, Map additionalProperties) { + private CreateOpenRouterCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateOpenRouterCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateOpenRouterCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateOpenRouterCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateOpenRouterCredentialDto build() { - return new CreateOpenRouterCredentialDto(apiKey, additionalProperties); + return new CreateOpenRouterCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateOrgDto.java b/src/main/java/com/vapi/api/types/CreateOrgDto.java index ce02242..09fb565 100644 --- a/src/main/java/com/vapi/api/types/CreateOrgDto.java +++ b/src/main/java/com/vapi/api/types/CreateOrgDto.java @@ -22,8 +22,12 @@ public final class CreateOrgDto { private final Optional hipaaEnabled; + private final Optional subscriptionId; + private final Optional name; + private final Optional channel; + private final Optional billingLimit; private final Optional serverUrl; @@ -36,14 +40,18 @@ public final class CreateOrgDto { private CreateOrgDto( Optional hipaaEnabled, + Optional subscriptionId, Optional name, + Optional channel, Optional billingLimit, Optional serverUrl, Optional serverUrlSecret, Optional concurrencyLimit, Map additionalProperties) { this.hipaaEnabled = hipaaEnabled; + this.subscriptionId = subscriptionId; this.name = name; + this.channel = channel; this.billingLimit = billingLimit; this.serverUrl = serverUrl; this.serverUrlSecret = serverUrlSecret; @@ -61,6 +69,14 @@ public Optional getHipaaEnabled() { return hipaaEnabled; } + /** + * @return This is the ID of the subscription the org belongs to. + */ + @JsonProperty("subscriptionId") + public Optional getSubscriptionId() { + return subscriptionId; + } + /** * @return This is the name of the org. This is just for your own reference. */ @@ -69,6 +85,14 @@ public Optional getName() { return name; } + /** + * @return This is the channel of the org. There is the cluster the API traffic for the org will be directed. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + /** * @return This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. */ @@ -115,7 +139,9 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateOrgDto other) { return hipaaEnabled.equals(other.hipaaEnabled) + && subscriptionId.equals(other.subscriptionId) && name.equals(other.name) + && channel.equals(other.channel) && billingLimit.equals(other.billingLimit) && serverUrl.equals(other.serverUrl) && serverUrlSecret.equals(other.serverUrlSecret) @@ -126,7 +152,9 @@ private boolean equalTo(CreateOrgDto other) { public int hashCode() { return Objects.hash( this.hipaaEnabled, + this.subscriptionId, this.name, + this.channel, this.billingLimit, this.serverUrl, this.serverUrlSecret, @@ -146,8 +174,12 @@ public static Builder builder() { public static final class Builder { private Optional hipaaEnabled = Optional.empty(); + private Optional subscriptionId = Optional.empty(); + private Optional name = Optional.empty(); + private Optional channel = Optional.empty(); + private Optional billingLimit = Optional.empty(); private Optional serverUrl = Optional.empty(); @@ -163,7 +195,9 @@ private Builder() {} public Builder from(CreateOrgDto other) { hipaaEnabled(other.getHipaaEnabled()); + subscriptionId(other.getSubscriptionId()); name(other.getName()); + channel(other.getChannel()); billingLimit(other.getBillingLimit()); serverUrl(other.getServerUrl()); serverUrlSecret(other.getServerUrlSecret()); @@ -182,6 +216,17 @@ public Builder hipaaEnabled(Boolean hipaaEnabled) { return this; } + @JsonSetter(value = "subscriptionId", nulls = Nulls.SKIP) + public Builder subscriptionId(Optional subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = Optional.ofNullable(subscriptionId); + return this; + } + @JsonSetter(value = "name", nulls = Nulls.SKIP) public Builder name(Optional name) { this.name = name; @@ -193,6 +238,17 @@ public Builder name(String name) { return this; } + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public Builder channel(Optional channel) { + this.channel = channel; + return this; + } + + public Builder channel(CreateOrgDtoChannel channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + @JsonSetter(value = "billingLimit", nulls = Nulls.SKIP) public Builder billingLimit(Optional billingLimit) { this.billingLimit = billingLimit; @@ -240,7 +296,9 @@ public Builder concurrencyLimit(Double concurrencyLimit) { public CreateOrgDto build() { return new CreateOrgDto( hipaaEnabled, + subscriptionId, name, + channel, billingLimit, serverUrl, serverUrlSecret, diff --git a/src/main/java/com/vapi/api/types/CreateOrgDtoChannel.java b/src/main/java/com/vapi/api/types/CreateOrgDtoChannel.java new file mode 100644 index 0000000..5418e53 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateOrgDtoChannel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreateOrgDtoChannel { + DEFAULT("default"), + + WEEKLY("weekly"); + + private final String value; + + CreateOrgDtoChannel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/CreatePerplexityAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreatePerplexityAiCredentialDto.java index 00b3e3c..85d9bf6 100644 --- a/src/main/java/com/vapi/api/types/CreatePerplexityAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreatePerplexityAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreatePerplexityAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreatePerplexityAiCredentialDto(String apiKey, Map additionalProperties) { + private CreatePerplexityAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreatePerplexityAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreatePerplexityAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreatePerplexityAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreatePerplexityAiCredentialDto build() { - return new CreatePerplexityAiCredentialDto(apiKey, additionalProperties); + return new CreatePerplexityAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreatePlayHtCredentialDto.java b/src/main/java/com/vapi/api/types/CreatePlayHtCredentialDto.java index c3c3453..cc78692 100644 --- a/src/main/java/com/vapi/api/types/CreatePlayHtCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreatePlayHtCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,15 @@ public final class CreatePlayHtCredentialDto { private final String userId; + private final Optional name; + private final Map additionalProperties; - private CreatePlayHtCredentialDto(String apiKey, String userId, Map additionalProperties) { + private CreatePlayHtCredentialDto( + String apiKey, String userId, Optional name, Map additionalProperties) { this.apiKey = apiKey; this.userId = userId; + this.name = name; this.additionalProperties = additionalProperties; } @@ -49,6 +55,14 @@ public String getUserId() { return userId; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -61,12 +75,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreatePlayHtCredentialDto other) { - return apiKey.equals(other.apiKey) && userId.equals(other.userId); + return apiKey.equals(other.apiKey) && userId.equals(other.userId) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.userId); + return Objects.hash(this.apiKey, this.userId, this.name); } @java.lang.Override @@ -90,6 +104,10 @@ public interface UserIdStage { public interface _FinalStage { CreatePlayHtCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -98,6 +116,8 @@ public static final class Builder implements ApiKeyStage, UserIdStage, _FinalSta private String userId; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -107,6 +127,7 @@ private Builder() {} public Builder from(CreatePlayHtCredentialDto other) { apiKey(other.getApiKey()); userId(other.getUserId()); + name(other.getName()); return this; } @@ -128,9 +149,26 @@ public _FinalStage userId(@NotNull String userId) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreatePlayHtCredentialDto build() { - return new CreatePlayHtCredentialDto(apiKey, userId, additionalProperties); + return new CreatePlayHtCredentialDto(apiKey, userId, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateRimeAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateRimeAiCredentialDto.java index f8baea8..e3788e3 100644 --- a/src/main/java/com/vapi/api/types/CreateRimeAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateRimeAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class CreateRimeAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateRimeAiCredentialDto(String apiKey, Map additionalProperties) { + private CreateRimeAiCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateRimeAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateRimeAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateRimeAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateRimeAiCredentialDto build() { - return new CreateRimeAiCredentialDto(apiKey, additionalProperties); + return new CreateRimeAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateRunpodCredentialDto.java b/src/main/java/com/vapi/api/types/CreateRunpodCredentialDto.java index d76314e..85e4ee8 100644 --- a/src/main/java/com/vapi/api/types/CreateRunpodCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateRunpodCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class CreateRunpodCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateRunpodCredentialDto(String apiKey, Map additionalProperties) { + private CreateRunpodCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateRunpodCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateRunpodCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateRunpodCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateRunpodCredentialDto build() { - return new CreateRunpodCredentialDto(apiKey, additionalProperties); + return new CreateRunpodCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateS3CredentialDto.java b/src/main/java/com/vapi/api/types/CreateS3CredentialDto.java index b527baa..9395831 100644 --- a/src/main/java/com/vapi/api/types/CreateS3CredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateS3CredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -29,6 +31,8 @@ public final class CreateS3CredentialDto { private final String s3PathPrefix; + private final Optional name; + private final Map additionalProperties; private CreateS3CredentialDto( @@ -37,12 +41,14 @@ private CreateS3CredentialDto( String region, String s3BucketName, String s3PathPrefix, + Optional name, Map additionalProperties) { this.awsAccessKeyId = awsAccessKeyId; this.awsSecretAccessKey = awsSecretAccessKey; this.region = region; this.s3BucketName = s3BucketName; this.s3PathPrefix = s3PathPrefix; + this.name = name; this.additionalProperties = additionalProperties; } @@ -94,6 +100,14 @@ public String getS3PathPrefix() { return s3PathPrefix; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -110,13 +124,19 @@ private boolean equalTo(CreateS3CredentialDto other) { && awsSecretAccessKey.equals(other.awsSecretAccessKey) && region.equals(other.region) && s3BucketName.equals(other.s3BucketName) - && s3PathPrefix.equals(other.s3PathPrefix); + && s3PathPrefix.equals(other.s3PathPrefix) + && name.equals(other.name); } @java.lang.Override public int hashCode() { return Objects.hash( - this.awsAccessKeyId, this.awsSecretAccessKey, this.region, this.s3BucketName, this.s3PathPrefix); + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.region, + this.s3BucketName, + this.s3PathPrefix, + this.name); } @java.lang.Override @@ -152,6 +172,10 @@ public interface S3PathPrefixStage { public interface _FinalStage { CreateS3CredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -172,6 +196,8 @@ public static final class Builder private String s3PathPrefix; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -184,6 +210,7 @@ public Builder from(CreateS3CredentialDto other) { region(other.getRegion()); s3BucketName(other.getS3BucketName()); s3PathPrefix(other.getS3PathPrefix()); + name(other.getName()); return this; } @@ -242,10 +269,27 @@ public _FinalStage s3PathPrefix(@NotNull String s3PathPrefix) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateS3CredentialDto build() { return new CreateS3CredentialDto( - awsAccessKeyId, awsSecretAccessKey, region, s3BucketName, s3PathPrefix, additionalProperties); + awsAccessKeyId, awsSecretAccessKey, region, s3BucketName, s3PathPrefix, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateTavusCredentialDto.java b/src/main/java/com/vapi/api/types/CreateTavusCredentialDto.java new file mode 100644 index 0000000..1dd7ec4 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateTavusCredentialDto.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTavusCredentialDto.Builder.class) +public final class CreateTavusCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private CreateTavusCredentialDto(String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "tavus"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTavusCredentialDto && equalTo((CreateTavusCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTavusCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(CreateTavusCredentialDto other); + } + + public interface _FinalStage { + CreateTavusCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateTavusCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

This is not returned in the API.

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

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateTavusCredentialDto build() { + return new CreateTavusCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateTextEditorToolDto.java b/src/main/java/com/vapi/api/types/CreateTextEditorToolDto.java new file mode 100644 index 0000000..2e402f2 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateTextEditorToolDto.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTextEditorToolDto.Builder.class) +public final class CreateTextEditorToolDto { + private final Optional async; + + private final Optional> messages; + + private final Optional function; + + private final Optional server; + + private final Map additionalProperties; + + private CreateTextEditorToolDto( + Optional async, + Optional> messages, + Optional function, + Optional server, + Map additionalProperties) { + this.async = async; + this.messages = messages; + this.function = function; + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return This determines if the tool is async. + *

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

+ *

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

+ *

Defaults to synchronous (false).

+ */ + @JsonProperty("async") + public Optional getAsync() { + return async; + } + + /** + * @return These are the messages that will be spoken to the user as the tool is running. + *

For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

+ */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return The sub type of tool. + */ + @JsonProperty("subType") + public String getSubType() { + return "text_editor_20241022"; + } + + /** + * @return The name of the tool, fixed to 'str_replace_editor' + */ + @JsonProperty("name") + public String getName() { + return "str_replace_editor"; + } + + /** + * @return This is the function definition of the tool. + *

For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

+ *

An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

+ */ + @JsonProperty("function") + public Optional getFunction() { + return function; + } + + /** + * @return This is the server that will be hit when this tool is requested by the model. + *

All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

+ *

This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

+ */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTextEditorToolDto && equalTo((CreateTextEditorToolDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTextEditorToolDto other) { + return async.equals(other.async) + && messages.equals(other.messages) + && function.equals(other.function) + && server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.async, this.messages, this.function, this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional async = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private Optional function = Optional.empty(); + + private Optional server = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateTextEditorToolDto other) { + async(other.getAsync()); + messages(other.getMessages()); + function(other.getFunction()); + server(other.getServer()); + return this; + } + + @JsonSetter(value = "async", nulls = Nulls.SKIP) + public Builder async(Optional async) { + this.async = async; + return this; + } + + public Builder async(Boolean async) { + this.async = Optional.ofNullable(async); + return this; + } + + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public Builder messages(Optional> messages) { + this.messages = messages; + return this; + } + + public Builder messages(List messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @JsonSetter(value = "function", nulls = Nulls.SKIP) + public Builder function(Optional function) { + this.function = function; + return this; + } + + public Builder function(OpenAiFunction function) { + this.function = Optional.ofNullable(function); + return this; + } + + @JsonSetter(value = "server", nulls = Nulls.SKIP) + public Builder server(Optional server) { + this.server = server; + return this; + } + + public Builder server(Server server) { + this.server = Optional.ofNullable(server); + return this; + } + + public CreateTextEditorToolDto build() { + return new CreateTextEditorToolDto(async, messages, function, server, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateTextEditorToolDtoMessagesItem.java b/src/main/java/com/vapi/api/types/CreateTextEditorToolDtoMessagesItem.java new file mode 100644 index 0000000..06378c2 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateTextEditorToolDtoMessagesItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class CreateTextEditorToolDtoMessagesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private CreateTextEditorToolDtoMessagesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static CreateTextEditorToolDtoMessagesItem requestStart(ToolMessageStart value) { + return new CreateTextEditorToolDtoMessagesItem(new RequestStartValue(value)); + } + + public static CreateTextEditorToolDtoMessagesItem requestComplete(ToolMessageComplete value) { + return new CreateTextEditorToolDtoMessagesItem(new RequestCompleteValue(value)); + } + + public static CreateTextEditorToolDtoMessagesItem requestFailed(ToolMessageFailed value) { + return new CreateTextEditorToolDtoMessagesItem(new RequestFailedValue(value)); + } + + public static CreateTextEditorToolDtoMessagesItem requestResponseDelayed(ToolMessageDelayed value) { + return new CreateTextEditorToolDtoMessagesItem(new RequestResponseDelayedValue(value)); + } + + public boolean isRequestStart() { + return value instanceof RequestStartValue; + } + + public boolean isRequestComplete() { + return value instanceof RequestCompleteValue; + } + + public boolean isRequestFailed() { + return value instanceof RequestFailedValue; + } + + public boolean isRequestResponseDelayed() { + return value instanceof RequestResponseDelayedValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getRequestStart() { + if (isRequestStart()) { + return Optional.of(((RequestStartValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestComplete() { + if (isRequestComplete()) { + return Optional.of(((RequestCompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestFailed() { + if (isRequestFailed()) { + return Optional.of(((RequestFailedValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestResponseDelayed() { + if (isRequestResponseDelayed()) { + return Optional.of(((RequestResponseDelayedValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitRequestStart(ToolMessageStart requestStart); + + T visitRequestComplete(ToolMessageComplete requestComplete); + + T visitRequestFailed(ToolMessageFailed requestFailed); + + T visitRequestResponseDelayed(ToolMessageDelayed requestResponseDelayed); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(RequestStartValue.class), + @JsonSubTypes.Type(RequestCompleteValue.class), + @JsonSubTypes.Type(RequestFailedValue.class), + @JsonSubTypes.Type(RequestResponseDelayedValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("request-start") + private static final class RequestStartValue implements Value { + @JsonUnwrapped + private ToolMessageStart value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestStartValue() {} + + private RequestStartValue(ToolMessageStart value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestStart(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestStartValue && equalTo((RequestStartValue) other); + } + + private boolean equalTo(RequestStartValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateTextEditorToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-complete") + private static final class RequestCompleteValue implements Value { + @JsonUnwrapped + private ToolMessageComplete value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestCompleteValue() {} + + private RequestCompleteValue(ToolMessageComplete value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestCompleteValue && equalTo((RequestCompleteValue) other); + } + + private boolean equalTo(RequestCompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateTextEditorToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-failed") + private static final class RequestFailedValue implements Value { + @JsonUnwrapped + private ToolMessageFailed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestFailedValue() {} + + private RequestFailedValue(ToolMessageFailed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestFailed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestFailedValue && equalTo((RequestFailedValue) other); + } + + private boolean equalTo(RequestFailedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateTextEditorToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-response-delayed") + private static final class RequestResponseDelayedValue implements Value { + @JsonUnwrapped + private ToolMessageDelayed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestResponseDelayedValue() {} + + private RequestResponseDelayedValue(ToolMessageDelayed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestResponseDelayed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestResponseDelayedValue && equalTo((RequestResponseDelayedValue) other); + } + + private boolean equalTo(RequestResponseDelayedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateTextEditorToolDtoMessagesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "CreateTextEditorToolDtoMessagesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateTogetherAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateTogetherAiCredentialDto.java index e4c4805..3f5bc40 100644 --- a/src/main/java/com/vapi/api/types/CreateTogetherAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateTogetherAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class CreateTogetherAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateTogetherAiCredentialDto(String apiKey, Map additionalProperties) { + private CreateTogetherAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateTogetherAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { CreateTogetherAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(CreateTogetherAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateTogetherAiCredentialDto build() { - return new CreateTogetherAiCredentialDto(apiKey, additionalProperties); + return new CreateTogetherAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateTrieveKnowledgeBaseDto.java b/src/main/java/com/vapi/api/types/CreateTrieveKnowledgeBaseDto.java new file mode 100644 index 0000000..6ba8c6f --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateTrieveKnowledgeBaseDto.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTrieveKnowledgeBaseDto.Builder.class) +public final class CreateTrieveKnowledgeBaseDto { + private final Optional name; + + private final TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan; + + private final Optional vectorStoreCreatePlan; + + private final Optional vectorStoreProviderId; + + private final Map additionalProperties; + + private CreateTrieveKnowledgeBaseDto( + Optional name, + TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan, + Optional vectorStoreCreatePlan, + Optional vectorStoreProviderId, + Map additionalProperties) { + this.name = name; + this.vectorStoreSearchPlan = vectorStoreSearchPlan; + this.vectorStoreCreatePlan = vectorStoreCreatePlan; + this.vectorStoreProviderId = vectorStoreProviderId; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the name of the knowledge base. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return This is the plan on how to search the vector store while a call is going on. + */ + @JsonProperty("vectorStoreSearchPlan") + public TrieveKnowledgeBaseVectorStoreSearchPlan getVectorStoreSearchPlan() { + return vectorStoreSearchPlan; + } + + /** + * @return This is the plan if you want us to create a new vector store on your behalf. To use an existing vector store from your account, use vectoreStoreProviderId + */ + @JsonProperty("vectorStoreCreatePlan") + public Optional getVectorStoreCreatePlan() { + return vectorStoreCreatePlan; + } + + /** + * @return This is an vector store that you already have on your account with the provider. To create a new vector store, use vectorStoreCreatePlan. + *

Usage:

+ *
    + *
  • To bring your own vector store from Trieve, go to https://trieve.ai
  • + *
  • Create a dataset, and use the datasetId here.
  • + *
+ */ + @JsonProperty("vectorStoreProviderId") + public Optional getVectorStoreProviderId() { + return vectorStoreProviderId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTrieveKnowledgeBaseDto && equalTo((CreateTrieveKnowledgeBaseDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTrieveKnowledgeBaseDto other) { + return name.equals(other.name) + && vectorStoreSearchPlan.equals(other.vectorStoreSearchPlan) + && vectorStoreCreatePlan.equals(other.vectorStoreCreatePlan) + && vectorStoreProviderId.equals(other.vectorStoreProviderId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.vectorStoreSearchPlan, this.vectorStoreCreatePlan, this.vectorStoreProviderId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VectorStoreSearchPlanStage builder() { + return new Builder(); + } + + public interface VectorStoreSearchPlanStage { + _FinalStage vectorStoreSearchPlan(@NotNull TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan); + + Builder from(CreateTrieveKnowledgeBaseDto other); + } + + public interface _FinalStage { + CreateTrieveKnowledgeBaseDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage vectorStoreCreatePlan(Optional vectorStoreCreatePlan); + + _FinalStage vectorStoreCreatePlan(TrieveKnowledgeBaseVectorStoreCreatePlan vectorStoreCreatePlan); + + _FinalStage vectorStoreProviderId(Optional vectorStoreProviderId); + + _FinalStage vectorStoreProviderId(String vectorStoreProviderId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VectorStoreSearchPlanStage, _FinalStage { + private TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan; + + private Optional vectorStoreProviderId = Optional.empty(); + + private Optional vectorStoreCreatePlan = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateTrieveKnowledgeBaseDto other) { + name(other.getName()); + vectorStoreSearchPlan(other.getVectorStoreSearchPlan()); + vectorStoreCreatePlan(other.getVectorStoreCreatePlan()); + vectorStoreProviderId(other.getVectorStoreProviderId()); + return this; + } + + /** + *

This is the plan on how to search the vector store while a call is going on.

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

This is an vector store that you already have on your account with the provider. To create a new vector store, use vectorStoreCreatePlan.

+ *

Usage:

+ *
    + *
  • To bring your own vector store from Trieve, go to https://trieve.ai
  • + *
  • Create a dataset, and use the datasetId here.
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage vectorStoreProviderId(String vectorStoreProviderId) { + this.vectorStoreProviderId = Optional.ofNullable(vectorStoreProviderId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "vectorStoreProviderId", nulls = Nulls.SKIP) + public _FinalStage vectorStoreProviderId(Optional vectorStoreProviderId) { + this.vectorStoreProviderId = vectorStoreProviderId; + return this; + } + + /** + *

This is the plan if you want us to create a new vector store on your behalf. To use an existing vector store from your account, use vectoreStoreProviderId

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

This is the name of the knowledge base.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateTrieveKnowledgeBaseDto build() { + return new CreateTrieveKnowledgeBaseDto( + name, vectorStoreSearchPlan, vectorStoreCreatePlan, vectorStoreProviderId, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateTwilioCredentialDto.java b/src/main/java/com/vapi/api/types/CreateTwilioCredentialDto.java index 8b70a97..e757c5b 100644 --- a/src/main/java/com/vapi/api/types/CreateTwilioCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateTwilioCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,15 @@ public final class CreateTwilioCredentialDto { private final String accountSid; + private final Optional name; + private final Map additionalProperties; - private CreateTwilioCredentialDto(String authToken, String accountSid, Map additionalProperties) { + private CreateTwilioCredentialDto( + String authToken, String accountSid, Optional name, Map additionalProperties) { this.authToken = authToken; this.accountSid = accountSid; + this.name = name; this.additionalProperties = additionalProperties; } @@ -49,6 +55,14 @@ public String getAccountSid() { return accountSid; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -61,12 +75,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateTwilioCredentialDto other) { - return authToken.equals(other.authToken) && accountSid.equals(other.accountSid); + return authToken.equals(other.authToken) && accountSid.equals(other.accountSid) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.authToken, this.accountSid); + return Objects.hash(this.authToken, this.accountSid, this.name); } @java.lang.Override @@ -90,6 +104,10 @@ public interface AccountSidStage { public interface _FinalStage { CreateTwilioCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -98,6 +116,8 @@ public static final class Builder implements AuthTokenStage, AccountSidStage, _F private String accountSid; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -107,6 +127,7 @@ private Builder() {} public Builder from(CreateTwilioCredentialDto other) { authToken(other.getAuthToken()); accountSid(other.getAccountSid()); + name(other.getName()); return this; } @@ -128,9 +149,26 @@ public _FinalStage accountSid(@NotNull String accountSid) { return this; } + /** + *

This is the name of credential. This is just for your reference.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateTwilioCredentialDto build() { - return new CreateTwilioCredentialDto(authToken, accountSid, additionalProperties); + return new CreateTwilioCredentialDto(authToken, accountSid, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateVapiPhoneNumberDto.java b/src/main/java/com/vapi/api/types/CreateVapiPhoneNumberDto.java index a86047e..72b9a6c 100644 --- a/src/main/java/com/vapi/api/types/CreateVapiPhoneNumberDto.java +++ b/src/main/java/com/vapi/api/types/CreateVapiPhoneNumberDto.java @@ -25,6 +25,8 @@ public final class CreateVapiPhoneNumberDto { private final String sipUri; + private final Optional authentication; + private final Optional name; private final Optional assistantId; @@ -40,6 +42,7 @@ public final class CreateVapiPhoneNumberDto { private CreateVapiPhoneNumberDto( Optional fallbackDestination, String sipUri, + Optional authentication, Optional name, Optional assistantId, Optional squadId, @@ -48,6 +51,7 @@ private CreateVapiPhoneNumberDto( Map additionalProperties) { this.fallbackDestination = fallbackDestination; this.sipUri = sipUri; + this.authentication = authentication; this.name = name; this.assistantId = assistantId; this.squadId = squadId; @@ -79,6 +83,15 @@ public String getSipUri() { return sipUri; } + /** + * @return This enables authentication for incoming SIP INVITE requests to the sipUri. + *

If not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.

+ */ + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + /** * @return This is the name of the phone number. This is just for your own reference. */ @@ -138,6 +151,7 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateVapiPhoneNumberDto other) { return fallbackDestination.equals(other.fallbackDestination) && sipUri.equals(other.sipUri) + && authentication.equals(other.authentication) && name.equals(other.name) && assistantId.equals(other.assistantId) && squadId.equals(other.squadId) @@ -150,6 +164,7 @@ public int hashCode() { return Objects.hash( this.fallbackDestination, this.sipUri, + this.authentication, this.name, this.assistantId, this.squadId, @@ -179,6 +194,10 @@ public interface _FinalStage { _FinalStage fallbackDestination(CreateVapiPhoneNumberDtoFallbackDestination fallbackDestination); + _FinalStage authentication(Optional authentication); + + _FinalStage authentication(SipAuthentication authentication); + _FinalStage name(Optional name); _FinalStage name(String name); @@ -214,6 +233,8 @@ public static final class Builder implements SipUriStage, _FinalStage { private Optional name = Optional.empty(); + private Optional authentication = Optional.empty(); + private Optional fallbackDestination = Optional.empty(); @JsonAnySetter @@ -225,6 +246,7 @@ private Builder() {} public Builder from(CreateVapiPhoneNumberDto other) { fallbackDestination(other.getFallbackDestination()); sipUri(other.getSipUri()); + authentication(other.getAuthentication()); name(other.getName()); assistantId(other.getAssistantId()); squadId(other.getSquadId()); @@ -335,6 +357,24 @@ public _FinalStage name(Optional name) { return this; } + /** + *

This enables authentication for incoming SIP INVITE requests to the sipUri.

+ *

If not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.

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

This is the fallback destination an inbound call will be transferred to if:

*
    @@ -364,6 +404,7 @@ public CreateVapiPhoneNumberDto build() { return new CreateVapiPhoneNumberDto( fallbackDestination, sipUri, + authentication, name, assistantId, squadId, diff --git a/src/main/java/com/vapi/api/types/CreateVonageCredentialDto.java b/src/main/java/com/vapi/api/types/CreateVonageCredentialDto.java index b6cf7e6..b63ab3e 100644 --- a/src/main/java/com/vapi/api/types/CreateVonageCredentialDto.java +++ b/src/main/java/com/vapi/api/types/CreateVonageCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,15 @@ public final class CreateVonageCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private CreateVonageCredentialDto(String apiSecret, String apiKey, Map additionalProperties) { + private CreateVonageCredentialDto( + String apiSecret, String apiKey, Optional name, Map additionalProperties) { this.apiSecret = apiSecret; this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -49,6 +55,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -61,12 +75,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateVonageCredentialDto other) { - return apiSecret.equals(other.apiSecret) && apiKey.equals(other.apiKey); + return apiSecret.equals(other.apiSecret) && apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiSecret, this.apiKey); + return Objects.hash(this.apiSecret, this.apiKey, this.name); } @java.lang.Override @@ -90,6 +104,10 @@ public interface ApiKeyStage { public interface _FinalStage { CreateVonageCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -98,6 +116,8 @@ public static final class Builder implements ApiSecretStage, ApiKeyStage, _Final private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -107,6 +127,7 @@ private Builder() {} public Builder from(CreateVonageCredentialDto other) { apiSecret(other.getApiSecret()); apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -128,9 +149,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

    This is the name of credential. This is just for your reference.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public CreateVonageCredentialDto build() { - return new CreateVonageCredentialDto(apiSecret, apiKey, additionalProperties); + return new CreateVonageCredentialDto(apiSecret, apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CreateWebhookCredentialDto.java b/src/main/java/com/vapi/api/types/CreateWebhookCredentialDto.java new file mode 100644 index 0000000..869d1d4 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateWebhookCredentialDto.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateWebhookCredentialDto.Builder.class) +public final class CreateWebhookCredentialDto { + private final OAuth2AuthenticationPlan authenticationPlan; + + private final Optional name; + + private final Map additionalProperties; + + private CreateWebhookCredentialDto( + OAuth2AuthenticationPlan authenticationPlan, + Optional name, + Map additionalProperties) { + this.authenticationPlan = authenticationPlan; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "webhook"; + } + + /** + * @return This is the authentication plan. Currently supports OAuth2 RFC 6749. + */ + @JsonProperty("authenticationPlan") + public OAuth2AuthenticationPlan getAuthenticationPlan() { + return authenticationPlan; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateWebhookCredentialDto && equalTo((CreateWebhookCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateWebhookCredentialDto other) { + return authenticationPlan.equals(other.authenticationPlan) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.authenticationPlan, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AuthenticationPlanStage builder() { + return new Builder(); + } + + public interface AuthenticationPlanStage { + _FinalStage authenticationPlan(@NotNull OAuth2AuthenticationPlan authenticationPlan); + + Builder from(CreateWebhookCredentialDto other); + } + + public interface _FinalStage { + CreateWebhookCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AuthenticationPlanStage, _FinalStage { + private OAuth2AuthenticationPlan authenticationPlan; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateWebhookCredentialDto other) { + authenticationPlan(other.getAuthenticationPlan()); + name(other.getName()); + return this; + } + + /** + *

    This is the authentication plan. Currently supports OAuth2 RFC 6749.

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

    This is the name of credential. This is just for your reference.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateWebhookCredentialDto build() { + return new CreateWebhookCredentialDto(authenticationPlan, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreateXAiCredentialDto.java b/src/main/java/com/vapi/api/types/CreateXAiCredentialDto.java new file mode 100644 index 0000000..d29c219 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreateXAiCredentialDto.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateXAiCredentialDto.Builder.class) +public final class CreateXAiCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private CreateXAiCredentialDto(String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai + */ + @JsonProperty("provider") + public String getProvider() { + return "xai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateXAiCredentialDto && equalTo((CreateXAiCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateXAiCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(CreateXAiCredentialDto other); + } + + public interface _FinalStage { + CreateXAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateXAiCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

    This is not returned in the API.

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

    This is the name of credential. This is just for your reference.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateXAiCredentialDto build() { + return new CreateXAiCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CreditsBuyDto.java b/src/main/java/com/vapi/api/types/CreditsBuyDto.java new file mode 100644 index 0000000..727130a --- /dev/null +++ b/src/main/java/com/vapi/api/types/CreditsBuyDto.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditsBuyDto.Builder.class) +public final class CreditsBuyDto { + private final double credits; + + private final Map additionalProperties; + + private CreditsBuyDto(double credits, Map additionalProperties) { + this.credits = credits; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the number of credits to add to the subscription. + */ + @JsonProperty("credits") + public double getCredits() { + return credits; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditsBuyDto && equalTo((CreditsBuyDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditsBuyDto other) { + return credits == other.credits; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.credits); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CreditsStage builder() { + return new Builder(); + } + + public interface CreditsStage { + _FinalStage credits(double credits); + + Builder from(CreditsBuyDto other); + } + + public interface _FinalStage { + CreditsBuyDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CreditsStage, _FinalStage { + private double credits; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreditsBuyDto other) { + credits(other.getCredits()); + return this; + } + + /** + *

    This is the number of credits to add to the subscription.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("credits") + public _FinalStage credits(double credits) { + this.credits = credits; + return this; + } + + @java.lang.Override + public CreditsBuyDto build() { + return new CreditsBuyDto(credits, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CustomKnowledgeBase.java b/src/main/java/com/vapi/api/types/CustomKnowledgeBase.java new file mode 100644 index 0000000..69b6e1a --- /dev/null +++ b/src/main/java/com/vapi/api/types/CustomKnowledgeBase.java @@ -0,0 +1,235 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomKnowledgeBase.Builder.class) +public final class CustomKnowledgeBase { + private final Server server; + + private final String id; + + private final String orgId; + + private final Map additionalProperties; + + private CustomKnowledgeBase(Server server, String id, String orgId, Map additionalProperties) { + this.server = server; + this.id = id; + this.orgId = orgId; + this.additionalProperties = additionalProperties; + } + + /** + * @return /** + * This is where the knowledge base request will be sent. + *

    Request Example:

    + *

    POST https://{server.url} + * Content-Type: application/json

    + *

    { + * "messsage": { + * "type": "knowledge-base-request", + * "messages": [ + * { + * "role": "user", + * "content": "Why is ocean blue?" + * } + * ], + * ...other metadata about the call... + * } + * }

    + *

    Response Expected:

    + *
    {
    +     *   "message": {
    +     *      "role": "assistant",
    +     *      "content": "The ocean is blue because water absorbs everything but blue.",
    +     *   }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK
    +     *   "documents": [
    +     *     {
    +     *       "content": "The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.",
    +     *       "similarity": 1
    +     *     },
    +     *     {
    +     *       "content": "Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.",
    +     *       "similarity": .5
    +     *     }
    +     *   ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL
    +     * }
    +     * 
    + */ + @JsonProperty("server") + public Server getServer() { + return server; + } + + /** + * @return This is the id of the knowledge base. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the org id of the knowledge base. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomKnowledgeBase && equalTo((CustomKnowledgeBase) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomKnowledgeBase other) { + return server.equals(other.server) && id.equals(other.id) && orgId.equals(other.orgId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.server, this.id, this.orgId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ServerStage builder() { + return new Builder(); + } + + public interface ServerStage { + IdStage server(@NotNull Server server); + + Builder from(CustomKnowledgeBase other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + _FinalStage orgId(@NotNull String orgId); + } + + public interface _FinalStage { + CustomKnowledgeBase build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ServerStage, IdStage, OrgIdStage, _FinalStage { + private Server server; + + private String id; + + private String orgId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CustomKnowledgeBase other) { + server(other.getServer()); + id(other.getId()); + orgId(other.getOrgId()); + return this; + } + + /** + *

    /** + * This is where the knowledge base request will be sent.

    + *

    Request Example:

    + *

    POST https://{server.url} + * Content-Type: application/json

    + *

    { + * "messsage": { + * "type": "knowledge-base-request", + * "messages": [ + * { + * "role": "user", + * "content": "Why is ocean blue?" + * } + * ], + * ...other metadata about the call... + * } + * }

    + *

    Response Expected:

    + *
    {
    +         *   "message": {
    +         *      "role": "assistant",
    +         *      "content": "The ocean is blue because water absorbs everything but blue.",
    +         *   }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK
    +         *   "documents": [
    +         *     {
    +         *       "content": "The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.",
    +         *       "similarity": 1
    +         *     },
    +         *     {
    +         *       "content": "Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.",
    +         *       "similarity": .5
    +         *     }
    +         *   ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL
    +         * }
    +         * 
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("server") + public IdStage server(@NotNull Server server) { + this.server = Objects.requireNonNull(server, "server must not be null"); + return this; + } + + /** + *

    This is the id of the knowledge base.

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

    This is the org id of the knowledge base.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("orgId") + public _FinalStage orgId(@NotNull String orgId) { + this.orgId = Objects.requireNonNull(orgId, "orgId must not be null"); + return this; + } + + @java.lang.Override + public CustomKnowledgeBase build() { + return new CustomKnowledgeBase(server, id, orgId, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CustomLlmCredential.java b/src/main/java/com/vapi/api/types/CustomLlmCredential.java index 281e869..3050fd3 100644 --- a/src/main/java/com/vapi/api/types/CustomLlmCredential.java +++ b/src/main/java/com/vapi/api/types/CustomLlmCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -22,6 +24,8 @@ public final class CustomLlmCredential { private final String apiKey; + private final Optional authenticationPlan; + private final String id; private final String orgId; @@ -30,20 +34,30 @@ public final class CustomLlmCredential { private final OffsetDateTime updatedAt; + private final Optional authenticationSession; + + private final Optional name; + private final Map additionalProperties; private CustomLlmCredential( String apiKey, + Optional authenticationPlan, String id, String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional authenticationSession, + Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.authenticationPlan = authenticationPlan; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.authenticationSession = authenticationSession; + this.name = name; this.additionalProperties = additionalProperties; } @@ -60,6 +74,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey + */ + @JsonProperty("authenticationPlan") + public Optional getAuthenticationPlan() { + return authenticationPlan; + } + /** * @return This is the unique identifier for the credential. */ @@ -92,6 +114,22 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the authentication session for the credential. Available for credentials that have an authentication plan. + */ + @JsonProperty("authenticationSession") + public Optional getAuthenticationSession() { + return authenticationSession; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -105,15 +143,26 @@ public Map getAdditionalProperties() { private boolean equalTo(CustomLlmCredential other) { return apiKey.equals(other.apiKey) + && authenticationPlan.equals(other.authenticationPlan) && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && authenticationSession.equals(other.authenticationSession) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash( + this.apiKey, + this.authenticationPlan, + this.id, + this.orgId, + this.createdAt, + this.updatedAt, + this.authenticationSession, + this.name); } @java.lang.Override @@ -149,6 +198,18 @@ public interface UpdatedAtStage { public interface _FinalStage { CustomLlmCredential build(); + + _FinalStage authenticationPlan(Optional authenticationPlan); + + _FinalStage authenticationPlan(OAuth2AuthenticationPlan authenticationPlan); + + _FinalStage authenticationSession(Optional authenticationSession); + + _FinalStage authenticationSession(Oauth2AuthenticationSession authenticationSession); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +225,12 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + + private Optional authenticationSession = Optional.empty(); + + private Optional authenticationPlan = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -172,10 +239,13 @@ private Builder() {} @java.lang.Override public Builder from(CustomLlmCredential other) { apiKey(other.getApiKey()); + authenticationPlan(other.getAuthenticationPlan()); id(other.getId()); orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + authenticationSession(other.getAuthenticationSession()); + name(other.getName()); return this; } @@ -234,9 +304,69 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

    This is the name of credential. This is just for your reference.

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

    This is the authentication session for the credential. Available for credentials that have an authentication plan.

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

    This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage authenticationPlan(OAuth2AuthenticationPlan authenticationPlan) { + this.authenticationPlan = Optional.ofNullable(authenticationPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authenticationPlan", nulls = Nulls.SKIP) + public _FinalStage authenticationPlan(Optional authenticationPlan) { + this.authenticationPlan = authenticationPlan; + return this; + } + @java.lang.Override public CustomLlmCredential build() { - return new CustomLlmCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new CustomLlmCredential( + apiKey, + authenticationPlan, + id, + orgId, + createdAt, + updatedAt, + authenticationSession, + name, + additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/CustomLlmModel.java b/src/main/java/com/vapi/api/types/CustomLlmModel.java index 81e1246..6f69e65 100644 --- a/src/main/java/com/vapi/api/types/CustomLlmModel.java +++ b/src/main/java/com/vapi/api/types/CustomLlmModel.java @@ -28,6 +28,10 @@ public final class CustomLlmModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final Optional metadataSendMode; private final String url; @@ -36,8 +40,6 @@ public final class CustomLlmModel { private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -50,11 +52,12 @@ private CustomLlmModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, Optional metadataSendMode, String url, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -62,11 +65,12 @@ private CustomLlmModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.metadataSendMode = metadataSendMode; this.url = url; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -99,6 +103,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This determines whether metadata is sent in requests to the custom provider. *
      @@ -138,14 +158,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -189,11 +201,12 @@ private boolean equalTo(CustomLlmModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && metadataSendMode.equals(other.metadataSendMode) && url.equals(other.url) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -205,11 +218,12 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.metadataSendMode, this.url, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -249,6 +263,14 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); + _FinalStage knowledgeBase(Optional knowledgeBase); + + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); + + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); + + _FinalStage knowledgeBaseId(String knowledgeBaseId); + _FinalStage metadataSendMode(Optional metadataSendMode); _FinalStage metadataSendMode(CustomLlmModelMetadataSendMode metadataSendMode); @@ -257,10 +279,6 @@ public interface _FinalStage { _FinalStage temperature(Double temperature); - _FinalStage knowledgeBase(Optional knowledgeBase); - - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); - _FinalStage maxTokens(Optional maxTokens); _FinalStage maxTokens(Double maxTokens); @@ -286,12 +304,14 @@ public static final class Builder implements UrlStage, ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); private Optional metadataSendMode = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -308,11 +328,12 @@ public Builder from(CustomLlmModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); metadataSendMode(other.getMetadataSendMode()); url(other.getUrl()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -396,23 +417,6 @@ public _FinalStage maxTokens(Optional maxTokens) { return this; } - /** - *

      These are the options for the knowledge base.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -454,6 +458,40 @@ public _FinalStage metadataSendMode(Optional met return this; } + /** + *

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

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

      These are the tools that the assistant can use during the call. To use transient tools, use tools.

      *

      Both tools and toolIds can be used together.

      @@ -513,11 +551,12 @@ public CustomLlmModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, metadataSendMode, url, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/CustomMessage.java b/src/main/java/com/vapi/api/types/CustomMessage.java new file mode 100644 index 0000000..5fd99fb --- /dev/null +++ b/src/main/java/com/vapi/api/types/CustomMessage.java @@ -0,0 +1,139 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomMessage.Builder.class) +public final class CustomMessage { + private final Optional> contents; + + private final Optional content; + + private final Map additionalProperties; + + private CustomMessage( + Optional> contents, Optional content, Map additionalProperties) { + this.contents = contents; + this.content = content; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

      Usage:

      + *
        + *
      • If your assistants are multilingual, you can provide content for each language.
      • + *
      • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
      • + *
      + *

      This will override the content property.

      + */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + + /** + * @return This is a custom message. + */ + @JsonProperty("type") + public String getType() { + return "custom-message"; + } + + /** + * @return This is the content that the assistant will say when this message is triggered. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomMessage && equalTo((CustomMessage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomMessage other) { + return contents.equals(other.contents) && content.equals(other.content); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.contents, this.content); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> contents = Optional.empty(); + + private Optional content = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomMessage other) { + contents(other.getContents()); + content(other.getContent()); + return this; + } + + @JsonSetter(value = "contents", nulls = Nulls.SKIP) + public Builder contents(Optional> contents) { + this.contents = contents; + return this; + } + + public Builder contents(List contents) { + this.contents = Optional.ofNullable(contents); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + public CustomMessage build() { + return new CustomMessage(contents, content, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CustomTranscriber.java b/src/main/java/com/vapi/api/types/CustomTranscriber.java new file mode 100644 index 0000000..8892cfc --- /dev/null +++ b/src/main/java/com/vapi/api/types/CustomTranscriber.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomTranscriber.Builder.class) +public final class CustomTranscriber { + private final Server server; + + private final Map additionalProperties; + + private CustomTranscriber(Server server, Map additionalProperties) { + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is where the transcription request will be sent. + *

      Usage:

      + *
        + *
      1. + *

        Vapi will initiate a websocket connection with server.url.

        + *
      2. + *
      3. + *

        Vapi will send an initial text frame with the sample rate. Format:

        + *
      4. + *
      + *
          {
      +     *       "type": "start",
      +     *       "encoding": "linear16", // 16-bit raw PCM format
      +     *       "container": "raw",
      +     *       "sampleRate": {{sampleRate}},
      +     *       "channels": 2 // customer is channel 0, assistant is channel 1
      +     *     }
      +     * 
      + *
        + *
      1. + *

        Vapi will send the audio data in 16-bit raw PCM format as binary frames.

        + *
      2. + *
      3. + *

        You can read the messages something like this:

        + *
      4. + *
      + *
      ws.on('message', (data, isBinary) => {
      +     *   if (isBinary) {
      +     *     pcmBuffer = Buffer.concat([pcmBuffer, data]);
      +     *     console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`);
      +     *   } else {
      +     *     console.log('Received message:', JSON.parse(data.toString()));
      +     *   }
      +     * });
      +     * 
      + *
        + *
      1. You will respond with transcriptions as you have them. Format:
      2. + *
      + *
       {
      +     *     "type": "transcriber-response",
      +     *     "transcription": "Hello, world!",
      +     *     "channel": "customer" | "assistant"
      +     *  }
      +     * 
      + */ + @JsonProperty("server") + public Server getServer() { + return server; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomTranscriber && equalTo((CustomTranscriber) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomTranscriber other) { + return server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ServerStage builder() { + return new Builder(); + } + + public interface ServerStage { + _FinalStage server(@NotNull Server server); + + Builder from(CustomTranscriber other); + } + + public interface _FinalStage { + CustomTranscriber build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ServerStage, _FinalStage { + private Server server; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CustomTranscriber other) { + server(other.getServer()); + return this; + } + + /** + *

      This is where the transcription request will be sent.

      + *

      Usage:

      + *
        + *
      1. + *

        Vapi will initiate a websocket connection with server.url.

        + *
      2. + *
      3. + *

        Vapi will send an initial text frame with the sample rate. Format:

        + *
      4. + *
      + *
          {
      +         *       "type": "start",
      +         *       "encoding": "linear16", // 16-bit raw PCM format
      +         *       "container": "raw",
      +         *       "sampleRate": {{sampleRate}},
      +         *       "channels": 2 // customer is channel 0, assistant is channel 1
      +         *     }
      +         * 
      + *
        + *
      1. + *

        Vapi will send the audio data in 16-bit raw PCM format as binary frames.

        + *
      2. + *
      3. + *

        You can read the messages something like this:

        + *
      4. + *
      + *
      ws.on('message', (data, isBinary) => {
      +         *   if (isBinary) {
      +         *     pcmBuffer = Buffer.concat([pcmBuffer, data]);
      +         *     console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`);
      +         *   } else {
      +         *     console.log('Received message:', JSON.parse(data.toString()));
      +         *   }
      +         * });
      +         * 
      + *
        + *
      1. You will respond with transcriptions as you have them. Format:
      2. + *
      + *
       {
      +         *     "type": "transcriber-response",
      +         *     "transcription": "Hello, world!",
      +         *     "channel": "customer" | "assistant"
      +         *  }
      +         * 
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("server") + public _FinalStage server(@NotNull Server server) { + this.server = Objects.requireNonNull(server, "server must not be null"); + return this; + } + + @java.lang.Override + public CustomTranscriber build() { + return new CustomTranscriber(server, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CustomVoice.java b/src/main/java/com/vapi/api/types/CustomVoice.java new file mode 100644 index 0000000..8b10e56 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CustomVoice.java @@ -0,0 +1,219 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomVoice.Builder.class) +public final class CustomVoice { + private final Optional chunkPlan; + + private final Server server; + + private final Optional fallbackPlan; + + private final Map additionalProperties; + + private CustomVoice( + Optional chunkPlan, + Server server, + Optional fallbackPlan, + Map additionalProperties) { + this.chunkPlan = chunkPlan; + this.server = server; + this.fallbackPlan = fallbackPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + /** + * @return This is where the voice request will be sent. + *

      Request Example:

      + *

      POST https://{server.url} + * Content-Type: application/json

      + *

      { + * "message": { + * "type": "voice-request", + * "text": "Hello, world!", + * "sampleRate": 24000, + * ...other metadata about the call... + * } + * }

      + *

      Response Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:

      + *
      response.on('data', (chunk: Buffer) => {
      +     *   outputStream.write(chunk);
      +     * });
      +     * 
      + */ + @JsonProperty("server") + public Server getServer() { + return server; + } + + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomVoice && equalTo((CustomVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomVoice other) { + return chunkPlan.equals(other.chunkPlan) + && server.equals(other.server) + && fallbackPlan.equals(other.fallbackPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.chunkPlan, this.server, this.fallbackPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ServerStage builder() { + return new Builder(); + } + + public interface ServerStage { + _FinalStage server(@NotNull Server server); + + Builder from(CustomVoice other); + } + + public interface _FinalStage { + CustomVoice build(); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ServerStage, _FinalStage { + private Server server; + + private Optional fallbackPlan = Optional.empty(); + + private Optional chunkPlan = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CustomVoice other) { + chunkPlan(other.getChunkPlan()); + server(other.getServer()); + fallbackPlan(other.getFallbackPlan()); + return this; + } + + /** + *

      This is where the voice request will be sent.

      + *

      Request Example:

      + *

      POST https://{server.url} + * Content-Type: application/json

      + *

      { + * "message": { + * "type": "voice-request", + * "text": "Hello, world!", + * "sampleRate": 24000, + * ...other metadata about the call... + * } + * }

      + *

      Response Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:

      + *
      response.on('data', (chunk: Buffer) => {
      +         *   outputStream.write(chunk);
      +         * });
      +         * 
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("server") + public _FinalStage server(@NotNull Server server) { + this.server = Objects.requireNonNull(server, "server must not be null"); + return this; + } + + /** + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; + return this; + } + + @java.lang.Override + public CustomVoice build() { + return new CustomVoice(chunkPlan, server, fallbackPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/CustomerCustomEndpointingRule.java b/src/main/java/com/vapi/api/types/CustomerCustomEndpointingRule.java new file mode 100644 index 0000000..ab8d321 --- /dev/null +++ b/src/main/java/com/vapi/api/types/CustomerCustomEndpointingRule.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +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 = CustomerCustomEndpointingRule.Builder.class) +public final class CustomerCustomEndpointingRule { + private final String regex; + + private final Optional> regexOptions; + + private final double timeoutSeconds; + + private final Map additionalProperties; + + private CustomerCustomEndpointingRule( + String regex, + Optional> regexOptions, + double timeoutSeconds, + Map additionalProperties) { + this.regex = regex; + this.regexOptions = regexOptions; + this.timeoutSeconds = timeoutSeconds; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the regex pattern to match. + *

      Note:

      + *
        + *
      • This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
      • + *
      + *

      Hot tip:

      + *
        + *
      • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
      • + *
      • RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, send "^cat$".
      • + *
      + */ + @JsonProperty("regex") + public String getRegex() { + return regex; + } + + /** + * @return These are the options for the regex match. Defaults to all disabled. + *

      @default []

      + */ + @JsonProperty("regexOptions") + public Optional> getRegexOptions() { + return regexOptions; + } + + /** + * @return This is the endpointing timeout in seconds, if the rule is matched. + */ + @JsonProperty("timeoutSeconds") + public double getTimeoutSeconds() { + return timeoutSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomerCustomEndpointingRule && equalTo((CustomerCustomEndpointingRule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomerCustomEndpointingRule other) { + return regex.equals(other.regex) + && regexOptions.equals(other.regexOptions) + && timeoutSeconds == other.timeoutSeconds; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.regex, this.regexOptions, this.timeoutSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RegexStage builder() { + return new Builder(); + } + + public interface RegexStage { + TimeoutSecondsStage regex(@NotNull String regex); + + Builder from(CustomerCustomEndpointingRule other); + } + + public interface TimeoutSecondsStage { + _FinalStage timeoutSeconds(double timeoutSeconds); + } + + public interface _FinalStage { + CustomerCustomEndpointingRule build(); + + _FinalStage regexOptions(Optional> regexOptions); + + _FinalStage regexOptions(List regexOptions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RegexStage, TimeoutSecondsStage, _FinalStage { + private String regex; + + private double timeoutSeconds; + + private Optional> regexOptions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CustomerCustomEndpointingRule other) { + regex(other.getRegex()); + regexOptions(other.getRegexOptions()); + timeoutSeconds(other.getTimeoutSeconds()); + return this; + } + + /** + *

      This is the regex pattern to match.

      + *

      Note:

      + *
        + *
      • This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
      • + *
      + *

      Hot tip:

      + *
        + *
      • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
      • + *
      • RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, send "^cat$".
      • + *
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("regex") + public TimeoutSecondsStage regex(@NotNull String regex) { + this.regex = Objects.requireNonNull(regex, "regex must not be null"); + return this; + } + + /** + *

      This is the endpointing timeout in seconds, if the rule is matched.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("timeoutSeconds") + public _FinalStage timeoutSeconds(double timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + *

      These are the options for the regex match. Defaults to all disabled.

      + *

      @default []

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage regexOptions(List regexOptions) { + this.regexOptions = Optional.ofNullable(regexOptions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "regexOptions", nulls = Nulls.SKIP) + public _FinalStage regexOptions(Optional> regexOptions) { + this.regexOptions = regexOptions; + return this; + } + + @java.lang.Override + public CustomerCustomEndpointingRule build() { + return new CustomerCustomEndpointingRule(regex, regexOptions, timeoutSeconds, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/DeepInfraCredential.java b/src/main/java/com/vapi/api/types/DeepInfraCredential.java index 57793c4..17c39d8 100644 --- a/src/main/java/com/vapi/api/types/DeepInfraCredential.java +++ b/src/main/java/com/vapi/api/types/DeepInfraCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class DeepInfraCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private DeepInfraCredential( @@ -38,12 +42,14 @@ private DeepInfraCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(DeepInfraCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { DeepInfraCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(DeepInfraCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public DeepInfraCredential build() { - return new DeepInfraCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new DeepInfraCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/DeepInfraModel.java b/src/main/java/com/vapi/api/types/DeepInfraModel.java index 945a5e3..76b09da 100644 --- a/src/main/java/com/vapi/api/types/DeepInfraModel.java +++ b/src/main/java/com/vapi/api/types/DeepInfraModel.java @@ -28,12 +28,14 @@ public final class DeepInfraModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final String model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private DeepInfraModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private DeepInfraModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(DeepInfraModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(DeepInfraModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

      These are the options for the knowledge base.

      + *

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

      + *

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public DeepInfraModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/DeepgramCredential.java b/src/main/java/com/vapi/api/types/DeepgramCredential.java index 62fbe36..5cf1c71 100644 --- a/src/main/java/com/vapi/api/types/DeepgramCredential.java +++ b/src/main/java/com/vapi/api/types/DeepgramCredential.java @@ -32,6 +32,8 @@ public final class DeepgramCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Optional apiUrl; private final Map additionalProperties; @@ -42,6 +44,7 @@ private DeepgramCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Optional apiUrl, Map additionalProperties) { this.apiKey = apiKey; @@ -49,6 +52,7 @@ private DeepgramCredential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.apiUrl = apiUrl; this.additionalProperties = additionalProperties; } @@ -98,6 +102,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + /** * @return This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com. */ @@ -123,12 +135,13 @@ private boolean equalTo(DeepgramCredential other) { && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) + && name.equals(other.name) && apiUrl.equals(other.apiUrl); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.apiUrl); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name, this.apiUrl); } @java.lang.Override @@ -165,6 +178,10 @@ public interface UpdatedAtStage { public interface _FinalStage { DeepgramCredential build(); + _FinalStage name(Optional name); + + _FinalStage name(String name); + _FinalStage apiUrl(Optional apiUrl); _FinalStage apiUrl(String apiUrl); @@ -185,6 +202,8 @@ public static final class Builder private Optional apiUrl = Optional.empty(); + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -197,6 +216,7 @@ public Builder from(DeepgramCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); apiUrl(other.getApiUrl()); return this; } @@ -273,9 +293,26 @@ public _FinalStage apiUrl(Optional apiUrl) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public DeepgramCredential build() { - return new DeepgramCredential(apiKey, id, orgId, createdAt, updatedAt, apiUrl, additionalProperties); + return new DeepgramCredential(apiKey, id, orgId, createdAt, updatedAt, name, apiUrl, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/DeepgramTranscriber.java b/src/main/java/com/vapi/api/types/DeepgramTranscriber.java index 0aa6d11..2666655 100644 --- a/src/main/java/com/vapi/api/types/DeepgramTranscriber.java +++ b/src/main/java/com/vapi/api/types/DeepgramTranscriber.java @@ -27,7 +27,7 @@ public final class DeepgramTranscriber { private final Optional smartFormat; - private final Optional languageDetectionEnabled; + private final Optional codeSwitchingEnabled; private final Optional> keywords; @@ -39,14 +39,14 @@ private DeepgramTranscriber( Optional model, Optional language, Optional smartFormat, - Optional languageDetectionEnabled, + Optional codeSwitchingEnabled, Optional> keywords, Optional endpointing, Map additionalProperties) { this.model = model; this.language = language; this.smartFormat = smartFormat; - this.languageDetectionEnabled = languageDetectionEnabled; + this.codeSwitchingEnabled = codeSwitchingEnabled; this.keywords = keywords; this.endpointing = endpointing; this.additionalProperties = additionalProperties; @@ -77,11 +77,45 @@ public Optional getSmartFormat() { } /** - * @return This enables or disables language detection. If true, swaps transcribers to detected language automatically. Defaults to false. + * @return This automatically switches the transcriber's language when the customer's language changes. Defaults to false. + *

      Usage:

      + *
        + *
      • If your customers switch languages mid-call, you can set this to true.
      • + *
      + *

      Note:

      + *
        + *
      • To detect language changes, Vapi uses a custom trained model. Languages supported (X = limited support): + *
          + *
        1. Arabic
        2. + *
        3. Bengali
        4. + *
        5. Cantonese
        6. + *
        7. Chinese
        8. + *
        9. Chinese Simplified (X)
        10. + *
        11. Chinese Traditional (X)
        12. + *
        13. English
        14. + *
        15. Farsi (X)
        16. + *
        17. French
        18. + *
        19. German
        20. + *
        21. Haitian Creole (X)
        22. + *
        23. Hindi
        24. + *
        25. Italian
        26. + *
        27. Japanese
        28. + *
        29. Korean
        30. + *
        31. Portuguese
        32. + *
        33. Russian
        34. + *
        35. Spanish
        36. + *
        37. Thai
        38. + *
        39. Urdu
        40. + *
        41. Vietnamese
        42. + *
        + *
      • + *
      • To receive language-change-detected webhook events, add it to assistant.serverMessages.
      • + *
      + *

      @default false

      */ - @JsonProperty("languageDetectionEnabled") - public Optional getLanguageDetectionEnabled() { - return languageDetectionEnabled; + @JsonProperty("codeSwitchingEnabled") + public Optional getCodeSwitchingEnabled() { + return codeSwitchingEnabled; } /** @@ -122,7 +156,7 @@ private boolean equalTo(DeepgramTranscriber other) { return model.equals(other.model) && language.equals(other.language) && smartFormat.equals(other.smartFormat) - && languageDetectionEnabled.equals(other.languageDetectionEnabled) + && codeSwitchingEnabled.equals(other.codeSwitchingEnabled) && keywords.equals(other.keywords) && endpointing.equals(other.endpointing); } @@ -133,7 +167,7 @@ public int hashCode() { this.model, this.language, this.smartFormat, - this.languageDetectionEnabled, + this.codeSwitchingEnabled, this.keywords, this.endpointing); } @@ -155,7 +189,7 @@ public static final class Builder { private Optional smartFormat = Optional.empty(); - private Optional languageDetectionEnabled = Optional.empty(); + private Optional codeSwitchingEnabled = Optional.empty(); private Optional> keywords = Optional.empty(); @@ -170,7 +204,7 @@ public Builder from(DeepgramTranscriber other) { model(other.getModel()); language(other.getLanguage()); smartFormat(other.getSmartFormat()); - languageDetectionEnabled(other.getLanguageDetectionEnabled()); + codeSwitchingEnabled(other.getCodeSwitchingEnabled()); keywords(other.getKeywords()); endpointing(other.getEndpointing()); return this; @@ -209,14 +243,14 @@ public Builder smartFormat(Boolean smartFormat) { return this; } - @JsonSetter(value = "languageDetectionEnabled", nulls = Nulls.SKIP) - public Builder languageDetectionEnabled(Optional languageDetectionEnabled) { - this.languageDetectionEnabled = languageDetectionEnabled; + @JsonSetter(value = "codeSwitchingEnabled", nulls = Nulls.SKIP) + public Builder codeSwitchingEnabled(Optional codeSwitchingEnabled) { + this.codeSwitchingEnabled = codeSwitchingEnabled; return this; } - public Builder languageDetectionEnabled(Boolean languageDetectionEnabled) { - this.languageDetectionEnabled = Optional.ofNullable(languageDetectionEnabled); + public Builder codeSwitchingEnabled(Boolean codeSwitchingEnabled) { + this.codeSwitchingEnabled = Optional.ofNullable(codeSwitchingEnabled); return this; } @@ -244,13 +278,7 @@ public Builder endpointing(Double endpointing) { public DeepgramTranscriber build() { return new DeepgramTranscriber( - model, - language, - smartFormat, - languageDetectionEnabled, - keywords, - endpointing, - additionalProperties); + model, language, smartFormat, codeSwitchingEnabled, keywords, endpointing, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/DeepgramVoice.java b/src/main/java/com/vapi/api/types/DeepgramVoice.java index ecbcc03..1c967dd 100644 --- a/src/main/java/com/vapi/api/types/DeepgramVoice.java +++ b/src/main/java/com/vapi/api/types/DeepgramVoice.java @@ -21,34 +21,25 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DeepgramVoice.Builder.class) public final class DeepgramVoice { - private final Optional fillerInjectionEnabled; - private final DeepgramVoiceId voiceId; private final Optional chunkPlan; + private final Optional fallbackPlan; + private final Map additionalProperties; private DeepgramVoice( - Optional fillerInjectionEnabled, DeepgramVoiceId voiceId, Optional chunkPlan, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.chunkPlan = chunkPlan; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. */ @@ -65,6 +56,14 @@ public Optional getChunkPlan() { return chunkPlan; } + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +76,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(DeepgramVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) - && chunkPlan.equals(other.chunkPlan); + return voiceId.equals(other.voiceId) + && chunkPlan.equals(other.chunkPlan) + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.voiceId, this.chunkPlan); + return Objects.hash(this.voiceId, this.chunkPlan, this.fallbackPlan); } @java.lang.Override @@ -105,22 +104,22 @@ public interface VoiceIdStage { public interface _FinalStage { DeepgramVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private DeepgramVoiceId voiceId; - private Optional chunkPlan = Optional.empty(); + private Optional fallbackPlan = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); + private Optional chunkPlan = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -129,9 +128,9 @@ private Builder() {} @java.lang.Override public Builder from(DeepgramVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); chunkPlan(other.getChunkPlan()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -147,43 +146,42 @@ public _FinalStage voiceId(@NotNull DeepgramVoiceId voiceId) { } /** - *

      This is the plan for chunking the model output before it is sent to the voice provider.

      + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      + *

      This is the plan for chunking the model output before it is sent to the voice provider.

      * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); return this; } @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; return this; } @java.lang.Override public DeepgramVoice build() { - return new DeepgramVoice(fillerInjectionEnabled, voiceId, chunkPlan, additionalProperties); + return new DeepgramVoice(voiceId, chunkPlan, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ElevenLabsCredential.java b/src/main/java/com/vapi/api/types/ElevenLabsCredential.java index 629ddc9..b26685f 100644 --- a/src/main/java/com/vapi/api/types/ElevenLabsCredential.java +++ b/src/main/java/com/vapi/api/types/ElevenLabsCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class ElevenLabsCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private ElevenLabsCredential( @@ -38,12 +42,14 @@ private ElevenLabsCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(ElevenLabsCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { ElevenLabsCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(ElevenLabsCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public ElevenLabsCredential build() { - return new ElevenLabsCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new ElevenLabsCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ElevenLabsVoice.java b/src/main/java/com/vapi/api/types/ElevenLabsVoice.java index 7998c60..5468432 100644 --- a/src/main/java/com/vapi/api/types/ElevenLabsVoice.java +++ b/src/main/java/com/vapi/api/types/ElevenLabsVoice.java @@ -21,8 +21,6 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ElevenLabsVoice.Builder.class) public final class ElevenLabsVoice { - private final Optional fillerInjectionEnabled; - private final ElevenLabsVoiceId voiceId; private final Optional stability; @@ -39,14 +37,15 @@ public final class ElevenLabsVoice { private final Optional model; + private final Optional chunkPlan; + private final Optional language; - private final Optional chunkPlan; + private final Optional fallbackPlan; private final Map additionalProperties; private ElevenLabsVoice( - Optional fillerInjectionEnabled, ElevenLabsVoiceId voiceId, Optional stability, Optional similarityBoost, @@ -55,10 +54,10 @@ private ElevenLabsVoice( Optional optimizeStreamingLatency, Optional enableSsmlParsing, Optional model, - Optional language, Optional chunkPlan, + Optional language, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.stability = stability; this.similarityBoost = similarityBoost; @@ -67,20 +66,12 @@ private ElevenLabsVoice( this.optimizeStreamingLatency = optimizeStreamingLatency; this.enableSsmlParsing = enableSsmlParsing; this.model = model; - this.language = language; this.chunkPlan = chunkPlan; + this.language = language; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library. */ @@ -146,6 +137,14 @@ public Optional getModel() { return model; } + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + /** * @return This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided. */ @@ -155,11 +154,11 @@ public Optional getLanguage() { } /** - * @return This is the plan for chunking the model output before it is sent to the voice provider. + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. */ - @JsonProperty("chunkPlan") - public Optional getChunkPlan() { - return chunkPlan; + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; } @java.lang.Override @@ -174,8 +173,7 @@ public Map getAdditionalProperties() { } private boolean equalTo(ElevenLabsVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) + return voiceId.equals(other.voiceId) && stability.equals(other.stability) && similarityBoost.equals(other.similarityBoost) && style.equals(other.style) @@ -183,14 +181,14 @@ private boolean equalTo(ElevenLabsVoice other) { && optimizeStreamingLatency.equals(other.optimizeStreamingLatency) && enableSsmlParsing.equals(other.enableSsmlParsing) && model.equals(other.model) + && chunkPlan.equals(other.chunkPlan) && language.equals(other.language) - && chunkPlan.equals(other.chunkPlan); + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { return Objects.hash( - this.fillerInjectionEnabled, this.voiceId, this.stability, this.similarityBoost, @@ -199,8 +197,9 @@ public int hashCode() { this.optimizeStreamingLatency, this.enableSsmlParsing, this.model, + this.chunkPlan, this.language, - this.chunkPlan); + this.fallbackPlan); } @java.lang.Override @@ -221,10 +220,6 @@ public interface VoiceIdStage { public interface _FinalStage { ElevenLabsVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage stability(Optional stability); _FinalStage stability(Double stability); @@ -253,23 +248,29 @@ public interface _FinalStage { _FinalStage model(ElevenLabsVoiceModel model); + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + _FinalStage language(Optional language); _FinalStage language(String language); - _FinalStage chunkPlan(Optional chunkPlan); + _FinalStage fallbackPlan(Optional fallbackPlan); - _FinalStage chunkPlan(ChunkPlan chunkPlan); + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private ElevenLabsVoiceId voiceId; - private Optional chunkPlan = Optional.empty(); + private Optional fallbackPlan = Optional.empty(); private Optional language = Optional.empty(); + private Optional chunkPlan = Optional.empty(); + private Optional model = Optional.empty(); private Optional enableSsmlParsing = Optional.empty(); @@ -284,8 +285,6 @@ public static final class Builder implements VoiceIdStage, _FinalStage { private Optional stability = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -293,7 +292,6 @@ private Builder() {} @java.lang.Override public Builder from(ElevenLabsVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); stability(other.getStability()); similarityBoost(other.getSimilarityBoost()); @@ -302,8 +300,9 @@ public Builder from(ElevenLabsVoice other) { optimizeStreamingLatency(other.getOptimizeStreamingLatency()); enableSsmlParsing(other.getEnableSsmlParsing()); model(other.getModel()); - language(other.getLanguage()); chunkPlan(other.getChunkPlan()); + language(other.getLanguage()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -319,19 +318,19 @@ public _FinalStage voiceId(@NotNull ElevenLabsVoiceId voiceId) { } /** - *

      This is the plan for chunking the model output before it is sent to the voice provider.

      + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

      * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage chunkPlan(ChunkPlan chunkPlan) { - this.chunkPlan = Optional.ofNullable(chunkPlan); + public _FinalStage fallbackPlan(FallbackPlan fallbackPlan) { + this.fallbackPlan = Optional.ofNullable(fallbackPlan); return this; } @java.lang.Override - @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) - public _FinalStage chunkPlan(Optional chunkPlan) { - this.chunkPlan = chunkPlan; + @JsonSetter(value = "fallbackPlan", nulls = Nulls.SKIP) + public _FinalStage fallbackPlan(Optional fallbackPlan) { + this.fallbackPlan = fallbackPlan; return this; } @@ -352,6 +351,23 @@ public _FinalStage language(Optional language) { return this; } + /** + *

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -472,28 +488,9 @@ public _FinalStage stability(Optional stability) { return this; } - /** - *

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; - return this; - } - @java.lang.Override public ElevenLabsVoice build() { return new ElevenLabsVoice( - fillerInjectionEnabled, voiceId, stability, similarityBoost, @@ -502,8 +499,9 @@ public ElevenLabsVoice build() { optimizeStreamingLatency, enableSsmlParsing, model, - language, chunkPlan, + language, + fallbackPlan, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/FallbackAzureVoice.java b/src/main/java/com/vapi/api/types/FallbackAzureVoice.java new file mode 100644 index 0000000..d019a19 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackAzureVoice.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackAzureVoice.Builder.class) +public final class FallbackAzureVoice { + private final FallbackAzureVoiceId voiceId; + + private final Optional speed; + + private final Optional chunkPlan; + + private final Optional oneOf; + + private final Map additionalProperties; + + private FallbackAzureVoice( + FallbackAzureVoiceId voiceId, + Optional speed, + Optional chunkPlan, + Optional oneOf, + Map additionalProperties) { + this.voiceId = voiceId; + this.speed = speed; + this.chunkPlan = chunkPlan; + this.oneOf = oneOf; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackAzureVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the speed multiplier that will be used. + */ + @JsonProperty("speed") + public Optional getSpeed() { + return speed; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @JsonProperty("oneOf") + public Optional getOneOf() { + return oneOf; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackAzureVoice && equalTo((FallbackAzureVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackAzureVoice other) { + return voiceId.equals(other.voiceId) + && speed.equals(other.speed) + && chunkPlan.equals(other.chunkPlan) + && oneOf.equals(other.oneOf); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voiceId, this.speed, this.chunkPlan, this.oneOf); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackAzureVoiceId voiceId); + + Builder from(FallbackAzureVoice other); + } + + public interface _FinalStage { + FallbackAzureVoice build(); + + _FinalStage speed(Optional speed); + + _FinalStage speed(Double speed); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage oneOf(Optional oneOf); + + _FinalStage oneOf(Object oneOf); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackAzureVoiceId voiceId; + + private Optional oneOf = Optional.empty(); + + private Optional chunkPlan = Optional.empty(); + + private Optional speed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackAzureVoice other) { + voiceId(other.getVoiceId()); + speed(other.getSpeed()); + chunkPlan(other.getChunkPlan()); + oneOf(other.getOneOf()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("voiceId") + public _FinalStage voiceId(@NotNull FallbackAzureVoiceId voiceId) { + this.voiceId = Objects.requireNonNull(voiceId, "voiceId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage oneOf(Object oneOf) { + this.oneOf = Optional.ofNullable(oneOf); + return this; + } + + @java.lang.Override + @JsonSetter(value = "oneOf", nulls = Nulls.SKIP) + public _FinalStage oneOf(Optional oneOf) { + this.oneOf = oneOf; + return this; + } + + /** + *

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the speed multiplier that will be used.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage speed(Double speed) { + this.speed = Optional.ofNullable(speed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "speed", nulls = Nulls.SKIP) + public _FinalStage speed(Optional speed) { + this.speed = speed; + return this; + } + + @java.lang.Override + public FallbackAzureVoice build() { + return new FallbackAzureVoice(voiceId, speed, chunkPlan, oneOf, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackAzureVoiceId.java b/src/main/java/com/vapi/api/types/FallbackAzureVoiceId.java new file mode 100644 index 0000000..e25834a --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackAzureVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackAzureVoiceId.Deserializer.class) +public final class FallbackAzureVoiceId { + private final Object value; + + private final int type; + + private FallbackAzureVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackAzureVoiceVoiceId) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackAzureVoiceId && equalTo((FallbackAzureVoiceId) other); + } + + private boolean equalTo(FallbackAzureVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackAzureVoiceId of(FallbackAzureVoiceVoiceId value) { + return new FallbackAzureVoiceId(value, 0); + } + + public static FallbackAzureVoiceId of(String value) { + return new FallbackAzureVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackAzureVoiceVoiceId value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackAzureVoiceId.class); + } + + @java.lang.Override + public FallbackAzureVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackAzureVoiceVoiceId.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackAzureVoiceVoiceId.java b/src/main/java/com/vapi/api/types/FallbackAzureVoiceVoiceId.java new file mode 100644 index 0000000..283208c --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackAzureVoiceVoiceId.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackAzureVoiceVoiceId { + ANDREW("andrew"), + + BRIAN("brian"), + + EMMA("emma"); + + private final String value; + + FallbackAzureVoiceVoiceId(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackCartesiaVoice.java b/src/main/java/com/vapi/api/types/FallbackCartesiaVoice.java new file mode 100644 index 0000000..60b746a --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackCartesiaVoice.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackCartesiaVoice.Builder.class) +public final class FallbackCartesiaVoice { + private final Optional model; + + private final Optional language; + + private final String voiceId; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackCartesiaVoice( + Optional model, + Optional language, + String voiceId, + Optional chunkPlan, + Map additionalProperties) { + this.model = model; + this.language = language; + this.voiceId = voiceId; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the model that will be used. This is optional and will default to the correct model for the voiceId. + */ + @JsonProperty("model") + public Optional getModel() { + return model; + } + + /** + * @return This is the language that will be used. This is optional and will default to the correct language for the voiceId. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public String getVoiceId() { + return voiceId; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackCartesiaVoice && equalTo((FallbackCartesiaVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackCartesiaVoice other) { + return model.equals(other.model) + && language.equals(other.language) + && voiceId.equals(other.voiceId) + && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.language, this.voiceId, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull String voiceId); + + Builder from(FallbackCartesiaVoice other); + } + + public interface _FinalStage { + FallbackCartesiaVoice build(); + + _FinalStage model(Optional model); + + _FinalStage model(FallbackCartesiaVoiceModel model); + + _FinalStage language(Optional language); + + _FinalStage language(FallbackCartesiaVoiceLanguage language); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private String voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional model = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackCartesiaVoice other) { + model(other.getModel()); + language(other.getLanguage()); + voiceId(other.getVoiceId()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the language that will be used. This is optional and will default to the correct language for the voiceId.

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

      This is the model that will be used. This is optional and will default to the correct model for the voiceId.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage model(FallbackCartesiaVoiceModel model) { + this.model = Optional.ofNullable(model); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model", nulls = Nulls.SKIP) + public _FinalStage model(Optional model) { + this.model = model; + return this; + } + + @java.lang.Override + public FallbackCartesiaVoice build() { + return new FallbackCartesiaVoice(model, language, voiceId, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackCartesiaVoiceLanguage.java b/src/main/java/com/vapi/api/types/FallbackCartesiaVoiceLanguage.java new file mode 100644 index 0000000..e7d99f0 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackCartesiaVoiceLanguage.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackCartesiaVoiceLanguage { + EN("en"), + + DE("de"), + + ES("es"), + + FR("fr"), + + JA("ja"), + + PT("pt"), + + ZH("zh"), + + HI("hi"), + + IT("it"), + + KO("ko"), + + NL("nl"), + + PL("pl"), + + RU("ru"), + + SV("sv"), + + TR("tr"); + + private final String value; + + FallbackCartesiaVoiceLanguage(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackCartesiaVoiceModel.java b/src/main/java/com/vapi/api/types/FallbackCartesiaVoiceModel.java new file mode 100644 index 0000000..0feaac8 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackCartesiaVoiceModel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackCartesiaVoiceModel { + SONIC_ENGLISH("sonic-english"), + + SONIC_MULTILINGUAL("sonic-multilingual"); + + private final String value; + + FallbackCartesiaVoiceModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackCustomVoice.java b/src/main/java/com/vapi/api/types/FallbackCustomVoice.java new file mode 100644 index 0000000..29ba4d0 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackCustomVoice.java @@ -0,0 +1,179 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackCustomVoice.Builder.class) +public final class FallbackCustomVoice { + private final Server server; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackCustomVoice( + Server server, Optional chunkPlan, Map additionalProperties) { + this.server = server; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is where the voice request will be sent. + *

      Request Example:

      + *

      POST https://{server.url} + * Content-Type: application/json

      + *

      { + * "message": { + * "type": "voice-request", + * "text": "Hello, world!", + * "sampleRate": 24000, + * ...other metadata about the call... + * } + * }

      + *

      Response Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:

      + *
      response.on('data', (chunk: Buffer) => {
      +     *   outputStream.write(chunk);
      +     * });
      +     * 
      + */ + @JsonProperty("server") + public Server getServer() { + return server; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackCustomVoice && equalTo((FallbackCustomVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackCustomVoice other) { + return server.equals(other.server) && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.server, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ServerStage builder() { + return new Builder(); + } + + public interface ServerStage { + _FinalStage server(@NotNull Server server); + + Builder from(FallbackCustomVoice other); + } + + public interface _FinalStage { + FallbackCustomVoice build(); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ServerStage, _FinalStage { + private Server server; + + private Optional chunkPlan = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackCustomVoice other) { + server(other.getServer()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is where the voice request will be sent.

      + *

      Request Example:

      + *

      POST https://{server.url} + * Content-Type: application/json

      + *

      { + * "message": { + * "type": "voice-request", + * "text": "Hello, world!", + * "sampleRate": 24000, + * ...other metadata about the call... + * } + * }

      + *

      Response Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:

      + *
      response.on('data', (chunk: Buffer) => {
      +         *   outputStream.write(chunk);
      +         * });
      +         * 
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("server") + public _FinalStage server(@NotNull Server server) { + this.server = Objects.requireNonNull(server, "server must not be null"); + return this; + } + + /** + *

      This is the plan for chunking the model output before it is sent to the voice provider.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; + return this; + } + + @java.lang.Override + public FallbackCustomVoice build() { + return new FallbackCustomVoice(server, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackDeepgramVoice.java b/src/main/java/com/vapi/api/types/FallbackDeepgramVoice.java new file mode 100644 index 0000000..3d53ba3 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackDeepgramVoice.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackDeepgramVoice.Builder.class) +public final class FallbackDeepgramVoice { + private final FallbackDeepgramVoiceId voiceId; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackDeepgramVoice( + FallbackDeepgramVoiceId voiceId, Optional chunkPlan, Map additionalProperties) { + this.voiceId = voiceId; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackDeepgramVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackDeepgramVoice && equalTo((FallbackDeepgramVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackDeepgramVoice other) { + return voiceId.equals(other.voiceId) && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voiceId, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackDeepgramVoiceId voiceId); + + Builder from(FallbackDeepgramVoice other); + } + + public interface _FinalStage { + FallbackDeepgramVoice build(); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackDeepgramVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackDeepgramVoice other) { + voiceId(other.getVoiceId()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; + return this; + } + + @java.lang.Override + public FallbackDeepgramVoice build() { + return new FallbackDeepgramVoice(voiceId, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackDeepgramVoiceId.java b/src/main/java/com/vapi/api/types/FallbackDeepgramVoiceId.java new file mode 100644 index 0000000..b740390 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackDeepgramVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackDeepgramVoiceId.Deserializer.class) +public final class FallbackDeepgramVoiceId { + private final Object value; + + private final int type; + + private FallbackDeepgramVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackDeepgramVoiceIdEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackDeepgramVoiceId && equalTo((FallbackDeepgramVoiceId) other); + } + + private boolean equalTo(FallbackDeepgramVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackDeepgramVoiceId of(FallbackDeepgramVoiceIdEnum value) { + return new FallbackDeepgramVoiceId(value, 0); + } + + public static FallbackDeepgramVoiceId of(String value) { + return new FallbackDeepgramVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackDeepgramVoiceIdEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackDeepgramVoiceId.class); + } + + @java.lang.Override + public FallbackDeepgramVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackDeepgramVoiceIdEnum.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackDeepgramVoiceIdEnum.java b/src/main/java/com/vapi/api/types/FallbackDeepgramVoiceIdEnum.java new file mode 100644 index 0000000..cbf7839 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackDeepgramVoiceIdEnum.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackDeepgramVoiceIdEnum { + ASTERIA("asteria"), + + LUNA("luna"), + + STELLA("stella"), + + ATHENA("athena"), + + HERA("hera"), + + ORION("orion"), + + ARCAS("arcas"), + + PERSEUS("perseus"), + + ANGUS("angus"), + + ORPHEUS("orpheus"), + + HELIOS("helios"), + + ZEUS("zeus"); + + private final String value; + + FallbackDeepgramVoiceIdEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackElevenLabsVoice.java b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoice.java new file mode 100644 index 0000000..d7fabbf --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoice.java @@ -0,0 +1,469 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackElevenLabsVoice.Builder.class) +public final class FallbackElevenLabsVoice { + private final FallbackElevenLabsVoiceId voiceId; + + private final Optional stability; + + private final Optional similarityBoost; + + private final Optional style; + + private final Optional useSpeakerBoost; + + private final Optional optimizeStreamingLatency; + + private final Optional enableSsmlParsing; + + private final Optional model; + + private final Optional language; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackElevenLabsVoice( + FallbackElevenLabsVoiceId voiceId, + Optional stability, + Optional similarityBoost, + Optional style, + Optional useSpeakerBoost, + Optional optimizeStreamingLatency, + Optional enableSsmlParsing, + Optional model, + Optional language, + Optional chunkPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.stability = stability; + this.similarityBoost = similarityBoost; + this.style = style; + this.useSpeakerBoost = useSpeakerBoost; + this.optimizeStreamingLatency = optimizeStreamingLatency; + this.enableSsmlParsing = enableSsmlParsing; + this.model = model; + this.language = language; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library. + */ + @JsonProperty("voiceId") + public FallbackElevenLabsVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return Defines the stability for voice settings. + */ + @JsonProperty("stability") + public Optional getStability() { + return stability; + } + + /** + * @return Defines the similarity boost for voice settings. + */ + @JsonProperty("similarityBoost") + public Optional getSimilarityBoost() { + return similarityBoost; + } + + /** + * @return Defines the style for voice settings. + */ + @JsonProperty("style") + public Optional getStyle() { + return style; + } + + /** + * @return Defines the use speaker boost for voice settings. + */ + @JsonProperty("useSpeakerBoost") + public Optional getUseSpeakerBoost() { + return useSpeakerBoost; + } + + /** + * @return Defines the optimize streaming latency for voice settings. Defaults to 3. + */ + @JsonProperty("optimizeStreamingLatency") + public Optional getOptimizeStreamingLatency() { + return optimizeStreamingLatency; + } + + /** + * @return This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency. + *

      @default false

      + */ + @JsonProperty("enableSsmlParsing") + public Optional getEnableSsmlParsing() { + return enableSsmlParsing; + } + + /** + * @return This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified. + */ + @JsonProperty("model") + public Optional getModel() { + return model; + } + + /** + * @return This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackElevenLabsVoice && equalTo((FallbackElevenLabsVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackElevenLabsVoice other) { + return voiceId.equals(other.voiceId) + && stability.equals(other.stability) + && similarityBoost.equals(other.similarityBoost) + && style.equals(other.style) + && useSpeakerBoost.equals(other.useSpeakerBoost) + && optimizeStreamingLatency.equals(other.optimizeStreamingLatency) + && enableSsmlParsing.equals(other.enableSsmlParsing) + && model.equals(other.model) + && language.equals(other.language) + && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.voiceId, + this.stability, + this.similarityBoost, + this.style, + this.useSpeakerBoost, + this.optimizeStreamingLatency, + this.enableSsmlParsing, + this.model, + this.language, + this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackElevenLabsVoiceId voiceId); + + Builder from(FallbackElevenLabsVoice other); + } + + public interface _FinalStage { + FallbackElevenLabsVoice build(); + + _FinalStage stability(Optional stability); + + _FinalStage stability(Double stability); + + _FinalStage similarityBoost(Optional similarityBoost); + + _FinalStage similarityBoost(Double similarityBoost); + + _FinalStage style(Optional style); + + _FinalStage style(Double style); + + _FinalStage useSpeakerBoost(Optional useSpeakerBoost); + + _FinalStage useSpeakerBoost(Boolean useSpeakerBoost); + + _FinalStage optimizeStreamingLatency(Optional optimizeStreamingLatency); + + _FinalStage optimizeStreamingLatency(Double optimizeStreamingLatency); + + _FinalStage enableSsmlParsing(Optional enableSsmlParsing); + + _FinalStage enableSsmlParsing(Boolean enableSsmlParsing); + + _FinalStage model(Optional model); + + _FinalStage model(FallbackElevenLabsVoiceModel model); + + _FinalStage language(Optional language); + + _FinalStage language(String language); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackElevenLabsVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional model = Optional.empty(); + + private Optional enableSsmlParsing = Optional.empty(); + + private Optional optimizeStreamingLatency = Optional.empty(); + + private Optional useSpeakerBoost = Optional.empty(); + + private Optional style = Optional.empty(); + + private Optional similarityBoost = Optional.empty(); + + private Optional stability = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackElevenLabsVoice other) { + voiceId(other.getVoiceId()); + stability(other.getStability()); + similarityBoost(other.getSimilarityBoost()); + style(other.getStyle()); + useSpeakerBoost(other.getUseSpeakerBoost()); + optimizeStreamingLatency(other.getOptimizeStreamingLatency()); + enableSsmlParsing(other.getEnableSsmlParsing()); + model(other.getModel()); + language(other.getLanguage()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided.

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

      This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified.

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

      This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency.

      + *

      @default false

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

      Defines the optimize streaming latency for voice settings. Defaults to 3.

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

      Defines the use speaker boost for voice settings.

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

      Defines the style for voice settings.

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

      Defines the similarity boost for voice settings.

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

      Defines the stability for voice settings.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage stability(Double stability) { + this.stability = Optional.ofNullable(stability); + return this; + } + + @java.lang.Override + @JsonSetter(value = "stability", nulls = Nulls.SKIP) + public _FinalStage stability(Optional stability) { + this.stability = stability; + return this; + } + + @java.lang.Override + public FallbackElevenLabsVoice build() { + return new FallbackElevenLabsVoice( + voiceId, + stability, + similarityBoost, + style, + useSpeakerBoost, + optimizeStreamingLatency, + enableSsmlParsing, + model, + language, + chunkPlan, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceId.java b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceId.java new file mode 100644 index 0000000..ccdd96f --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackElevenLabsVoiceId.Deserializer.class) +public final class FallbackElevenLabsVoiceId { + private final Object value; + + private final int type; + + private FallbackElevenLabsVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackElevenLabsVoiceIdEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackElevenLabsVoiceId && equalTo((FallbackElevenLabsVoiceId) other); + } + + private boolean equalTo(FallbackElevenLabsVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackElevenLabsVoiceId of(FallbackElevenLabsVoiceIdEnum value) { + return new FallbackElevenLabsVoiceId(value, 0); + } + + public static FallbackElevenLabsVoiceId of(String value) { + return new FallbackElevenLabsVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackElevenLabsVoiceIdEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackElevenLabsVoiceId.class); + } + + @java.lang.Override + public FallbackElevenLabsVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackElevenLabsVoiceIdEnum.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceIdEnum.java b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceIdEnum.java new file mode 100644 index 0000000..e4c8bc9 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceIdEnum.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackElevenLabsVoiceIdEnum { + BURT("burt"), + + MARISSA("marissa"), + + ANDREA("andrea"), + + SARAH("sarah"), + + PHILLIP("phillip"), + + STEVE("steve"), + + JOSEPH("joseph"), + + MYRA("myra"), + + PAULA("paula"), + + RYAN("ryan"), + + DREW("drew"), + + PAUL("paul"), + + MRB("mrb"), + + MATILDA("matilda"), + + MARK("mark"); + + private final String value; + + FallbackElevenLabsVoiceIdEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceModel.java b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceModel.java new file mode 100644 index 0000000..fe5a042 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackElevenLabsVoiceModel.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackElevenLabsVoiceModel { + ELEVEN_MULTILINGUAL_V_2("eleven_multilingual_v2"), + + ELEVEN_TURBO_V_2("eleven_turbo_v2"), + + ELEVEN_TURBO_V_2_5("eleven_turbo_v2_5"), + + ELEVEN_MONOLINGUAL_V_1("eleven_monolingual_v1"); + + private final String value; + + FallbackElevenLabsVoiceModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackLmntVoice.java b/src/main/java/com/vapi/api/types/FallbackLmntVoice.java new file mode 100644 index 0000000..55c53e6 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackLmntVoice.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackLmntVoice.Builder.class) +public final class FallbackLmntVoice { + private final FallbackLmntVoiceId voiceId; + + private final Optional speed; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackLmntVoice( + FallbackLmntVoiceId voiceId, + Optional speed, + Optional chunkPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.speed = speed; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackLmntVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the speed multiplier that will be used. + */ + @JsonProperty("speed") + public Optional getSpeed() { + return speed; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackLmntVoice && equalTo((FallbackLmntVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackLmntVoice other) { + return voiceId.equals(other.voiceId) && speed.equals(other.speed) && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voiceId, this.speed, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackLmntVoiceId voiceId); + + Builder from(FallbackLmntVoice other); + } + + public interface _FinalStage { + FallbackLmntVoice build(); + + _FinalStage speed(Optional speed); + + _FinalStage speed(Double speed); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackLmntVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional speed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackLmntVoice other) { + voiceId(other.getVoiceId()); + speed(other.getSpeed()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the speed multiplier that will be used.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage speed(Double speed) { + this.speed = Optional.ofNullable(speed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "speed", nulls = Nulls.SKIP) + public _FinalStage speed(Optional speed) { + this.speed = speed; + return this; + } + + @java.lang.Override + public FallbackLmntVoice build() { + return new FallbackLmntVoice(voiceId, speed, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackLmntVoiceId.java b/src/main/java/com/vapi/api/types/FallbackLmntVoiceId.java new file mode 100644 index 0000000..63e2204 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackLmntVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackLmntVoiceId.Deserializer.class) +public final class FallbackLmntVoiceId { + private final Object value; + + private final int type; + + private FallbackLmntVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackLmntVoiceIdEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackLmntVoiceId && equalTo((FallbackLmntVoiceId) other); + } + + private boolean equalTo(FallbackLmntVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackLmntVoiceId of(FallbackLmntVoiceIdEnum value) { + return new FallbackLmntVoiceId(value, 0); + } + + public static FallbackLmntVoiceId of(String value) { + return new FallbackLmntVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackLmntVoiceIdEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackLmntVoiceId.class); + } + + @java.lang.Override + public FallbackLmntVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackLmntVoiceIdEnum.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackLmntVoiceIdEnum.java b/src/main/java/com/vapi/api/types/FallbackLmntVoiceIdEnum.java new file mode 100644 index 0000000..add8754 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackLmntVoiceIdEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackLmntVoiceIdEnum { + LILY("lily"), + + DANIEL("daniel"); + + private final String value; + + FallbackLmntVoiceIdEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackNeetsVoice.java b/src/main/java/com/vapi/api/types/FallbackNeetsVoice.java new file mode 100644 index 0000000..8ccce67 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackNeetsVoice.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackNeetsVoice.Builder.class) +public final class FallbackNeetsVoice { + private final FallbackNeetsVoiceId voiceId; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackNeetsVoice( + FallbackNeetsVoiceId voiceId, Optional chunkPlan, Map additionalProperties) { + this.voiceId = voiceId; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackNeetsVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackNeetsVoice && equalTo((FallbackNeetsVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackNeetsVoice other) { + return voiceId.equals(other.voiceId) && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voiceId, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackNeetsVoiceId voiceId); + + Builder from(FallbackNeetsVoice other); + } + + public interface _FinalStage { + FallbackNeetsVoice build(); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackNeetsVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackNeetsVoice other) { + voiceId(other.getVoiceId()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; + return this; + } + + @java.lang.Override + public FallbackNeetsVoice build() { + return new FallbackNeetsVoice(voiceId, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackNeetsVoiceId.java b/src/main/java/com/vapi/api/types/FallbackNeetsVoiceId.java new file mode 100644 index 0000000..09af256 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackNeetsVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackNeetsVoiceId.Deserializer.class) +public final class FallbackNeetsVoiceId { + private final Object value; + + private final int type; + + private FallbackNeetsVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackNeetsVoiceIdEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackNeetsVoiceId && equalTo((FallbackNeetsVoiceId) other); + } + + private boolean equalTo(FallbackNeetsVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackNeetsVoiceId of(FallbackNeetsVoiceIdEnum value) { + return new FallbackNeetsVoiceId(value, 0); + } + + public static FallbackNeetsVoiceId of(String value) { + return new FallbackNeetsVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackNeetsVoiceIdEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackNeetsVoiceId.class); + } + + @java.lang.Override + public FallbackNeetsVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackNeetsVoiceIdEnum.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackNeetsVoiceIdEnum.java b/src/main/java/com/vapi/api/types/FallbackNeetsVoiceIdEnum.java new file mode 100644 index 0000000..9717de3 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackNeetsVoiceIdEnum.java @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackNeetsVoiceIdEnum { + VITS("vits"); + + private final String value; + + FallbackNeetsVoiceIdEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackOpenAiVoice.java b/src/main/java/com/vapi/api/types/FallbackOpenAiVoice.java new file mode 100644 index 0000000..6b70f03 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackOpenAiVoice.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackOpenAiVoice.Builder.class) +public final class FallbackOpenAiVoice { + private final FallbackOpenAiVoiceId voiceId; + + private final Optional speed; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackOpenAiVoice( + FallbackOpenAiVoiceId voiceId, + Optional speed, + Optional chunkPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.speed = speed; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + * Please note that ash, ballad, coral, sage, and verse may only be used with the gpt-4o-realtime-preview-2024-10-01 model. + */ + @JsonProperty("voiceId") + public FallbackOpenAiVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the speed multiplier that will be used. + */ + @JsonProperty("speed") + public Optional getSpeed() { + return speed; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackOpenAiVoice && equalTo((FallbackOpenAiVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackOpenAiVoice other) { + return voiceId.equals(other.voiceId) && speed.equals(other.speed) && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voiceId, this.speed, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackOpenAiVoiceId voiceId); + + Builder from(FallbackOpenAiVoice other); + } + + public interface _FinalStage { + FallbackOpenAiVoice build(); + + _FinalStage speed(Optional speed); + + _FinalStage speed(Double speed); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackOpenAiVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional speed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackOpenAiVoice other) { + voiceId(other.getVoiceId()); + speed(other.getSpeed()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used. + * Please note that ash, ballad, coral, sage, and verse may only be used with the gpt-4o-realtime-preview-2024-10-01 model.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the speed multiplier that will be used.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage speed(Double speed) { + this.speed = Optional.ofNullable(speed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "speed", nulls = Nulls.SKIP) + public _FinalStage speed(Optional speed) { + this.speed = speed; + return this; + } + + @java.lang.Override + public FallbackOpenAiVoice build() { + return new FallbackOpenAiVoice(voiceId, speed, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackOpenAiVoiceId.java b/src/main/java/com/vapi/api/types/FallbackOpenAiVoiceId.java new file mode 100644 index 0000000..0bb7c08 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackOpenAiVoiceId.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackOpenAiVoiceId { + ALLOY("alloy"), + + ECHO("echo"), + + FABLE("fable"), + + ONYX("onyx"), + + NOVA("nova"), + + SHIMMER("shimmer"), + + ASH("ash"), + + BALLAD("ballad"), + + CORAL("coral"), + + SAGE("sage"), + + VERSE("verse"); + + private final String value; + + FallbackOpenAiVoiceId(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlan.java b/src/main/java/com/vapi/api/types/FallbackPlan.java new file mode 100644 index 0000000..b4ed4dc --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlan.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackPlan.Builder.class) +public final class FallbackPlan { + private final List voices; + + private final Map additionalProperties; + + private FallbackPlan(List voices, Map additionalProperties) { + this.voices = voices; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the list of voices to fallback to in the event that the primary voice provider fails. + */ + @JsonProperty("voices") + public List getVoices() { + return voices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackPlan && equalTo((FallbackPlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackPlan other) { + return voices.equals(other.voices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List voices = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FallbackPlan other) { + voices(other.getVoices()); + return this; + } + + @JsonSetter(value = "voices", nulls = Nulls.SKIP) + public Builder voices(List voices) { + this.voices.clear(); + this.voices.addAll(voices); + return this; + } + + public Builder addVoices(FallbackPlanVoicesItem voices) { + this.voices.add(voices); + return this; + } + + public Builder addAllVoices(List voices) { + this.voices.addAll(voices); + return this; + } + + public FallbackPlan build() { + return new FallbackPlan(voices, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlanVoicesItem.java b/src/main/java/com/vapi/api/types/FallbackPlanVoicesItem.java new file mode 100644 index 0000000..6796970 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlanVoicesItem.java @@ -0,0 +1,707 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class FallbackPlanVoicesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private FallbackPlanVoicesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static FallbackPlanVoicesItem azure(FallbackAzureVoice value) { + return new FallbackPlanVoicesItem(new AzureValue(value)); + } + + public static FallbackPlanVoicesItem cartesia(FallbackCartesiaVoice value) { + return new FallbackPlanVoicesItem(new CartesiaValue(value)); + } + + public static FallbackPlanVoicesItem customVoice(FallbackCustomVoice value) { + return new FallbackPlanVoicesItem(new CustomVoiceValue(value)); + } + + public static FallbackPlanVoicesItem deepgram(FallbackDeepgramVoice value) { + return new FallbackPlanVoicesItem(new DeepgramValue(value)); + } + + public static FallbackPlanVoicesItem _11Labs(FallbackElevenLabsVoice value) { + return new FallbackPlanVoicesItem(new _11LabsValue(value)); + } + + public static FallbackPlanVoicesItem lmnt(FallbackLmntVoice value) { + return new FallbackPlanVoicesItem(new LmntValue(value)); + } + + public static FallbackPlanVoicesItem neets(FallbackNeetsVoice value) { + return new FallbackPlanVoicesItem(new NeetsValue(value)); + } + + public static FallbackPlanVoicesItem openai(FallbackOpenAiVoice value) { + return new FallbackPlanVoicesItem(new OpenaiValue(value)); + } + + public static FallbackPlanVoicesItem playht(FallbackPlayHtVoice value) { + return new FallbackPlanVoicesItem(new PlayhtValue(value)); + } + + public static FallbackPlanVoicesItem rimeAi(FallbackRimeAiVoice value) { + return new FallbackPlanVoicesItem(new RimeAiValue(value)); + } + + public static FallbackPlanVoicesItem tavus(FallbackTavusVoice value) { + return new FallbackPlanVoicesItem(new TavusValue(value)); + } + + public boolean isAzure() { + return value instanceof AzureValue; + } + + public boolean isCartesia() { + return value instanceof CartesiaValue; + } + + public boolean isCustomVoice() { + return value instanceof CustomVoiceValue; + } + + public boolean isDeepgram() { + return value instanceof DeepgramValue; + } + + public boolean is11Labs() { + return value instanceof _11LabsValue; + } + + public boolean isLmnt() { + return value instanceof LmntValue; + } + + public boolean isNeets() { + return value instanceof NeetsValue; + } + + public boolean isOpenai() { + return value instanceof OpenaiValue; + } + + public boolean isPlayht() { + return value instanceof PlayhtValue; + } + + public boolean isRimeAi() { + return value instanceof RimeAiValue; + } + + public boolean isTavus() { + return value instanceof TavusValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getAzure() { + if (isAzure()) { + return Optional.of(((AzureValue) value).value); + } + return Optional.empty(); + } + + public Optional getCartesia() { + if (isCartesia()) { + return Optional.of(((CartesiaValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomVoice() { + if (isCustomVoice()) { + return Optional.of(((CustomVoiceValue) value).value); + } + return Optional.empty(); + } + + public Optional getDeepgram() { + if (isDeepgram()) { + return Optional.of(((DeepgramValue) value).value); + } + return Optional.empty(); + } + + public Optional get11Labs() { + if (is11Labs()) { + return Optional.of(((_11LabsValue) value).value); + } + return Optional.empty(); + } + + public Optional getLmnt() { + if (isLmnt()) { + return Optional.of(((LmntValue) value).value); + } + return Optional.empty(); + } + + public Optional getNeets() { + if (isNeets()) { + return Optional.of(((NeetsValue) value).value); + } + return Optional.empty(); + } + + public Optional getOpenai() { + if (isOpenai()) { + return Optional.of(((OpenaiValue) value).value); + } + return Optional.empty(); + } + + public Optional getPlayht() { + if (isPlayht()) { + return Optional.of(((PlayhtValue) value).value); + } + return Optional.empty(); + } + + public Optional getRimeAi() { + if (isRimeAi()) { + return Optional.of(((RimeAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getTavus() { + if (isTavus()) { + return Optional.of(((TavusValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitAzure(FallbackAzureVoice azure); + + T visitCartesia(FallbackCartesiaVoice cartesia); + + T visitCustomVoice(FallbackCustomVoice customVoice); + + T visitDeepgram(FallbackDeepgramVoice deepgram); + + T visit11Labs(FallbackElevenLabsVoice _11Labs); + + T visitLmnt(FallbackLmntVoice lmnt); + + T visitNeets(FallbackNeetsVoice neets); + + T visitOpenai(FallbackOpenAiVoice openai); + + T visitPlayht(FallbackPlayHtVoice playht); + + T visitRimeAi(FallbackRimeAiVoice rimeAi); + + T visitTavus(FallbackTavusVoice tavus); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(AzureValue.class), + @JsonSubTypes.Type(CartesiaValue.class), + @JsonSubTypes.Type(CustomVoiceValue.class), + @JsonSubTypes.Type(DeepgramValue.class), + @JsonSubTypes.Type(_11LabsValue.class), + @JsonSubTypes.Type(LmntValue.class), + @JsonSubTypes.Type(NeetsValue.class), + @JsonSubTypes.Type(OpenaiValue.class), + @JsonSubTypes.Type(PlayhtValue.class), + @JsonSubTypes.Type(RimeAiValue.class), + @JsonSubTypes.Type(TavusValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("azure") + private static final class AzureValue implements Value { + @JsonUnwrapped + private FallbackAzureVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AzureValue() {} + + private AzureValue(FallbackAzureVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAzure(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AzureValue && equalTo((AzureValue) other); + } + + private boolean equalTo(AzureValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("cartesia") + private static final class CartesiaValue implements Value { + @JsonUnwrapped + private FallbackCartesiaVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CartesiaValue() {} + + private CartesiaValue(FallbackCartesiaVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCartesia(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CartesiaValue && equalTo((CartesiaValue) other); + } + + private boolean equalTo(CartesiaValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("custom-voice") + private static final class CustomVoiceValue implements Value { + @JsonUnwrapped + private FallbackCustomVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomVoiceValue() {} + + private CustomVoiceValue(FallbackCustomVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomVoice(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomVoiceValue && equalTo((CustomVoiceValue) other); + } + + private boolean equalTo(CustomVoiceValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("deepgram") + private static final class DeepgramValue implements Value { + @JsonUnwrapped + private FallbackDeepgramVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private DeepgramValue() {} + + private DeepgramValue(FallbackDeepgramVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitDeepgram(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeepgramValue && equalTo((DeepgramValue) other); + } + + private boolean equalTo(DeepgramValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("11labs") + private static final class _11LabsValue implements Value { + @JsonUnwrapped + private FallbackElevenLabsVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _11LabsValue() {} + + private _11LabsValue(FallbackElevenLabsVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visit11Labs(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _11LabsValue && equalTo((_11LabsValue) other); + } + + private boolean equalTo(_11LabsValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("lmnt") + private static final class LmntValue implements Value { + @JsonUnwrapped + private FallbackLmntVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private LmntValue() {} + + private LmntValue(FallbackLmntVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitLmnt(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LmntValue && equalTo((LmntValue) other); + } + + private boolean equalTo(LmntValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("neets") + private static final class NeetsValue implements Value { + @JsonUnwrapped + private FallbackNeetsVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private NeetsValue() {} + + private NeetsValue(FallbackNeetsVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitNeets(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NeetsValue && equalTo((NeetsValue) other); + } + + private boolean equalTo(NeetsValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("openai") + private static final class OpenaiValue implements Value { + @JsonUnwrapped + private FallbackOpenAiVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private OpenaiValue() {} + + private OpenaiValue(FallbackOpenAiVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitOpenai(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpenaiValue && equalTo((OpenaiValue) other); + } + + private boolean equalTo(OpenaiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("playht") + private static final class PlayhtValue implements Value { + @JsonUnwrapped + private FallbackPlayHtVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private PlayhtValue() {} + + private PlayhtValue(FallbackPlayHtVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitPlayht(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PlayhtValue && equalTo((PlayhtValue) other); + } + + private boolean equalTo(PlayhtValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("rime-ai") + private static final class RimeAiValue implements Value { + @JsonUnwrapped + private FallbackRimeAiVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RimeAiValue() {} + + private RimeAiValue(FallbackRimeAiVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRimeAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RimeAiValue && equalTo((RimeAiValue) other); + } + + private boolean equalTo(RimeAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("tavus") + private static final class TavusValue implements Value { + @JsonUnwrapped + private FallbackTavusVoice value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TavusValue() {} + + private TavusValue(FallbackTavusVoice value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTavus(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusValue && equalTo((TavusValue) other); + } + + private boolean equalTo(TavusValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "FallbackPlanVoicesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlayHtVoice.java b/src/main/java/com/vapi/api/types/FallbackPlayHtVoice.java new file mode 100644 index 0000000..6868819 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlayHtVoice.java @@ -0,0 +1,467 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackPlayHtVoice.Builder.class) +public final class FallbackPlayHtVoice { + private final FallbackPlayHtVoiceId voiceId; + + private final Optional speed; + + private final Optional temperature; + + private final Optional emotion; + + private final Optional voiceGuidance; + + private final Optional styleGuidance; + + private final Optional textGuidance; + + private final Optional model; + + private final Optional language; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackPlayHtVoice( + FallbackPlayHtVoiceId voiceId, + Optional speed, + Optional temperature, + Optional emotion, + Optional voiceGuidance, + Optional styleGuidance, + Optional textGuidance, + Optional model, + Optional language, + Optional chunkPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.speed = speed; + this.temperature = temperature; + this.emotion = emotion; + this.voiceGuidance = voiceGuidance; + this.styleGuidance = styleGuidance; + this.textGuidance = textGuidance; + this.model = model; + this.language = language; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackPlayHtVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the speed multiplier that will be used. + */ + @JsonProperty("speed") + public Optional getSpeed() { + return speed; + } + + /** + * @return A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice. + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + /** + * @return An emotion to be applied to the speech. + */ + @JsonProperty("emotion") + public Optional getEmotion() { + return emotion; + } + + /** + * @return A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices. + */ + @JsonProperty("voiceGuidance") + public Optional getVoiceGuidance() { + return voiceGuidance; + } + + /** + * @return A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance. + */ + @JsonProperty("styleGuidance") + public Optional getStyleGuidance() { + return styleGuidance; + } + + /** + * @return A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text. + */ + @JsonProperty("textGuidance") + public Optional getTextGuidance() { + return textGuidance; + } + + /** + * @return Playht voice model/engine to use. + */ + @JsonProperty("model") + public Optional getModel() { + return model; + } + + /** + * @return The language to use for the speech. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackPlayHtVoice && equalTo((FallbackPlayHtVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackPlayHtVoice other) { + return voiceId.equals(other.voiceId) + && speed.equals(other.speed) + && temperature.equals(other.temperature) + && emotion.equals(other.emotion) + && voiceGuidance.equals(other.voiceGuidance) + && styleGuidance.equals(other.styleGuidance) + && textGuidance.equals(other.textGuidance) + && model.equals(other.model) + && language.equals(other.language) + && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.voiceId, + this.speed, + this.temperature, + this.emotion, + this.voiceGuidance, + this.styleGuidance, + this.textGuidance, + this.model, + this.language, + this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackPlayHtVoiceId voiceId); + + Builder from(FallbackPlayHtVoice other); + } + + public interface _FinalStage { + FallbackPlayHtVoice build(); + + _FinalStage speed(Optional speed); + + _FinalStage speed(Double speed); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + + _FinalStage emotion(Optional emotion); + + _FinalStage emotion(FallbackPlayHtVoiceEmotion emotion); + + _FinalStage voiceGuidance(Optional voiceGuidance); + + _FinalStage voiceGuidance(Double voiceGuidance); + + _FinalStage styleGuidance(Optional styleGuidance); + + _FinalStage styleGuidance(Double styleGuidance); + + _FinalStage textGuidance(Optional textGuidance); + + _FinalStage textGuidance(Double textGuidance); + + _FinalStage model(Optional model); + + _FinalStage model(FallbackPlayHtVoiceModel model); + + _FinalStage language(Optional language); + + _FinalStage language(FallbackPlayHtVoiceLanguage language); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackPlayHtVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional model = Optional.empty(); + + private Optional textGuidance = Optional.empty(); + + private Optional styleGuidance = Optional.empty(); + + private Optional voiceGuidance = Optional.empty(); + + private Optional emotion = Optional.empty(); + + private Optional temperature = Optional.empty(); + + private Optional speed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackPlayHtVoice other) { + voiceId(other.getVoiceId()); + speed(other.getSpeed()); + temperature(other.getTemperature()); + emotion(other.getEmotion()); + voiceGuidance(other.getVoiceGuidance()); + styleGuidance(other.getStyleGuidance()); + textGuidance(other.getTextGuidance()); + model(other.getModel()); + language(other.getLanguage()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      The language to use for the speech.

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

      Playht voice model/engine to use.

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

      A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.

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

      A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.

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

      A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.

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

      An emotion to be applied to the speech.

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

      A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.

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

      This is the speed multiplier that will be used.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage speed(Double speed) { + this.speed = Optional.ofNullable(speed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "speed", nulls = Nulls.SKIP) + public _FinalStage speed(Optional speed) { + this.speed = speed; + return this; + } + + @java.lang.Override + public FallbackPlayHtVoice build() { + return new FallbackPlayHtVoice( + voiceId, + speed, + temperature, + emotion, + voiceGuidance, + styleGuidance, + textGuidance, + model, + language, + chunkPlan, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceEmotion.java b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceEmotion.java new file mode 100644 index 0000000..98ea2dc --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceEmotion.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackPlayHtVoiceEmotion { + FEMALE_HAPPY("female_happy"), + + FEMALE_SAD("female_sad"), + + FEMALE_ANGRY("female_angry"), + + FEMALE_FEARFUL("female_fearful"), + + FEMALE_DISGUST("female_disgust"), + + FEMALE_SURPRISED("female_surprised"), + + MALE_HAPPY("male_happy"), + + MALE_SAD("male_sad"), + + MALE_ANGRY("male_angry"), + + MALE_FEARFUL("male_fearful"), + + MALE_DISGUST("male_disgust"), + + MALE_SURPRISED("male_surprised"); + + private final String value; + + FallbackPlayHtVoiceEmotion(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceId.java b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceId.java new file mode 100644 index 0000000..3c64d65 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackPlayHtVoiceId.Deserializer.class) +public final class FallbackPlayHtVoiceId { + private final Object value; + + private final int type; + + private FallbackPlayHtVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackPlayHtVoiceIdEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackPlayHtVoiceId && equalTo((FallbackPlayHtVoiceId) other); + } + + private boolean equalTo(FallbackPlayHtVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackPlayHtVoiceId of(FallbackPlayHtVoiceIdEnum value) { + return new FallbackPlayHtVoiceId(value, 0); + } + + public static FallbackPlayHtVoiceId of(String value) { + return new FallbackPlayHtVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackPlayHtVoiceIdEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackPlayHtVoiceId.class); + } + + @java.lang.Override + public FallbackPlayHtVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackPlayHtVoiceIdEnum.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceIdEnum.java b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceIdEnum.java new file mode 100644 index 0000000..9d7bb28 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceIdEnum.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackPlayHtVoiceIdEnum { + JENNIFER("jennifer"), + + MELISSA("melissa"), + + WILL("will"), + + CHRIS("chris"), + + MATT("matt"), + + JACK("jack"), + + RUBY("ruby"), + + DAVIS("davis"), + + DONNA("donna"), + + MICHAEL("michael"); + + private final String value; + + FallbackPlayHtVoiceIdEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceLanguage.java b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceLanguage.java new file mode 100644 index 0000000..d6e94c0 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceLanguage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackPlayHtVoiceLanguage { + AFRIKAANS("afrikaans"), + + ALBANIAN("albanian"), + + AMHARIC("amharic"), + + ARABIC("arabic"), + + BENGALI("bengali"), + + BULGARIAN("bulgarian"), + + CATALAN("catalan"), + + CROATIAN("croatian"), + + CZECH("czech"), + + DANISH("danish"), + + DUTCH("dutch"), + + ENGLISH("english"), + + FRENCH("french"), + + GALICIAN("galician"), + + GERMAN("german"), + + GREEK("greek"), + + HEBREW("hebrew"), + + HINDI("hindi"), + + HUNGARIAN("hungarian"), + + INDONESIAN("indonesian"), + + ITALIAN("italian"), + + JAPANESE("japanese"), + + KOREAN("korean"), + + MALAY("malay"), + + MANDARIN("mandarin"), + + POLISH("polish"), + + PORTUGUESE("portuguese"), + + RUSSIAN("russian"), + + SERBIAN("serbian"), + + SPANISH("spanish"), + + SWEDISH("swedish"), + + TAGALOG("tagalog"), + + THAI("thai"), + + TURKISH("turkish"), + + UKRAINIAN("ukrainian"), + + URDU("urdu"), + + XHOSA("xhosa"); + + private final String value; + + FallbackPlayHtVoiceLanguage(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceModel.java b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceModel.java new file mode 100644 index 0000000..36bd270 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackPlayHtVoiceModel.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackPlayHtVoiceModel { + PLAY_HT_20("PlayHT2.0"), + + PLAY_HT_20_TURBO("PlayHT2.0-turbo"), + + PLAY_30_MINI("Play3.0-mini"); + + private final String value; + + FallbackPlayHtVoiceModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackRimeAiVoice.java b/src/main/java/com/vapi/api/types/FallbackRimeAiVoice.java new file mode 100644 index 0000000..06bf250 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackRimeAiVoice.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackRimeAiVoice.Builder.class) +public final class FallbackRimeAiVoice { + private final FallbackRimeAiVoiceId voiceId; + + private final Optional model; + + private final Optional speed; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackRimeAiVoice( + FallbackRimeAiVoiceId voiceId, + Optional model, + Optional speed, + Optional chunkPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.model = model; + this.speed = speed; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackRimeAiVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the model that will be used. Defaults to 'v1' when not specified. + */ + @JsonProperty("model") + public Optional getModel() { + return model; + } + + /** + * @return This is the speed multiplier that will be used. + */ + @JsonProperty("speed") + public Optional getSpeed() { + return speed; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackRimeAiVoice && equalTo((FallbackRimeAiVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackRimeAiVoice other) { + return voiceId.equals(other.voiceId) + && model.equals(other.model) + && speed.equals(other.speed) + && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.voiceId, this.model, this.speed, this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackRimeAiVoiceId voiceId); + + Builder from(FallbackRimeAiVoice other); + } + + public interface _FinalStage { + FallbackRimeAiVoice build(); + + _FinalStage model(Optional model); + + _FinalStage model(FallbackRimeAiVoiceModel model); + + _FinalStage speed(Optional speed); + + _FinalStage speed(Double speed); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackRimeAiVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional speed = Optional.empty(); + + private Optional model = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackRimeAiVoice other) { + voiceId(other.getVoiceId()); + model(other.getModel()); + speed(other.getSpeed()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      This is the speed multiplier that will be used.

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

      This is the model that will be used. Defaults to 'v1' when not specified.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage model(FallbackRimeAiVoiceModel model) { + this.model = Optional.ofNullable(model); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model", nulls = Nulls.SKIP) + public _FinalStage model(Optional model) { + this.model = model; + return this; + } + + @java.lang.Override + public FallbackRimeAiVoice build() { + return new FallbackRimeAiVoice(voiceId, model, speed, chunkPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceId.java b/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceId.java new file mode 100644 index 0000000..bc40ed3 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackRimeAiVoiceId.Deserializer.class) +public final class FallbackRimeAiVoiceId { + private final Object value; + + private final int type; + + private FallbackRimeAiVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FallbackRimeAiVoiceIdEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackRimeAiVoiceId && equalTo((FallbackRimeAiVoiceId) other); + } + + private boolean equalTo(FallbackRimeAiVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackRimeAiVoiceId of(FallbackRimeAiVoiceIdEnum value) { + return new FallbackRimeAiVoiceId(value, 0); + } + + public static FallbackRimeAiVoiceId of(String value) { + return new FallbackRimeAiVoiceId(value, 1); + } + + public interface Visitor { + T visit(FallbackRimeAiVoiceIdEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackRimeAiVoiceId.class); + } + + @java.lang.Override + public FallbackRimeAiVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FallbackRimeAiVoiceIdEnum.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceIdEnum.java b/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceIdEnum.java new file mode 100644 index 0000000..25ac4b0 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceIdEnum.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackRimeAiVoiceIdEnum { + MARSH("marsh"), + + BAYOU("bayou"), + + CREEK("creek"), + + BROOK("brook"), + + FLOWER("flower"), + + SPORE("spore"), + + GLACIER("glacier"), + + GULCH("gulch"), + + ALPINE("alpine"), + + COVE("cove"), + + LAGOON("lagoon"), + + TUNDRA("tundra"), + + STEPPE("steppe"), + + MESA("mesa"), + + GROVE("grove"), + + RAINFOREST("rainforest"), + + MORAINE("moraine"), + + WILDFLOWER("wildflower"), + + PEAK("peak"), + + BOULDER("boulder"), + + ABBIE("abbie"), + + ALLISON("allison"), + + ALLY("ally"), + + ALONA("alona"), + + AMBER("amber"), + + ANA("ana"), + + ANTOINE("antoine"), + + ARMON("armon"), + + BRENDA("brenda"), + + BRITTANY("brittany"), + + CAROL("carol"), + + COLIN("colin"), + + COURTNEY("courtney"), + + ELENA("elena"), + + ELLIOT("elliot"), + + EVA("eva"), + + GEOFF("geoff"), + + GERALD("gerald"), + + HANK("hank"), + + HELEN("helen"), + + HERA("hera"), + + JEN("jen"), + + JOE("joe"), + + JOY("joy"), + + JUAN("juan"), + + KENDRA("kendra"), + + KENDRICK("kendrick"), + + KENNETH("kenneth"), + + KEVIN("kevin"), + + KRIS("kris"), + + LINDA("linda"), + + MADISON("madison"), + + MARGE("marge"), + + MARINA("marina"), + + MARISSA("marissa"), + + MARTA("marta"), + + MAYA("maya"), + + NICHOLAS("nicholas"), + + NYLES("nyles"), + + PHIL("phil"), + + REBA("reba"), + + REX("rex"), + + RICK("rick"), + + RITU("ritu"), + + ROB("rob"), + + RODNEY("rodney"), + + ROHAN("rohan"), + + ROSCO("rosco"), + + SAMANTHA("samantha"), + + SANDY("sandy"), + + SELENA("selena"), + + SETH("seth"), + + SHARON("sharon"), + + STAN("stan"), + + TAMRA("tamra"), + + TANYA("tanya"), + + TIBUR("tibur"), + + TJ("tj"), + + TYLER("tyler"), + + VIV("viv"), + + YADIRA("yadira"); + + private final String value; + + FallbackRimeAiVoiceIdEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceModel.java b/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceModel.java new file mode 100644 index 0000000..ba6b126 --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackRimeAiVoiceModel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FallbackRimeAiVoiceModel { + V_1("v1"), + + MIST("mist"); + + private final String value; + + FallbackRimeAiVoiceModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackTavusVoice.java b/src/main/java/com/vapi/api/types/FallbackTavusVoice.java new file mode 100644 index 0000000..686e90a --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackTavusVoice.java @@ -0,0 +1,389 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FallbackTavusVoice.Builder.class) +public final class FallbackTavusVoice { + private final FallbackTavusVoiceVoiceId voiceId; + + private final Optional personaId; + + private final Optional callbackUrl; + + private final Optional conversationName; + + private final Optional conversationalContext; + + private final Optional customGreeting; + + private final Optional properties; + + private final Optional chunkPlan; + + private final Map additionalProperties; + + private FallbackTavusVoice( + FallbackTavusVoiceVoiceId voiceId, + Optional personaId, + Optional callbackUrl, + Optional conversationName, + Optional conversationalContext, + Optional customGreeting, + Optional properties, + Optional chunkPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.personaId = personaId; + this.callbackUrl = callbackUrl; + this.conversationName = conversationName; + this.conversationalContext = conversationalContext; + this.customGreeting = customGreeting; + this.properties = properties; + this.chunkPlan = chunkPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public FallbackTavusVoiceVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the unique identifier for the persona that the replica will use in the conversation. + */ + @JsonProperty("personaId") + public Optional getPersonaId() { + return personaId; + } + + /** + * @return This is the url that will receive webhooks with updates regarding the conversation state. + */ + @JsonProperty("callbackUrl") + public Optional getCallbackUrl() { + return callbackUrl; + } + + /** + * @return This is the name for the conversation. + */ + @JsonProperty("conversationName") + public Optional getConversationName() { + return conversationName; + } + + /** + * @return This is the context that will be appended to any context provided in the persona, if one is provided. + */ + @JsonProperty("conversationalContext") + public Optional getConversationalContext() { + return conversationalContext; + } + + /** + * @return This is the custom greeting that the replica will give once a participant joines the conversation. + */ + @JsonProperty("customGreeting") + public Optional getCustomGreeting() { + return customGreeting; + } + + /** + * @return These are optional properties used to customize the conversation. + */ + @JsonProperty("properties") + public Optional getProperties() { + return properties; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackTavusVoice && equalTo((FallbackTavusVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FallbackTavusVoice other) { + return voiceId.equals(other.voiceId) + && personaId.equals(other.personaId) + && callbackUrl.equals(other.callbackUrl) + && conversationName.equals(other.conversationName) + && conversationalContext.equals(other.conversationalContext) + && customGreeting.equals(other.customGreeting) + && properties.equals(other.properties) + && chunkPlan.equals(other.chunkPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.voiceId, + this.personaId, + this.callbackUrl, + this.conversationName, + this.conversationalContext, + this.customGreeting, + this.properties, + this.chunkPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull FallbackTavusVoiceVoiceId voiceId); + + Builder from(FallbackTavusVoice other); + } + + public interface _FinalStage { + FallbackTavusVoice build(); + + _FinalStage personaId(Optional personaId); + + _FinalStage personaId(String personaId); + + _FinalStage callbackUrl(Optional callbackUrl); + + _FinalStage callbackUrl(String callbackUrl); + + _FinalStage conversationName(Optional conversationName); + + _FinalStage conversationName(String conversationName); + + _FinalStage conversationalContext(Optional conversationalContext); + + _FinalStage conversationalContext(String conversationalContext); + + _FinalStage customGreeting(Optional customGreeting); + + _FinalStage customGreeting(String customGreeting); + + _FinalStage properties(Optional properties); + + _FinalStage properties(TavusConversationProperties properties); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private FallbackTavusVoiceVoiceId voiceId; + + private Optional chunkPlan = Optional.empty(); + + private Optional properties = Optional.empty(); + + private Optional customGreeting = Optional.empty(); + + private Optional conversationalContext = Optional.empty(); + + private Optional conversationName = Optional.empty(); + + private Optional callbackUrl = Optional.empty(); + + private Optional personaId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FallbackTavusVoice other) { + voiceId(other.getVoiceId()); + personaId(other.getPersonaId()); + callbackUrl(other.getCallbackUrl()); + conversationName(other.getConversationName()); + conversationalContext(other.getConversationalContext()); + customGreeting(other.getCustomGreeting()); + properties(other.getProperties()); + chunkPlan(other.getChunkPlan()); + return this; + } + + /** + *

      This is the provider-specific ID that will be used.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

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

      These are optional properties used to customize the conversation.

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

      This is the custom greeting that the replica will give once a participant joines the conversation.

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

      This is the context that will be appended to any context provided in the persona, if one is provided.

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

      This is the name for the conversation.

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

      This is the url that will receive webhooks with updates regarding the conversation state.

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

      This is the unique identifier for the persona that the replica will use in the conversation.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage personaId(String personaId) { + this.personaId = Optional.ofNullable(personaId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "personaId", nulls = Nulls.SKIP) + public _FinalStage personaId(Optional personaId) { + this.personaId = personaId; + return this; + } + + @java.lang.Override + public FallbackTavusVoice build() { + return new FallbackTavusVoice( + voiceId, + personaId, + callbackUrl, + conversationName, + conversationalContext, + customGreeting, + properties, + chunkPlan, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FallbackTavusVoiceVoiceId.java b/src/main/java/com/vapi/api/types/FallbackTavusVoiceVoiceId.java new file mode 100644 index 0000000..b4ff3bd --- /dev/null +++ b/src/main/java/com/vapi/api/types/FallbackTavusVoiceVoiceId.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FallbackTavusVoiceVoiceId.Deserializer.class) +public final class FallbackTavusVoiceVoiceId { + private final Object value; + + private final int type; + + private FallbackTavusVoiceVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FallbackTavusVoiceVoiceId && equalTo((FallbackTavusVoiceVoiceId) other); + } + + private boolean equalTo(FallbackTavusVoiceVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FallbackTavusVoiceVoiceId of(String value) { + return new FallbackTavusVoiceVoiceId(value, 0); + } + + public static FallbackTavusVoiceVoiceId of(String value) { + return new FallbackTavusVoiceVoiceId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FallbackTavusVoiceVoiceId.class); + } + + @java.lang.Override + public FallbackTavusVoiceVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference() {})); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/FormatPlan.java b/src/main/java/com/vapi/api/types/FormatPlan.java index ec18ee1..0138cf8 100644 --- a/src/main/java/com/vapi/api/types/FormatPlan.java +++ b/src/main/java/com/vapi/api/types/FormatPlan.java @@ -45,7 +45,6 @@ private FormatPlan( *

      Usage:

      *
        *
      • To rely on the voice provider's formatting logic, set this to false.
      • - *
      • To use ElevenLabs's enableSsmlParsing feature, set this to false.
      • *
      *

      If voice.chunkPlan.enabled is false, this is automatically false since there's no chunk to format.

      *

      @default true

      diff --git a/src/main/java/com/vapi/api/types/FunctionToolWithToolCall.java b/src/main/java/com/vapi/api/types/FunctionToolWithToolCall.java index 7f4c566..6fcce5a 100644 --- a/src/main/java/com/vapi/api/types/FunctionToolWithToolCall.java +++ b/src/main/java/com/vapi/api/types/FunctionToolWithToolCall.java @@ -69,6 +69,14 @@ public Optional> getMessages() { return messages; } + /** + * @return The type of tool. "function" for Function tool. + */ + @JsonProperty("type") + public String getType() { + return "function"; + } + @JsonProperty("toolCall") public ToolCall getToolCall() { return toolCall; diff --git a/src/main/java/com/vapi/api/types/GcpCredential.java b/src/main/java/com/vapi/api/types/GcpCredential.java index e474056..e3a02aa 100644 --- a/src/main/java/com/vapi/api/types/GcpCredential.java +++ b/src/main/java/com/vapi/api/types/GcpCredential.java @@ -95,7 +95,7 @@ public OffsetDateTime getUpdatedAt() { } /** - * @return This is the name of the GCP credential. This is just for your reference. + * @return This is the name of credential. This is just for your reference. */ @JsonProperty("name") public Optional getName() { @@ -297,7 +297,7 @@ public _FinalStage bucketPlan(Optional bucketPlan) { } /** - *

      This is the name of the GCP credential. This is just for your reference.

      + *

      This is the name of credential. This is just for your reference.

      * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/vapi/api/types/GhlToolWithToolCall.java b/src/main/java/com/vapi/api/types/GhlToolWithToolCall.java index 2509099..1980d19 100644 --- a/src/main/java/com/vapi/api/types/GhlToolWithToolCall.java +++ b/src/main/java/com/vapi/api/types/GhlToolWithToolCall.java @@ -73,6 +73,14 @@ public Optional> getMessages() { return messages; } + /** + * @return The type of tool. "ghl" for GHL tool. + */ + @JsonProperty("type") + public String getType() { + return "ghl"; + } + @JsonProperty("toolCall") public ToolCall getToolCall() { return toolCall; diff --git a/src/main/java/com/vapi/api/types/GladiaCredential.java b/src/main/java/com/vapi/api/types/GladiaCredential.java index 97d9744..b47c41e 100644 --- a/src/main/java/com/vapi/api/types/GladiaCredential.java +++ b/src/main/java/com/vapi/api/types/GladiaCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class GladiaCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private GladiaCredential( @@ -38,12 +42,14 @@ private GladiaCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(GladiaCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { GladiaCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(GladiaCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public GladiaCredential build() { - return new GladiaCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new GladiaCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/GoHighLevelCredential.java b/src/main/java/com/vapi/api/types/GoHighLevelCredential.java index 2d29fba..48ea326 100644 --- a/src/main/java/com/vapi/api/types/GoHighLevelCredential.java +++ b/src/main/java/com/vapi/api/types/GoHighLevelCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class GoHighLevelCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private GoHighLevelCredential( @@ -38,12 +42,14 @@ private GoHighLevelCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(GoHighLevelCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { GoHighLevelCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(GoHighLevelCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public GoHighLevelCredential build() { - return new GoHighLevelCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new GoHighLevelCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/GoogleCredential.java b/src/main/java/com/vapi/api/types/GoogleCredential.java new file mode 100644 index 0000000..262826a --- /dev/null +++ b/src/main/java/com/vapi/api/types/GoogleCredential.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GoogleCredential.Builder.class) +public final class GoogleCredential { + private final String apiKey; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private GoogleCredential( + String apiKey, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.apiKey = apiKey; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey + */ + @JsonProperty("provider") + public String getProvider() { + return "google"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleCredential && equalTo((GoogleCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GoogleCredential other) { + return apiKey.equals(other.apiKey) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + IdStage apiKey(@NotNull String apiKey); + + Builder from(GoogleCredential other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + GoogleCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ApiKeyStage, IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String apiKey; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GoogleCredential other) { + apiKey(other.getApiKey()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

      This is not returned in the API.

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

      This is the unique identifier for the credential.

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

      This is the unique identifier for the org that this credential belongs to.

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

      This is the ISO 8601 date-time string of when the credential was created.

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

      This is the ISO 8601 date-time string of when the assistant was last updated.

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

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public GoogleCredential build() { + return new GoogleCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/GoogleModel.java b/src/main/java/com/vapi/api/types/GoogleModel.java new file mode 100644 index 0000000..eddcece --- /dev/null +++ b/src/main/java/com/vapi/api/types/GoogleModel.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +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 = GoogleModel.Builder.class) +public final class GoogleModel { + private final Optional> messages; + + private final Optional> tools; + + private final Optional> toolIds; + + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + + private final GoogleModelModel model; + + private final Optional temperature; + + private final Optional maxTokens; + + private final Optional emotionRecognitionEnabled; + + private final Optional numFastTurns; + + private final Map additionalProperties; + + private GoogleModel( + Optional> messages, + Optional> tools, + Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, + GoogleModelModel model, + Optional temperature, + Optional maxTokens, + Optional emotionRecognitionEnabled, + Optional numFastTurns, + Map additionalProperties) { + this.messages = messages; + this.tools = tools; + this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; + this.model = model; + this.temperature = temperature; + this.maxTokens = maxTokens; + this.emotionRecognitionEnabled = emotionRecognitionEnabled; + this.numFastTurns = numFastTurns; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the starting state for the conversation. + */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return These are the tools that the assistant can use during the call. To use existing tools, use toolIds. + *

      Both tools and toolIds can be used together.

      + */ + @JsonProperty("tools") + public Optional> getTools() { + return tools; + } + + /** + * @return These are the tools that the assistant can use during the call. To use transient tools, use tools. + *

      Both tools and toolIds can be used together.

      + */ + @JsonProperty("toolIds") + public Optional> getToolIds() { + return toolIds; + } + + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + + /** + * @return This is the Google model that will be used. + */ + @JsonProperty("model") + public GoogleModelModel getModel() { + return model; + } + + /** + * @return This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + /** + * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + */ + @JsonProperty("maxTokens") + public Optional getMaxTokens() { + return maxTokens; + } + + /** + * @return This determines whether we detect user's emotion while they speak and send it as an additional info to model. + *

      Default false because the model is usually are good at understanding the user's emotion from text.

      + *

      @default false

      + */ + @JsonProperty("emotionRecognitionEnabled") + public Optional getEmotionRecognitionEnabled() { + return emotionRecognitionEnabled; + } + + /** + * @return This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + *

      Default is 0.

      + *

      @default 0

      + */ + @JsonProperty("numFastTurns") + public Optional getNumFastTurns() { + return numFastTurns; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleModel && equalTo((GoogleModel) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GoogleModel other) { + return messages.equals(other.messages) + && tools.equals(other.tools) + && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) + && model.equals(other.model) + && temperature.equals(other.temperature) + && maxTokens.equals(other.maxTokens) + && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) + && numFastTurns.equals(other.numFastTurns); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.messages, + this.tools, + this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, + this.model, + this.temperature, + this.maxTokens, + this.emotionRecognitionEnabled, + this.numFastTurns); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull GoogleModelModel model); + + Builder from(GoogleModel other); + } + + public interface _FinalStage { + GoogleModel build(); + + _FinalStage messages(Optional> messages); + + _FinalStage messages(List messages); + + _FinalStage tools(Optional> tools); + + _FinalStage tools(List tools); + + _FinalStage toolIds(Optional> toolIds); + + _FinalStage toolIds(List toolIds); + + _FinalStage knowledgeBase(Optional knowledgeBase); + + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); + + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); + + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + + _FinalStage maxTokens(Optional maxTokens); + + _FinalStage maxTokens(Double maxTokens); + + _FinalStage emotionRecognitionEnabled(Optional emotionRecognitionEnabled); + + _FinalStage emotionRecognitionEnabled(Boolean emotionRecognitionEnabled); + + _FinalStage numFastTurns(Optional numFastTurns); + + _FinalStage numFastTurns(Double numFastTurns); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private GoogleModelModel model; + + private Optional numFastTurns = Optional.empty(); + + private Optional emotionRecognitionEnabled = Optional.empty(); + + private Optional maxTokens = Optional.empty(); + + private Optional temperature = Optional.empty(); + + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + + private Optional> toolIds = Optional.empty(); + + private Optional> tools = Optional.empty(); + + private Optional> messages = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GoogleModel other) { + messages(other.getMessages()); + tools(other.getTools()); + toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); + model(other.getModel()); + temperature(other.getTemperature()); + maxTokens(other.getMaxTokens()); + emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); + numFastTurns(other.getNumFastTurns()); + return this; + } + + /** + *

      This is the Google model that will be used.

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

      This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.

      + *

      Default is 0.

      + *

      @default 0

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

      This determines whether we detect user's emotion while they speak and send it as an additional info to model.

      + *

      Default false because the model is usually are good at understanding the user's emotion from text.

      + *

      @default false

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

      This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

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

      These are the tools that the assistant can use during the call. To use transient tools, use tools.

      + *

      Both tools and toolIds can be used together.

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

      These are the tools that the assistant can use during the call. To use existing tools, use toolIds.

      + *

      Both tools and toolIds can be used together.

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

      This is the starting state for the conversation.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage messages(List messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public _FinalStage messages(Optional> messages) { + this.messages = messages; + return this; + } + + @java.lang.Override + public GoogleModel build() { + return new GoogleModel( + messages, + tools, + toolIds, + knowledgeBase, + knowledgeBaseId, + model, + temperature, + maxTokens, + emotionRecognitionEnabled, + numFastTurns, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/GoogleModelModel.java b/src/main/java/com/vapi/api/types/GoogleModelModel.java new file mode 100644 index 0000000..7440acf --- /dev/null +++ b/src/main/java/com/vapi/api/types/GoogleModelModel.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GoogleModelModel { + GEMINI_15_FLASH("gemini-1.5-flash"), + + GEMINI_15_FLASH_002("gemini-1.5-flash-002"), + + GEMINI_15_PRO("gemini-1.5-pro"), + + GEMINI_15_PRO_002("gemini-1.5-pro-002"), + + GEMINI_10_PRO("gemini-1.0-pro"); + + private final String value; + + GoogleModelModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/GoogleModelToolsItem.java b/src/main/java/com/vapi/api/types/GoogleModelToolsItem.java new file mode 100644 index 0000000..87453e6 --- /dev/null +++ b/src/main/java/com/vapi/api/types/GoogleModelToolsItem.java @@ -0,0 +1,483 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class GoogleModelToolsItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private GoogleModelToolsItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static GoogleModelToolsItem dtmf(CreateDtmfToolDto value) { + return new GoogleModelToolsItem(new DtmfValue(value)); + } + + public static GoogleModelToolsItem endCall(CreateEndCallToolDto value) { + return new GoogleModelToolsItem(new EndCallValue(value)); + } + + public static GoogleModelToolsItem voicemail(CreateVoicemailToolDto value) { + return new GoogleModelToolsItem(new VoicemailValue(value)); + } + + public static GoogleModelToolsItem function(CreateFunctionToolDto value) { + return new GoogleModelToolsItem(new FunctionValue(value)); + } + + public static GoogleModelToolsItem ghl(CreateGhlToolDto value) { + return new GoogleModelToolsItem(new GhlValue(value)); + } + + public static GoogleModelToolsItem make(CreateMakeToolDto value) { + return new GoogleModelToolsItem(new MakeValue(value)); + } + + public static GoogleModelToolsItem transferCall(CreateTransferCallToolDto value) { + return new GoogleModelToolsItem(new TransferCallValue(value)); + } + + public boolean isDtmf() { + return value instanceof DtmfValue; + } + + public boolean isEndCall() { + return value instanceof EndCallValue; + } + + public boolean isVoicemail() { + return value instanceof VoicemailValue; + } + + public boolean isFunction() { + return value instanceof FunctionValue; + } + + public boolean isGhl() { + return value instanceof GhlValue; + } + + public boolean isMake() { + return value instanceof MakeValue; + } + + public boolean isTransferCall() { + return value instanceof TransferCallValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getDtmf() { + if (isDtmf()) { + return Optional.of(((DtmfValue) value).value); + } + return Optional.empty(); + } + + public Optional getEndCall() { + if (isEndCall()) { + return Optional.of(((EndCallValue) value).value); + } + return Optional.empty(); + } + + public Optional getVoicemail() { + if (isVoicemail()) { + return Optional.of(((VoicemailValue) value).value); + } + return Optional.empty(); + } + + public Optional getFunction() { + if (isFunction()) { + return Optional.of(((FunctionValue) value).value); + } + return Optional.empty(); + } + + public Optional getGhl() { + if (isGhl()) { + return Optional.of(((GhlValue) value).value); + } + return Optional.empty(); + } + + public Optional getMake() { + if (isMake()) { + return Optional.of(((MakeValue) value).value); + } + return Optional.empty(); + } + + public Optional getTransferCall() { + if (isTransferCall()) { + return Optional.of(((TransferCallValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitDtmf(CreateDtmfToolDto dtmf); + + T visitEndCall(CreateEndCallToolDto endCall); + + T visitVoicemail(CreateVoicemailToolDto voicemail); + + T visitFunction(CreateFunctionToolDto function); + + T visitGhl(CreateGhlToolDto ghl); + + T visitMake(CreateMakeToolDto make); + + T visitTransferCall(CreateTransferCallToolDto transferCall); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(DtmfValue.class), + @JsonSubTypes.Type(EndCallValue.class), + @JsonSubTypes.Type(VoicemailValue.class), + @JsonSubTypes.Type(FunctionValue.class), + @JsonSubTypes.Type(GhlValue.class), + @JsonSubTypes.Type(MakeValue.class), + @JsonSubTypes.Type(TransferCallValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("dtmf") + private static final class DtmfValue implements Value { + @JsonUnwrapped + private CreateDtmfToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private DtmfValue() {} + + private DtmfValue(CreateDtmfToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitDtmf(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DtmfValue && equalTo((DtmfValue) other); + } + + private boolean equalTo(DtmfValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("endCall") + private static final class EndCallValue implements Value { + @JsonUnwrapped + private CreateEndCallToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private EndCallValue() {} + + private EndCallValue(CreateEndCallToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitEndCall(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndCallValue && equalTo((EndCallValue) other); + } + + private boolean equalTo(EndCallValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("voicemail") + private static final class VoicemailValue implements Value { + @JsonUnwrapped + private CreateVoicemailToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VoicemailValue() {} + + private VoicemailValue(CreateVoicemailToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVoicemail(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VoicemailValue && equalTo((VoicemailValue) other); + } + + private boolean equalTo(VoicemailValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("function") + private static final class FunctionValue implements Value { + @JsonUnwrapped + private CreateFunctionToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private FunctionValue() {} + + private FunctionValue(CreateFunctionToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitFunction(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FunctionValue && equalTo((FunctionValue) other); + } + + private boolean equalTo(FunctionValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("ghl") + private static final class GhlValue implements Value { + @JsonUnwrapped + private CreateGhlToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GhlValue() {} + + private GhlValue(CreateGhlToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGhl(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GhlValue && equalTo((GhlValue) other); + } + + private boolean equalTo(GhlValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("make") + private static final class MakeValue implements Value { + @JsonUnwrapped + private CreateMakeToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private MakeValue() {} + + private MakeValue(CreateMakeToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitMake(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MakeValue && equalTo((MakeValue) other); + } + + private boolean equalTo(MakeValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("transferCall") + private static final class TransferCallValue implements Value { + @JsonUnwrapped + private CreateTransferCallToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TransferCallValue() {} + + private TransferCallValue(CreateTransferCallToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTransferCall(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferCallValue && equalTo((TransferCallValue) other); + } + + private boolean equalTo(TransferCallValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "GoogleModelToolsItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/GroqCredential.java b/src/main/java/com/vapi/api/types/GroqCredential.java index 9136fb2..f02dbb0 100644 --- a/src/main/java/com/vapi/api/types/GroqCredential.java +++ b/src/main/java/com/vapi/api/types/GroqCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class GroqCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private GroqCredential( @@ -38,12 +42,14 @@ private GroqCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(GroqCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { GroqCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(GroqCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public GroqCredential build() { - return new GroqCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new GroqCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/GroqModel.java b/src/main/java/com/vapi/api/types/GroqModel.java index 1022f63..8ea43a4 100644 --- a/src/main/java/com/vapi/api/types/GroqModel.java +++ b/src/main/java/com/vapi/api/types/GroqModel.java @@ -28,12 +28,14 @@ public final class GroqModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final GroqModelModel model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private GroqModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, GroqModelModel model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private GroqModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(GroqModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(GroqModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

      These are the options for the knowledge base.

      + *

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

      + *

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public GroqModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/HipaaBuyDto.java b/src/main/java/com/vapi/api/types/HipaaBuyDto.java new file mode 100644 index 0000000..2eca073 --- /dev/null +++ b/src/main/java/com/vapi/api/types/HipaaBuyDto.java @@ -0,0 +1,139 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = HipaaBuyDto.Builder.class) +public final class HipaaBuyDto { + private final String recipientName; + + private final String recipientOrganization; + + private final Map additionalProperties; + + private HipaaBuyDto(String recipientName, String recipientOrganization, Map additionalProperties) { + this.recipientName = recipientName; + this.recipientOrganization = recipientOrganization; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the name of the recipient. + */ + @JsonProperty("recipientName") + public String getRecipientName() { + return recipientName; + } + + /** + * @return This is the name of the recipient organization. + */ + @JsonProperty("recipientOrganization") + public String getRecipientOrganization() { + return recipientOrganization; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof HipaaBuyDto && equalTo((HipaaBuyDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(HipaaBuyDto other) { + return recipientName.equals(other.recipientName) && recipientOrganization.equals(other.recipientOrganization); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.recipientName, this.recipientOrganization); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RecipientNameStage builder() { + return new Builder(); + } + + public interface RecipientNameStage { + RecipientOrganizationStage recipientName(@NotNull String recipientName); + + Builder from(HipaaBuyDto other); + } + + public interface RecipientOrganizationStage { + _FinalStage recipientOrganization(@NotNull String recipientOrganization); + } + + public interface _FinalStage { + HipaaBuyDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RecipientNameStage, RecipientOrganizationStage, _FinalStage { + private String recipientName; + + private String recipientOrganization; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(HipaaBuyDto other) { + recipientName(other.getRecipientName()); + recipientOrganization(other.getRecipientOrganization()); + return this; + } + + /** + *

      This is the name of the recipient.

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

      This is the name of the recipient organization.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("recipientOrganization") + public _FinalStage recipientOrganization(@NotNull String recipientOrganization) { + this.recipientOrganization = + Objects.requireNonNull(recipientOrganization, "recipientOrganization must not be null"); + return this; + } + + @java.lang.Override + public HipaaBuyDto build() { + return new HipaaBuyDto(recipientName, recipientOrganization, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/InflectionAiCredential.java b/src/main/java/com/vapi/api/types/InflectionAiCredential.java new file mode 100644 index 0000000..79062c1 --- /dev/null +++ b/src/main/java/com/vapi/api/types/InflectionAiCredential.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InflectionAiCredential.Builder.class) +public final class InflectionAiCredential { + private final String apiKey; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private InflectionAiCredential( + String apiKey, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.apiKey = apiKey; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup + */ + @JsonProperty("provider") + public String getProvider() { + return "inflection-ai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InflectionAiCredential && equalTo((InflectionAiCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InflectionAiCredential other) { + return apiKey.equals(other.apiKey) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + IdStage apiKey(@NotNull String apiKey); + + Builder from(InflectionAiCredential other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + InflectionAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ApiKeyStage, IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String apiKey; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(InflectionAiCredential other) { + apiKey(other.getApiKey()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

      This is not returned in the API.

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

      This is the unique identifier for the credential.

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

      This is the unique identifier for the org that this credential belongs to.

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

      This is the ISO 8601 date-time string of when the credential was created.

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

      This is the ISO 8601 date-time string of when the assistant was last updated.

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

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public InflectionAiCredential build() { + return new InflectionAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/InflectionAiModel.java b/src/main/java/com/vapi/api/types/InflectionAiModel.java new file mode 100644 index 0000000..d193473 --- /dev/null +++ b/src/main/java/com/vapi/api/types/InflectionAiModel.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InflectionAiModel.Builder.class) +public final class InflectionAiModel { + private final Optional> messages; + + private final Optional> tools; + + private final Optional> toolIds; + + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + + private final Optional temperature; + + private final Optional maxTokens; + + private final Optional emotionRecognitionEnabled; + + private final Optional numFastTurns; + + private final Map additionalProperties; + + private InflectionAiModel( + Optional> messages, + Optional> tools, + Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, + Optional temperature, + Optional maxTokens, + Optional emotionRecognitionEnabled, + Optional numFastTurns, + Map additionalProperties) { + this.messages = messages; + this.tools = tools; + this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; + this.temperature = temperature; + this.maxTokens = maxTokens; + this.emotionRecognitionEnabled = emotionRecognitionEnabled; + this.numFastTurns = numFastTurns; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the starting state for the conversation. + */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return These are the tools that the assistant can use during the call. To use existing tools, use toolIds. + *

      Both tools and toolIds can be used together.

      + */ + @JsonProperty("tools") + public Optional> getTools() { + return tools; + } + + /** + * @return These are the tools that the assistant can use during the call. To use transient tools, use tools. + *

      Both tools and toolIds can be used together.

      + */ + @JsonProperty("toolIds") + public Optional> getToolIds() { + return toolIds; + } + + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + + /** + * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + */ + @JsonProperty("model") + public String getModel() { + return "inflection_3_pi"; + } + + /** + * @return This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + /** + * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + */ + @JsonProperty("maxTokens") + public Optional getMaxTokens() { + return maxTokens; + } + + /** + * @return This determines whether we detect user's emotion while they speak and send it as an additional info to model. + *

      Default false because the model is usually are good at understanding the user's emotion from text.

      + *

      @default false

      + */ + @JsonProperty("emotionRecognitionEnabled") + public Optional getEmotionRecognitionEnabled() { + return emotionRecognitionEnabled; + } + + /** + * @return This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + *

      Default is 0.

      + *

      @default 0

      + */ + @JsonProperty("numFastTurns") + public Optional getNumFastTurns() { + return numFastTurns; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InflectionAiModel && equalTo((InflectionAiModel) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InflectionAiModel other) { + return messages.equals(other.messages) + && tools.equals(other.tools) + && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) + && temperature.equals(other.temperature) + && maxTokens.equals(other.maxTokens) + && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) + && numFastTurns.equals(other.numFastTurns); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.messages, + this.tools, + this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, + this.temperature, + this.maxTokens, + this.emotionRecognitionEnabled, + this.numFastTurns); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> messages = Optional.empty(); + + private Optional> tools = Optional.empty(); + + private Optional> toolIds = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + + private Optional knowledgeBaseId = Optional.empty(); + + private Optional temperature = Optional.empty(); + + private Optional maxTokens = Optional.empty(); + + private Optional emotionRecognitionEnabled = Optional.empty(); + + private Optional numFastTurns = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InflectionAiModel other) { + messages(other.getMessages()); + tools(other.getTools()); + toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); + temperature(other.getTemperature()); + maxTokens(other.getMaxTokens()); + emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); + numFastTurns(other.getNumFastTurns()); + return this; + } + + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public Builder messages(Optional> messages) { + this.messages = messages; + return this; + } + + public Builder messages(List messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @JsonSetter(value = "tools", nulls = Nulls.SKIP) + public Builder tools(Optional> tools) { + this.tools = tools; + return this; + } + + public Builder tools(List tools) { + this.tools = Optional.ofNullable(tools); + return this; + } + + @JsonSetter(value = "toolIds", nulls = Nulls.SKIP) + public Builder toolIds(Optional> toolIds) { + this.toolIds = toolIds; + return this; + } + + public Builder toolIds(List toolIds) { + this.toolIds = Optional.ofNullable(toolIds); + return this; + } + + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public Builder knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; + return this; + } + + public Builder knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @JsonSetter(value = "knowledgeBaseId", nulls = Nulls.SKIP) + public Builder knowledgeBaseId(Optional knowledgeBaseId) { + this.knowledgeBaseId = knowledgeBaseId; + return this; + } + + public Builder knowledgeBaseId(String knowledgeBaseId) { + this.knowledgeBaseId = Optional.ofNullable(knowledgeBaseId); + return this; + } + + @JsonSetter(value = "temperature", nulls = Nulls.SKIP) + public Builder temperature(Optional temperature) { + this.temperature = temperature; + return this; + } + + public Builder temperature(Double temperature) { + this.temperature = Optional.ofNullable(temperature); + return this; + } + + @JsonSetter(value = "maxTokens", nulls = Nulls.SKIP) + public Builder maxTokens(Optional maxTokens) { + this.maxTokens = maxTokens; + return this; + } + + public Builder maxTokens(Double maxTokens) { + this.maxTokens = Optional.ofNullable(maxTokens); + return this; + } + + @JsonSetter(value = "emotionRecognitionEnabled", nulls = Nulls.SKIP) + public Builder emotionRecognitionEnabled(Optional emotionRecognitionEnabled) { + this.emotionRecognitionEnabled = emotionRecognitionEnabled; + return this; + } + + public Builder emotionRecognitionEnabled(Boolean emotionRecognitionEnabled) { + this.emotionRecognitionEnabled = Optional.ofNullable(emotionRecognitionEnabled); + return this; + } + + @JsonSetter(value = "numFastTurns", nulls = Nulls.SKIP) + public Builder numFastTurns(Optional numFastTurns) { + this.numFastTurns = numFastTurns; + return this; + } + + public Builder numFastTurns(Double numFastTurns) { + this.numFastTurns = Optional.ofNullable(numFastTurns); + return this; + } + + public InflectionAiModel build() { + return new InflectionAiModel( + messages, + tools, + toolIds, + knowledgeBase, + knowledgeBaseId, + temperature, + maxTokens, + emotionRecognitionEnabled, + numFastTurns, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/InflectionAiModelToolsItem.java b/src/main/java/com/vapi/api/types/InflectionAiModelToolsItem.java new file mode 100644 index 0000000..00602bb --- /dev/null +++ b/src/main/java/com/vapi/api/types/InflectionAiModelToolsItem.java @@ -0,0 +1,483 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class InflectionAiModelToolsItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private InflectionAiModelToolsItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static InflectionAiModelToolsItem dtmf(CreateDtmfToolDto value) { + return new InflectionAiModelToolsItem(new DtmfValue(value)); + } + + public static InflectionAiModelToolsItem endCall(CreateEndCallToolDto value) { + return new InflectionAiModelToolsItem(new EndCallValue(value)); + } + + public static InflectionAiModelToolsItem voicemail(CreateVoicemailToolDto value) { + return new InflectionAiModelToolsItem(new VoicemailValue(value)); + } + + public static InflectionAiModelToolsItem function(CreateFunctionToolDto value) { + return new InflectionAiModelToolsItem(new FunctionValue(value)); + } + + public static InflectionAiModelToolsItem ghl(CreateGhlToolDto value) { + return new InflectionAiModelToolsItem(new GhlValue(value)); + } + + public static InflectionAiModelToolsItem make(CreateMakeToolDto value) { + return new InflectionAiModelToolsItem(new MakeValue(value)); + } + + public static InflectionAiModelToolsItem transferCall(CreateTransferCallToolDto value) { + return new InflectionAiModelToolsItem(new TransferCallValue(value)); + } + + public boolean isDtmf() { + return value instanceof DtmfValue; + } + + public boolean isEndCall() { + return value instanceof EndCallValue; + } + + public boolean isVoicemail() { + return value instanceof VoicemailValue; + } + + public boolean isFunction() { + return value instanceof FunctionValue; + } + + public boolean isGhl() { + return value instanceof GhlValue; + } + + public boolean isMake() { + return value instanceof MakeValue; + } + + public boolean isTransferCall() { + return value instanceof TransferCallValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getDtmf() { + if (isDtmf()) { + return Optional.of(((DtmfValue) value).value); + } + return Optional.empty(); + } + + public Optional getEndCall() { + if (isEndCall()) { + return Optional.of(((EndCallValue) value).value); + } + return Optional.empty(); + } + + public Optional getVoicemail() { + if (isVoicemail()) { + return Optional.of(((VoicemailValue) value).value); + } + return Optional.empty(); + } + + public Optional getFunction() { + if (isFunction()) { + return Optional.of(((FunctionValue) value).value); + } + return Optional.empty(); + } + + public Optional getGhl() { + if (isGhl()) { + return Optional.of(((GhlValue) value).value); + } + return Optional.empty(); + } + + public Optional getMake() { + if (isMake()) { + return Optional.of(((MakeValue) value).value); + } + return Optional.empty(); + } + + public Optional getTransferCall() { + if (isTransferCall()) { + return Optional.of(((TransferCallValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitDtmf(CreateDtmfToolDto dtmf); + + T visitEndCall(CreateEndCallToolDto endCall); + + T visitVoicemail(CreateVoicemailToolDto voicemail); + + T visitFunction(CreateFunctionToolDto function); + + T visitGhl(CreateGhlToolDto ghl); + + T visitMake(CreateMakeToolDto make); + + T visitTransferCall(CreateTransferCallToolDto transferCall); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(DtmfValue.class), + @JsonSubTypes.Type(EndCallValue.class), + @JsonSubTypes.Type(VoicemailValue.class), + @JsonSubTypes.Type(FunctionValue.class), + @JsonSubTypes.Type(GhlValue.class), + @JsonSubTypes.Type(MakeValue.class), + @JsonSubTypes.Type(TransferCallValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("dtmf") + private static final class DtmfValue implements Value { + @JsonUnwrapped + private CreateDtmfToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private DtmfValue() {} + + private DtmfValue(CreateDtmfToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitDtmf(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DtmfValue && equalTo((DtmfValue) other); + } + + private boolean equalTo(DtmfValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("endCall") + private static final class EndCallValue implements Value { + @JsonUnwrapped + private CreateEndCallToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private EndCallValue() {} + + private EndCallValue(CreateEndCallToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitEndCall(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndCallValue && equalTo((EndCallValue) other); + } + + private boolean equalTo(EndCallValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("voicemail") + private static final class VoicemailValue implements Value { + @JsonUnwrapped + private CreateVoicemailToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VoicemailValue() {} + + private VoicemailValue(CreateVoicemailToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVoicemail(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VoicemailValue && equalTo((VoicemailValue) other); + } + + private boolean equalTo(VoicemailValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("function") + private static final class FunctionValue implements Value { + @JsonUnwrapped + private CreateFunctionToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private FunctionValue() {} + + private FunctionValue(CreateFunctionToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitFunction(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FunctionValue && equalTo((FunctionValue) other); + } + + private boolean equalTo(FunctionValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("ghl") + private static final class GhlValue implements Value { + @JsonUnwrapped + private CreateGhlToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GhlValue() {} + + private GhlValue(CreateGhlToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGhl(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GhlValue && equalTo((GhlValue) other); + } + + private boolean equalTo(GhlValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("make") + private static final class MakeValue implements Value { + @JsonUnwrapped + private CreateMakeToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private MakeValue() {} + + private MakeValue(CreateMakeToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitMake(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MakeValue && equalTo((MakeValue) other); + } + + private boolean equalTo(MakeValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("transferCall") + private static final class TransferCallValue implements Value { + @JsonUnwrapped + private CreateTransferCallToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TransferCallValue() {} + + private TransferCallValue(CreateTransferCallToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTransferCall(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferCallValue && equalTo((TransferCallValue) other); + } + + private boolean equalTo(TransferCallValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "InflectionAiModelToolsItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/InviteUserDto.java b/src/main/java/com/vapi/api/types/InviteUserDto.java index 89ea880..7afae20 100644 --- a/src/main/java/com/vapi/api/types/InviteUserDto.java +++ b/src/main/java/com/vapi/api/types/InviteUserDto.java @@ -9,9 +9,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @@ -19,21 +22,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = InviteUserDto.Builder.class) public final class InviteUserDto { - private final String email; + private final List emails; private final InviteUserDtoRole role; private final Map additionalProperties; - private InviteUserDto(String email, InviteUserDtoRole role, Map additionalProperties) { - this.email = email; + private InviteUserDto(List emails, InviteUserDtoRole role, Map additionalProperties) { + this.emails = emails; this.role = role; this.additionalProperties = additionalProperties; } - @JsonProperty("email") - public String getEmail() { - return email; + @JsonProperty("emails") + public List getEmails() { + return emails; } @JsonProperty("role") @@ -53,12 +56,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(InviteUserDto other) { - return email.equals(other.email) && role.equals(other.role); + return emails.equals(other.emails) && role.equals(other.role); } @java.lang.Override public int hashCode() { - return Objects.hash(this.email, this.role); + return Objects.hash(this.emails, this.role); } @java.lang.Override @@ -66,30 +69,32 @@ public String toString() { return ObjectMappers.stringify(this); } - public static EmailStage builder() { + public static RoleStage builder() { return new Builder(); } - public interface EmailStage { - RoleStage email(@NotNull String email); - - Builder from(InviteUserDto other); - } - public interface RoleStage { _FinalStage role(@NotNull InviteUserDtoRole role); + + Builder from(InviteUserDto other); } public interface _FinalStage { InviteUserDto build(); + + _FinalStage emails(List emails); + + _FinalStage addEmails(String emails); + + _FinalStage addAllEmails(List emails); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EmailStage, RoleStage, _FinalStage { - private String email; - + public static final class Builder implements RoleStage, _FinalStage { private InviteUserDtoRole role; + private List emails = new ArrayList<>(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -97,28 +102,41 @@ private Builder() {} @java.lang.Override public Builder from(InviteUserDto other) { - email(other.getEmail()); + emails(other.getEmails()); role(other.getRole()); return this; } @java.lang.Override - @JsonSetter("email") - public RoleStage email(@NotNull String email) { - this.email = Objects.requireNonNull(email, "email must not be null"); + @JsonSetter("role") + public _FinalStage role(@NotNull InviteUserDtoRole role) { + this.role = Objects.requireNonNull(role, "role must not be null"); return this; } @java.lang.Override - @JsonSetter("role") - public _FinalStage role(@NotNull InviteUserDtoRole role) { - this.role = Objects.requireNonNull(role, "role must not be null"); + public _FinalStage addAllEmails(List emails) { + this.emails.addAll(emails); + return this; + } + + @java.lang.Override + public _FinalStage addEmails(String emails) { + this.emails.add(emails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "emails", nulls = Nulls.SKIP) + public _FinalStage emails(List emails) { + this.emails.clear(); + this.emails.addAll(emails); return this; } @java.lang.Override public InviteUserDto build() { - return new InviteUserDto(email, role, additionalProperties); + return new InviteUserDto(emails, role, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/KnowledgeBase.java b/src/main/java/com/vapi/api/types/KnowledgeBase.java deleted file mode 100644 index cfc8f87..0000000 --- a/src/main/java/com/vapi/api/types/KnowledgeBase.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.vapi.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.vapi.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = KnowledgeBase.Builder.class) -public final class KnowledgeBase { - private final Optional topK; - - private final List fileIds; - - private final Map additionalProperties; - - private KnowledgeBase(Optional topK, List fileIds, Map additionalProperties) { - this.topK = topK; - this.fileIds = fileIds; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("provider") - public String getProvider() { - return "canonical"; - } - - @JsonProperty("topK") - public Optional getTopK() { - return topK; - } - - @JsonProperty("fileIds") - public List getFileIds() { - return fileIds; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof KnowledgeBase && equalTo((KnowledgeBase) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(KnowledgeBase other) { - return topK.equals(other.topK) && fileIds.equals(other.fileIds); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.topK, this.fileIds); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional topK = Optional.empty(); - - private List fileIds = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(KnowledgeBase other) { - topK(other.getTopK()); - fileIds(other.getFileIds()); - return this; - } - - @JsonSetter(value = "topK", nulls = Nulls.SKIP) - public Builder topK(Optional topK) { - this.topK = topK; - return this; - } - - public Builder topK(Double topK) { - this.topK = Optional.ofNullable(topK); - return this; - } - - @JsonSetter(value = "fileIds", nulls = Nulls.SKIP) - public Builder fileIds(List fileIds) { - this.fileIds.clear(); - this.fileIds.addAll(fileIds); - return this; - } - - public Builder addFileIds(String fileIds) { - this.fileIds.add(fileIds); - return this; - } - - public Builder addAllFileIds(List fileIds) { - this.fileIds.addAll(fileIds); - return this; - } - - public KnowledgeBase build() { - return new KnowledgeBase(topK, fileIds, additionalProperties); - } - } -} diff --git a/src/main/java/com/vapi/api/types/KnowledgeBaseResponseDocument.java b/src/main/java/com/vapi/api/types/KnowledgeBaseResponseDocument.java new file mode 100644 index 0000000..e3dd55f --- /dev/null +++ b/src/main/java/com/vapi/api/types/KnowledgeBaseResponseDocument.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = KnowledgeBaseResponseDocument.Builder.class) +public final class KnowledgeBaseResponseDocument { + private final String content; + + private final double similarity; + + private final Optional uuid; + + private final Map additionalProperties; + + private KnowledgeBaseResponseDocument( + String content, double similarity, Optional uuid, Map additionalProperties) { + this.content = content; + this.similarity = similarity; + this.uuid = uuid; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the content of the document. + */ + @JsonProperty("content") + public String getContent() { + return content; + } + + /** + * @return This is the similarity score of the document. + */ + @JsonProperty("similarity") + public double getSimilarity() { + return similarity; + } + + /** + * @return This is the uuid of the document. + */ + @JsonProperty("uuid") + public Optional getUuid() { + return uuid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof KnowledgeBaseResponseDocument && equalTo((KnowledgeBaseResponseDocument) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(KnowledgeBaseResponseDocument other) { + return content.equals(other.content) && similarity == other.similarity && uuid.equals(other.uuid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.content, this.similarity, this.uuid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ContentStage builder() { + return new Builder(); + } + + public interface ContentStage { + SimilarityStage content(@NotNull String content); + + Builder from(KnowledgeBaseResponseDocument other); + } + + public interface SimilarityStage { + _FinalStage similarity(double similarity); + } + + public interface _FinalStage { + KnowledgeBaseResponseDocument build(); + + _FinalStage uuid(Optional uuid); + + _FinalStage uuid(String uuid); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ContentStage, SimilarityStage, _FinalStage { + private String content; + + private double similarity; + + private Optional uuid = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(KnowledgeBaseResponseDocument other) { + content(other.getContent()); + similarity(other.getSimilarity()); + uuid(other.getUuid()); + return this; + } + + /** + *

      This is the content of the document.

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

      This is the similarity score of the document.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("similarity") + public _FinalStage similarity(double similarity) { + this.similarity = similarity; + return this; + } + + /** + *

      This is the uuid of the document.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage uuid(String uuid) { + this.uuid = Optional.ofNullable(uuid); + return this; + } + + @java.lang.Override + @JsonSetter(value = "uuid", nulls = Nulls.SKIP) + public _FinalStage uuid(Optional uuid) { + this.uuid = uuid; + return this; + } + + @java.lang.Override + public KnowledgeBaseResponseDocument build() { + return new KnowledgeBaseResponseDocument(content, similarity, uuid, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/LangfuseCredential.java b/src/main/java/com/vapi/api/types/LangfuseCredential.java new file mode 100644 index 0000000..a74aa11 --- /dev/null +++ b/src/main/java/com/vapi/api/types/LangfuseCredential.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LangfuseCredential.Builder.class) +public final class LangfuseCredential { + private final String publicKey; + + private final String apiKey; + + private final String apiUrl; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private LangfuseCredential( + String publicKey, + String apiKey, + String apiUrl, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.publicKey = publicKey; + this.apiKey = apiKey; + this.apiUrl = apiUrl; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "langfuse"; + } + + /** + * @return The public key for Langfuse project. Eg: pk-lf-... + */ + @JsonProperty("publicKey") + public String getPublicKey() { + return publicKey; + } + + /** + * @return The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return The host URL for Langfuse project. Eg: https://cloud.langfuse.com + */ + @JsonProperty("apiUrl") + public String getApiUrl() { + return apiUrl; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LangfuseCredential && equalTo((LangfuseCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LangfuseCredential other) { + return publicKey.equals(other.publicKey) + && apiKey.equals(other.apiKey) + && apiUrl.equals(other.apiUrl) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.publicKey, + this.apiKey, + this.apiUrl, + this.id, + this.orgId, + this.createdAt, + this.updatedAt, + this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PublicKeyStage builder() { + return new Builder(); + } + + public interface PublicKeyStage { + ApiKeyStage publicKey(@NotNull String publicKey); + + Builder from(LangfuseCredential other); + } + + public interface ApiKeyStage { + ApiUrlStage apiKey(@NotNull String apiKey); + } + + public interface ApiUrlStage { + IdStage apiUrl(@NotNull String apiUrl); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + LangfuseCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements PublicKeyStage, + ApiKeyStage, + ApiUrlStage, + IdStage, + OrgIdStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private String publicKey; + + private String apiKey; + + private String apiUrl; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LangfuseCredential other) { + publicKey(other.getPublicKey()); + apiKey(other.getApiKey()); + apiUrl(other.getApiUrl()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

      The public key for Langfuse project. Eg: pk-lf-...

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

      The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API.

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

      The host URL for Langfuse project. Eg: https://cloud.langfuse.com

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

      This is the unique identifier for the credential.

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

      This is the unique identifier for the org that this credential belongs to.

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

      This is the ISO 8601 date-time string of when the credential was created.

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

      This is the ISO 8601 date-time string of when the assistant was last updated.

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

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public LangfuseCredential build() { + return new LangfuseCredential( + publicKey, apiKey, apiUrl, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/LmntCredential.java b/src/main/java/com/vapi/api/types/LmntCredential.java index e6527d3..109aabc 100644 --- a/src/main/java/com/vapi/api/types/LmntCredential.java +++ b/src/main/java/com/vapi/api/types/LmntCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class LmntCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private LmntCredential( @@ -38,12 +42,14 @@ private LmntCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(LmntCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { LmntCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(LmntCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public LmntCredential build() { - return new LmntCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new LmntCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/LmntVoice.java b/src/main/java/com/vapi/api/types/LmntVoice.java index 651d5e2..6e6d3f8 100644 --- a/src/main/java/com/vapi/api/types/LmntVoice.java +++ b/src/main/java/com/vapi/api/types/LmntVoice.java @@ -21,38 +21,29 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LmntVoice.Builder.class) public final class LmntVoice { - private final Optional fillerInjectionEnabled; - private final LmntVoiceId voiceId; private final Optional speed; private final Optional chunkPlan; + private final Optional fallbackPlan; + private final Map additionalProperties; private LmntVoice( - Optional fillerInjectionEnabled, LmntVoiceId voiceId, Optional speed, Optional chunkPlan, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.speed = speed; this.chunkPlan = chunkPlan; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. */ @@ -77,6 +68,14 @@ public Optional getChunkPlan() { return chunkPlan; } + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -89,15 +88,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(LmntVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) + return voiceId.equals(other.voiceId) && speed.equals(other.speed) - && chunkPlan.equals(other.chunkPlan); + && chunkPlan.equals(other.chunkPlan) + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.voiceId, this.speed, this.chunkPlan); + return Objects.hash(this.voiceId, this.speed, this.chunkPlan, this.fallbackPlan); } @java.lang.Override @@ -118,10 +117,6 @@ public interface VoiceIdStage { public interface _FinalStage { LmntVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage speed(Optional speed); _FinalStage speed(Double speed); @@ -129,18 +124,22 @@ public interface _FinalStage { _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private LmntVoiceId voiceId; + private Optional fallbackPlan = Optional.empty(); + private Optional chunkPlan = Optional.empty(); private Optional speed = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -148,10 +147,10 @@ private Builder() {} @java.lang.Override public Builder from(LmntVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); speed(other.getSpeed()); chunkPlan(other.getChunkPlan()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -166,6 +165,23 @@ public _FinalStage voiceId(@NotNull LmntVoiceId voiceId) { return this; } + /** + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -200,27 +216,9 @@ public _FinalStage speed(Optional speed) { return this; } - /** - *

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; - return this; - } - @java.lang.Override public LmntVoice build() { - return new LmntVoice(fillerInjectionEnabled, voiceId, speed, chunkPlan, additionalProperties); + return new LmntVoice(voiceId, speed, chunkPlan, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/Log.java b/src/main/java/com/vapi/api/types/Log.java index 353eb30..a49012d 100644 --- a/src/main/java/com/vapi/api/types/Log.java +++ b/src/main/java/com/vapi/api/types/Log.java @@ -22,12 +22,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Log.Builder.class) public final class Log { - private final double time; + private final String time; private final String orgId; private final LogType type; + private final Optional webhookType; + private final Optional resource; private final double requestDurationSeconds; @@ -71,9 +73,10 @@ public final class Log { private final Map additionalProperties; private Log( - double time, + String time, String orgId, LogType type, + Optional webhookType, Optional resource, double requestDurationSeconds, String requestStartedAt, @@ -98,6 +101,7 @@ private Log( this.time = time; this.orgId = orgId; this.type = type; + this.webhookType = webhookType; this.resource = resource; this.requestDurationSeconds = requestDurationSeconds; this.requestStartedAt = requestStartedAt; @@ -125,7 +129,7 @@ private Log( * @return This is the timestamp at which the log was written. */ @JsonProperty("time") - public double getTime() { + public String getTime() { return time; } @@ -145,6 +149,14 @@ public LogType getType() { return type; } + /** + * @return This is the type of the webhook, given the log is from a webhook. + */ + @JsonProperty("webhookType") + public Optional getWebhookType() { + return webhookType; + } + /** * @return This is the specific resource, relevant only to API logs. */ @@ -317,9 +329,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(Log other) { - return time == other.time + return time.equals(other.time) && orgId.equals(other.orgId) && type.equals(other.type) + && webhookType.equals(other.webhookType) && resource.equals(other.resource) && requestDurationSeconds == other.requestDurationSeconds && requestStartedAt.equals(other.requestStartedAt) @@ -348,6 +361,7 @@ public int hashCode() { this.time, this.orgId, this.type, + this.webhookType, this.resource, this.requestDurationSeconds, this.requestStartedAt, @@ -380,7 +394,7 @@ public static TimeStage builder() { } public interface TimeStage { - OrgIdStage time(double time); + OrgIdStage time(@NotNull String time); Builder from(Log other); } @@ -424,6 +438,10 @@ public interface ResponseHttpCodeStage { public interface _FinalStage { Log build(); + _FinalStage webhookType(Optional webhookType); + + _FinalStage webhookType(String webhookType); + _FinalStage resource(Optional resource); _FinalStage resource(LogResource resource); @@ -492,7 +510,7 @@ public static final class Builder RequestPathStage, ResponseHttpCodeStage, _FinalStage { - private double time; + private String time; private String orgId; @@ -538,6 +556,8 @@ public static final class Builder private Optional resource = Optional.empty(); + private Optional webhookType = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -548,6 +568,7 @@ public Builder from(Log other) { time(other.getTime()); orgId(other.getOrgId()); type(other.getType()); + webhookType(other.getWebhookType()); resource(other.getResource()); requestDurationSeconds(other.getRequestDurationSeconds()); requestStartedAt(other.getRequestStartedAt()); @@ -577,8 +598,8 @@ public Builder from(Log other) { */ @java.lang.Override @JsonSetter("time") - public OrgIdStage time(double time) { - this.time = time; + public OrgIdStage time(@NotNull String time) { + this.time = Objects.requireNonNull(time, "time must not be null"); return this; } @@ -913,12 +934,30 @@ public _FinalStage resource(Optional resource) { return this; } + /** + *

      This is the type of the webhook, given the log is from a webhook.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookType(String webhookType) { + this.webhookType = Optional.ofNullable(webhookType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhookType", nulls = Nulls.SKIP) + public _FinalStage webhookType(Optional webhookType) { + this.webhookType = webhookType; + return this; + } + @java.lang.Override public Log build() { return new Log( time, orgId, type, + webhookType, resource, requestDurationSeconds, requestStartedAt, diff --git a/src/main/java/com/vapi/api/types/LogResource.java b/src/main/java/com/vapi/api/types/LogResource.java index c7b6d38..5010e9e 100644 --- a/src/main/java/com/vapi/api/types/LogResource.java +++ b/src/main/java/com/vapi/api/types/LogResource.java @@ -6,12 +6,28 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum LogResource { + ORG("org"), + ASSISTANT("assistant"), + ANALYTICS("analytics"), + + CREDENTIAL("credential"), + PHONE_NUMBER("phone-number"), + BLOCK("block"), + + VOICE_LIBRARY("voice-library"), + + PROVIDER("provider"), + TOOL("tool"), + TOKEN("token"), + + TEMPLATE("template"), + SQUAD("squad"), CALL("call"), diff --git a/src/main/java/com/vapi/api/types/MakeCredential.java b/src/main/java/com/vapi/api/types/MakeCredential.java index 407d3d3..f322077 100644 --- a/src/main/java/com/vapi/api/types/MakeCredential.java +++ b/src/main/java/com/vapi/api/types/MakeCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -34,6 +36,8 @@ public final class MakeCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private MakeCredential( @@ -44,6 +48,7 @@ private MakeCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.teamId = teamId; this.region = region; @@ -52,6 +57,7 @@ private MakeCredential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -116,6 +122,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -134,12 +148,14 @@ private boolean equalTo(MakeCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.teamId, this.region, this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash( + this.teamId, this.region, this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -183,6 +199,10 @@ public interface UpdatedAtStage { public interface _FinalStage { MakeCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -209,6 +229,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -223,6 +245,7 @@ public Builder from(MakeCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -303,9 +326,27 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public MakeCredential build() { - return new MakeCredential(teamId, region, apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new MakeCredential( + teamId, region, apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/MakeToolWithToolCall.java b/src/main/java/com/vapi/api/types/MakeToolWithToolCall.java index a63d927..d25f12b 100644 --- a/src/main/java/com/vapi/api/types/MakeToolWithToolCall.java +++ b/src/main/java/com/vapi/api/types/MakeToolWithToolCall.java @@ -73,6 +73,14 @@ public Optional> getMessages() { return messages; } + /** + * @return The type of tool. "make" for Make tool. + */ + @JsonProperty("type") + public String getType() { + return "make"; + } + @JsonProperty("toolCall") public ToolCall getToolCall() { return toolCall; diff --git a/src/main/java/com/vapi/api/types/NeetsVoice.java b/src/main/java/com/vapi/api/types/NeetsVoice.java index f88f3ae..87f7f52 100644 --- a/src/main/java/com/vapi/api/types/NeetsVoice.java +++ b/src/main/java/com/vapi/api/types/NeetsVoice.java @@ -21,34 +21,25 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = NeetsVoice.Builder.class) public final class NeetsVoice { - private final Optional fillerInjectionEnabled; - private final NeetsVoiceId voiceId; private final Optional chunkPlan; + private final Optional fallbackPlan; + private final Map additionalProperties; private NeetsVoice( - Optional fillerInjectionEnabled, NeetsVoiceId voiceId, Optional chunkPlan, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.chunkPlan = chunkPlan; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. */ @@ -65,6 +56,14 @@ public Optional getChunkPlan() { return chunkPlan; } + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +76,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(NeetsVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) - && chunkPlan.equals(other.chunkPlan); + return voiceId.equals(other.voiceId) + && chunkPlan.equals(other.chunkPlan) + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.voiceId, this.chunkPlan); + return Objects.hash(this.voiceId, this.chunkPlan, this.fallbackPlan); } @java.lang.Override @@ -105,22 +104,22 @@ public interface VoiceIdStage { public interface _FinalStage { NeetsVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private NeetsVoiceId voiceId; - private Optional chunkPlan = Optional.empty(); + private Optional fallbackPlan = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); + private Optional chunkPlan = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -129,9 +128,9 @@ private Builder() {} @java.lang.Override public Builder from(NeetsVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); chunkPlan(other.getChunkPlan()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -147,43 +146,42 @@ public _FinalStage voiceId(@NotNull NeetsVoiceId voiceId) { } /** - *

      This is the plan for chunking the model output before it is sent to the voice provider.

      + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      + *

      This is the plan for chunking the model output before it is sent to the voice provider.

      * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); return this; } @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; return this; } @java.lang.Override public NeetsVoice build() { - return new NeetsVoice(fillerInjectionEnabled, voiceId, chunkPlan, additionalProperties); + return new NeetsVoice(voiceId, chunkPlan, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/OAuth2AuthenticationPlan.java b/src/main/java/com/vapi/api/types/OAuth2AuthenticationPlan.java new file mode 100644 index 0000000..76a9579 --- /dev/null +++ b/src/main/java/com/vapi/api/types/OAuth2AuthenticationPlan.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OAuth2AuthenticationPlan.Builder.class) +public final class OAuth2AuthenticationPlan { + private final String url; + + private final String clientId; + + private final String clientSecret; + + private final Map additionalProperties; + + private OAuth2AuthenticationPlan( + String url, String clientId, String clientSecret, Map additionalProperties) { + this.url = url; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return "oauth2"; + } + + /** + * @return This is the OAuth2 URL. + */ + @JsonProperty("url") + public String getUrl() { + return url; + } + + /** + * @return This is the OAuth2 client ID. + */ + @JsonProperty("clientId") + public String getClientId() { + return clientId; + } + + /** + * @return This is the OAuth2 client secret. + */ + @JsonProperty("clientSecret") + public String getClientSecret() { + return clientSecret; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OAuth2AuthenticationPlan && equalTo((OAuth2AuthenticationPlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OAuth2AuthenticationPlan other) { + return url.equals(other.url) && clientId.equals(other.clientId) && clientSecret.equals(other.clientSecret); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.clientId, this.clientSecret); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + ClientIdStage url(@NotNull String url); + + Builder from(OAuth2AuthenticationPlan other); + } + + public interface ClientIdStage { + ClientSecretStage clientId(@NotNull String clientId); + } + + public interface ClientSecretStage { + _FinalStage clientSecret(@NotNull String clientSecret); + } + + public interface _FinalStage { + OAuth2AuthenticationPlan build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, ClientIdStage, ClientSecretStage, _FinalStage { + private String url; + + private String clientId; + + private String clientSecret; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(OAuth2AuthenticationPlan other) { + url(other.getUrl()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + return this; + } + + /** + *

      This is the OAuth2 URL.

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

      This is the OAuth2 client ID.

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

      This is the OAuth2 client secret.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("clientSecret") + public _FinalStage clientSecret(@NotNull String clientSecret) { + this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); + return this; + } + + @java.lang.Override + public OAuth2AuthenticationPlan build() { + return new OAuth2AuthenticationPlan(url, clientId, clientSecret, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/Oauth2AuthenticationSession.java b/src/main/java/com/vapi/api/types/Oauth2AuthenticationSession.java new file mode 100644 index 0000000..869899e --- /dev/null +++ b/src/main/java/com/vapi/api/types/Oauth2AuthenticationSession.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Oauth2AuthenticationSession.Builder.class) +public final class Oauth2AuthenticationSession { + private final Optional accessToken; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private Oauth2AuthenticationSession( + Optional accessToken, + Optional expiresAt, + Map additionalProperties) { + this.accessToken = accessToken; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the OAuth2 access token. + */ + @JsonProperty("accessToken") + public Optional getAccessToken() { + return accessToken; + } + + /** + * @return This is the OAuth2 access token expiration. + */ + @JsonProperty("expiresAt") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Oauth2AuthenticationSession && equalTo((Oauth2AuthenticationSession) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Oauth2AuthenticationSession other) { + return accessToken.equals(other.accessToken) && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accessToken, this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accessToken = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Oauth2AuthenticationSession other) { + accessToken(other.getAccessToken()); + expiresAt(other.getExpiresAt()); + return this; + } + + @JsonSetter(value = "accessToken", nulls = Nulls.SKIP) + public Builder accessToken(Optional accessToken) { + this.accessToken = accessToken; + return this; + } + + public Builder accessToken(String accessToken) { + this.accessToken = Optional.ofNullable(accessToken); + return this; + } + + @JsonSetter(value = "expiresAt", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public Oauth2AuthenticationSession build() { + return new Oauth2AuthenticationSession(accessToken, expiresAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/OpenAiCredential.java b/src/main/java/com/vapi/api/types/OpenAiCredential.java index 9696539..8aefd95 100644 --- a/src/main/java/com/vapi/api/types/OpenAiCredential.java +++ b/src/main/java/com/vapi/api/types/OpenAiCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class OpenAiCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private OpenAiCredential( @@ -38,12 +42,14 @@ private OpenAiCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(OpenAiCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { OpenAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(OpenAiCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public OpenAiCredential build() { - return new OpenAiCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new OpenAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/OpenAiFunction.java b/src/main/java/com/vapi/api/types/OpenAiFunction.java index b3d2d21..e527995 100644 --- a/src/main/java/com/vapi/api/types/OpenAiFunction.java +++ b/src/main/java/com/vapi/api/types/OpenAiFunction.java @@ -21,6 +21,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = OpenAiFunction.Builder.class) public final class OpenAiFunction { + private final Optional strict; + private final String name; private final Optional description; @@ -30,16 +32,27 @@ public final class OpenAiFunction { private final Map additionalProperties; private OpenAiFunction( + Optional strict, String name, Optional description, Optional parameters, Map additionalProperties) { + this.strict = strict; this.name = name; this.description = description; this.parameters = parameters; this.additionalProperties = additionalProperties; } + /** + * @return This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the OpenAI guide. + *

      @default false

      + */ + @JsonProperty("strict") + public Optional getStrict() { + return strict; + } + /** * @return This is the the name of the function to be called. *

      Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

      @@ -49,6 +62,9 @@ public String getName() { return name; } + /** + * @return This is the description of what the function does, used by the AI to choose when and how to call the function. + */ @JsonProperty("description") public Optional getDescription() { return description; @@ -76,12 +92,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(OpenAiFunction other) { - return name.equals(other.name) && description.equals(other.description) && parameters.equals(other.parameters); + return strict.equals(other.strict) + && name.equals(other.name) + && description.equals(other.description) + && parameters.equals(other.parameters); } @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.description, this.parameters); + return Objects.hash(this.strict, this.name, this.description, this.parameters); } @java.lang.Override @@ -102,6 +121,10 @@ public interface NameStage { public interface _FinalStage { OpenAiFunction build(); + _FinalStage strict(Optional strict); + + _FinalStage strict(Boolean strict); + _FinalStage description(Optional description); _FinalStage description(String description); @@ -119,6 +142,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional description = Optional.empty(); + private Optional strict = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -126,6 +151,7 @@ private Builder() {} @java.lang.Override public Builder from(OpenAiFunction other) { + strict(other.getStrict()); name(other.getName()); description(other.getDescription()); parameters(other.getParameters()); @@ -163,6 +189,10 @@ public _FinalStage parameters(Optional parameters) { return this; } + /** + *

      This is the description of what the function does, used by the AI to choose when and how to call the function.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); @@ -176,9 +206,27 @@ public _FinalStage description(Optional description) { return this; } + /** + *

      This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the OpenAI guide.

      + *

      @default false

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage strict(Boolean strict) { + this.strict = Optional.ofNullable(strict); + return this; + } + + @java.lang.Override + @JsonSetter(value = "strict", nulls = Nulls.SKIP) + public _FinalStage strict(Optional strict) { + this.strict = strict; + return this; + } + @java.lang.Override public OpenAiFunction build() { - return new OpenAiFunction(name, description, parameters, additionalProperties); + return new OpenAiFunction(strict, name, description, parameters, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/OpenAiModel.java b/src/main/java/com/vapi/api/types/OpenAiModel.java index a1bd684..0c40962 100644 --- a/src/main/java/com/vapi/api/types/OpenAiModel.java +++ b/src/main/java/com/vapi/api/types/OpenAiModel.java @@ -28,6 +28,10 @@ public final class OpenAiModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final OpenAiModelModel model; private final Optional> fallbackModels; @@ -36,8 +40,6 @@ public final class OpenAiModel { private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -50,11 +52,12 @@ private OpenAiModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, OpenAiModelModel model, Optional> fallbackModels, Optional semanticCachingEnabled, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -62,11 +65,12 @@ private OpenAiModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.fallbackModels = fallbackModels; this.semanticCachingEnabled = semanticCachingEnabled; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -99,6 +103,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the OpenAI model that will be used. */ @@ -128,14 +148,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -179,11 +191,12 @@ private boolean equalTo(OpenAiModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && fallbackModels.equals(other.fallbackModels) && semanticCachingEnabled.equals(other.semanticCachingEnabled) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -195,11 +208,12 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.fallbackModels, this.semanticCachingEnabled, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -235,6 +249,14 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); + _FinalStage knowledgeBase(Optional knowledgeBase); + + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); + + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); + + _FinalStage knowledgeBaseId(String knowledgeBaseId); + _FinalStage fallbackModels(Optional> fallbackModels); _FinalStage fallbackModels(List fallbackModels); @@ -247,10 +269,6 @@ public interface _FinalStage { _FinalStage temperature(Double temperature); - _FinalStage knowledgeBase(Optional knowledgeBase); - - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); - _FinalStage maxTokens(Optional maxTokens); _FinalStage maxTokens(Double maxTokens); @@ -274,14 +292,16 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); private Optional semanticCachingEnabled = Optional.empty(); private Optional> fallbackModels = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -298,11 +318,12 @@ public Builder from(OpenAiModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); fallbackModels(other.getFallbackModels()); semanticCachingEnabled(other.getSemanticCachingEnabled()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -375,23 +396,6 @@ public _FinalStage maxTokens(Optional maxTokens) { return this; } - /** - *

      These are the options for the knowledge base.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -439,6 +443,40 @@ public _FinalStage fallbackModels(Optional> return this; } + /** + *

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

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

      These are the tools that the assistant can use during the call. To use transient tools, use tools.

      *

      Both tools and toolIds can be used together.

      @@ -498,11 +536,12 @@ public OpenAiModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, fallbackModels, semanticCachingEnabled, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/OpenAiModelFallbackModelsItem.java b/src/main/java/com/vapi/api/types/OpenAiModelFallbackModelsItem.java index 0f2bb6b..b858fbf 100644 --- a/src/main/java/com/vapi/api/types/OpenAiModelFallbackModelsItem.java +++ b/src/main/java/com/vapi/api/types/OpenAiModelFallbackModelsItem.java @@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum OpenAiModelFallbackModelsItem { + GPT_4_O_REALTIME_PREVIEW_20241001("gpt-4o-realtime-preview-2024-10-01"), + GPT_4_O_MINI("gpt-4o-mini"), GPT_4_O_MINI_20240718("gpt-4o-mini-2024-07-18"), @@ -16,6 +18,8 @@ public enum OpenAiModelFallbackModelsItem { GPT_4_O_20240806("gpt-4o-2024-08-06"), + GPT_4_O_20241120("gpt-4o-2024-11-20"), + GPT_4_TURBO("gpt-4-turbo"), GPT_4_TURBO_20240409("gpt-4-turbo-2024-04-09"), diff --git a/src/main/java/com/vapi/api/types/OpenAiModelModel.java b/src/main/java/com/vapi/api/types/OpenAiModelModel.java index 61d3bda..2fbb8eb 100644 --- a/src/main/java/com/vapi/api/types/OpenAiModelModel.java +++ b/src/main/java/com/vapi/api/types/OpenAiModelModel.java @@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum OpenAiModelModel { + GPT_4_O_REALTIME_PREVIEW_20241001("gpt-4o-realtime-preview-2024-10-01"), + GPT_4_O_MINI("gpt-4o-mini"), GPT_4_O_MINI_20240718("gpt-4o-mini-2024-07-18"), @@ -16,6 +18,8 @@ public enum OpenAiModelModel { GPT_4_O_20240806("gpt-4o-2024-08-06"), + GPT_4_O_20241120("gpt-4o-2024-11-20"), + GPT_4_TURBO("gpt-4-turbo"), GPT_4_TURBO_20240409("gpt-4-turbo-2024-04-09"), diff --git a/src/main/java/com/vapi/api/types/OpenAiVoice.java b/src/main/java/com/vapi/api/types/OpenAiVoice.java index 7fab7da..72e231d 100644 --- a/src/main/java/com/vapi/api/types/OpenAiVoice.java +++ b/src/main/java/com/vapi/api/types/OpenAiVoice.java @@ -21,40 +21,32 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = OpenAiVoice.Builder.class) public final class OpenAiVoice { - private final Optional fillerInjectionEnabled; - private final OpenAiVoiceId voiceId; private final Optional speed; private final Optional chunkPlan; + private final Optional fallbackPlan; + private final Map additionalProperties; private OpenAiVoice( - Optional fillerInjectionEnabled, OpenAiVoiceId voiceId, Optional speed, Optional chunkPlan, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.speed = speed; this.chunkPlan = chunkPlan; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. + * Please note that ash, ballad, coral, sage, and verse may only be used with the gpt-4o-realtime-preview-2024-10-01 model. */ @JsonProperty("voiceId") public OpenAiVoiceId getVoiceId() { @@ -77,6 +69,14 @@ public Optional getChunkPlan() { return chunkPlan; } + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -89,15 +89,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(OpenAiVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) + return voiceId.equals(other.voiceId) && speed.equals(other.speed) - && chunkPlan.equals(other.chunkPlan); + && chunkPlan.equals(other.chunkPlan) + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.voiceId, this.speed, this.chunkPlan); + return Objects.hash(this.voiceId, this.speed, this.chunkPlan, this.fallbackPlan); } @java.lang.Override @@ -118,10 +118,6 @@ public interface VoiceIdStage { public interface _FinalStage { OpenAiVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage speed(Optional speed); _FinalStage speed(Double speed); @@ -129,18 +125,22 @@ public interface _FinalStage { _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private OpenAiVoiceId voiceId; + private Optional fallbackPlan = Optional.empty(); + private Optional chunkPlan = Optional.empty(); private Optional speed = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -148,15 +148,16 @@ private Builder() {} @java.lang.Override public Builder from(OpenAiVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); speed(other.getSpeed()); chunkPlan(other.getChunkPlan()); + fallbackPlan(other.getFallbackPlan()); return this; } /** - *

      This is the provider-specific ID that will be used.

      + *

      This is the provider-specific ID that will be used. + * Please note that ash, ballad, coral, sage, and verse may only be used with the gpt-4o-realtime-preview-2024-10-01 model.

      * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -166,6 +167,23 @@ public _FinalStage voiceId(@NotNull OpenAiVoiceId voiceId) { return this; } + /** + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -200,27 +218,9 @@ public _FinalStage speed(Optional speed) { return this; } - /** - *

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; - return this; - } - @java.lang.Override public OpenAiVoice build() { - return new OpenAiVoice(fillerInjectionEnabled, voiceId, speed, chunkPlan, additionalProperties); + return new OpenAiVoice(voiceId, speed, chunkPlan, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/OpenAiVoiceId.java b/src/main/java/com/vapi/api/types/OpenAiVoiceId.java index 7881eb7..5422215 100644 --- a/src/main/java/com/vapi/api/types/OpenAiVoiceId.java +++ b/src/main/java/com/vapi/api/types/OpenAiVoiceId.java @@ -16,7 +16,17 @@ public enum OpenAiVoiceId { NOVA("nova"), - SHIMMER("shimmer"); + SHIMMER("shimmer"), + + ASH("ash"), + + BALLAD("ballad"), + + CORAL("coral"), + + SAGE("sage"), + + VERSE("verse"); private final String value; diff --git a/src/main/java/com/vapi/api/types/OpenRouterCredential.java b/src/main/java/com/vapi/api/types/OpenRouterCredential.java index 36443fc..607ce31 100644 --- a/src/main/java/com/vapi/api/types/OpenRouterCredential.java +++ b/src/main/java/com/vapi/api/types/OpenRouterCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class OpenRouterCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private OpenRouterCredential( @@ -38,12 +42,14 @@ private OpenRouterCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(OpenRouterCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { OpenRouterCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(OpenRouterCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public OpenRouterCredential build() { - return new OpenRouterCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new OpenRouterCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/OpenRouterModel.java b/src/main/java/com/vapi/api/types/OpenRouterModel.java index 11c83de..3c08b53 100644 --- a/src/main/java/com/vapi/api/types/OpenRouterModel.java +++ b/src/main/java/com/vapi/api/types/OpenRouterModel.java @@ -28,12 +28,14 @@ public final class OpenRouterModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final String model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private OpenRouterModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private OpenRouterModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(OpenRouterModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(OpenRouterModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

      These are the options for the knowledge base.

      + *

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

      + *

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public OpenRouterModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/Org.java b/src/main/java/com/vapi/api/types/Org.java index 44c22b3..55bbe8b 100644 --- a/src/main/java/com/vapi/api/types/Org.java +++ b/src/main/java/com/vapi/api/types/Org.java @@ -24,6 +24,10 @@ public final class Org { private final Optional hipaaEnabled; + private final Optional subscription; + + private final Optional subscriptionId; + private final String id; private final OffsetDateTime createdAt; @@ -44,6 +48,8 @@ public final class Org { private final Optional name; + private final Optional channel; + private final Optional billingLimit; private final Optional serverUrl; @@ -56,6 +62,8 @@ public final class Org { private Org( Optional hipaaEnabled, + Optional subscription, + Optional subscriptionId, String id, OffsetDateTime createdAt, OffsetDateTime updatedAt, @@ -66,12 +74,15 @@ private Org( Optional stripeSubscriptionStatus, Optional plan, Optional name, + Optional channel, Optional billingLimit, Optional serverUrl, Optional serverUrlSecret, Optional concurrencyLimit, Map additionalProperties) { this.hipaaEnabled = hipaaEnabled; + this.subscription = subscription; + this.subscriptionId = subscriptionId; this.id = id; this.createdAt = createdAt; this.updatedAt = updatedAt; @@ -82,6 +93,7 @@ private Org( this.stripeSubscriptionStatus = stripeSubscriptionStatus; this.plan = plan; this.name = name; + this.channel = channel; this.billingLimit = billingLimit; this.serverUrl = serverUrl; this.serverUrlSecret = serverUrlSecret; @@ -99,6 +111,19 @@ public Optional getHipaaEnabled() { return hipaaEnabled; } + @JsonProperty("subscription") + public Optional getSubscription() { + return subscription; + } + + /** + * @return This is the ID of the subscription the org belongs to. + */ + @JsonProperty("subscriptionId") + public Optional getSubscriptionId() { + return subscriptionId; + } + /** * @return This is the unique identifier for the org. */ @@ -179,6 +204,14 @@ public Optional getName() { return name; } + /** + * @return This is the channel of the org. There is the cluster the API traffic for the org will be directed. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + /** * @return This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. */ @@ -225,6 +258,8 @@ public Map getAdditionalProperties() { private boolean equalTo(Org other) { return hipaaEnabled.equals(other.hipaaEnabled) + && subscription.equals(other.subscription) + && subscriptionId.equals(other.subscriptionId) && id.equals(other.id) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) @@ -235,6 +270,7 @@ private boolean equalTo(Org other) { && stripeSubscriptionStatus.equals(other.stripeSubscriptionStatus) && plan.equals(other.plan) && name.equals(other.name) + && channel.equals(other.channel) && billingLimit.equals(other.billingLimit) && serverUrl.equals(other.serverUrl) && serverUrlSecret.equals(other.serverUrlSecret) @@ -245,6 +281,8 @@ private boolean equalTo(Org other) { public int hashCode() { return Objects.hash( this.hipaaEnabled, + this.subscription, + this.subscriptionId, this.id, this.createdAt, this.updatedAt, @@ -255,6 +293,7 @@ public int hashCode() { this.stripeSubscriptionStatus, this.plan, this.name, + this.channel, this.billingLimit, this.serverUrl, this.serverUrlSecret, @@ -291,6 +330,14 @@ public interface _FinalStage { _FinalStage hipaaEnabled(Boolean hipaaEnabled); + _FinalStage subscription(Optional subscription); + + _FinalStage subscription(Subscription subscription); + + _FinalStage subscriptionId(Optional subscriptionId); + + _FinalStage subscriptionId(String subscriptionId); + _FinalStage stripeCustomerId(Optional stripeCustomerId); _FinalStage stripeCustomerId(String stripeCustomerId); @@ -319,6 +366,10 @@ public interface _FinalStage { _FinalStage name(String name); + _FinalStage channel(Optional channel); + + _FinalStage channel(OrgChannel channel); + _FinalStage billingLimit(Optional billingLimit); _FinalStage billingLimit(Double billingLimit); @@ -352,6 +403,8 @@ public static final class Builder implements IdStage, CreatedAtStage, UpdatedAtS private Optional billingLimit = Optional.empty(); + private Optional channel = Optional.empty(); + private Optional name = Optional.empty(); private Optional plan = Optional.empty(); @@ -366,6 +419,10 @@ public static final class Builder implements IdStage, CreatedAtStage, UpdatedAtS private Optional stripeCustomerId = Optional.empty(); + private Optional subscriptionId = Optional.empty(); + + private Optional subscription = Optional.empty(); + private Optional hipaaEnabled = Optional.empty(); @JsonAnySetter @@ -376,6 +433,8 @@ private Builder() {} @java.lang.Override public Builder from(Org other) { hipaaEnabled(other.getHipaaEnabled()); + subscription(other.getSubscription()); + subscriptionId(other.getSubscriptionId()); id(other.getId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); @@ -386,6 +445,7 @@ public Builder from(Org other) { stripeSubscriptionStatus(other.getStripeSubscriptionStatus()); plan(other.getPlan()); name(other.getName()); + channel(other.getChannel()); billingLimit(other.getBillingLimit()); serverUrl(other.getServerUrl()); serverUrlSecret(other.getServerUrlSecret()); @@ -495,6 +555,23 @@ public _FinalStage billingLimit(Optional billingLimit) { return this; } + /** + *

      This is the channel of the org. There is the cluster the API traffic for the org will be directed.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage channel(OrgChannel 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; + } + /** *

      This is the name of the org. This is just for your own reference.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -615,6 +692,36 @@ public _FinalStage stripeCustomerId(Optional stripeCustomerId) { return this; } + /** + *

      This is the ID of the subscription the org belongs to.

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

      When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. * When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. @@ -638,6 +745,8 @@ public _FinalStage hipaaEnabled(Optional hipaaEnabled) { public Org build() { return new Org( hipaaEnabled, + subscription, + subscriptionId, id, createdAt, updatedAt, @@ -648,6 +757,7 @@ public Org build() { stripeSubscriptionStatus, plan, name, + channel, billingLimit, serverUrl, serverUrlSecret, diff --git a/src/main/java/com/vapi/api/types/OrgChannel.java b/src/main/java/com/vapi/api/types/OrgChannel.java new file mode 100644 index 0000000..65f437c --- /dev/null +++ b/src/main/java/com/vapi/api/types/OrgChannel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OrgChannel { + DEFAULT("default"), + + WEEKLY("weekly"); + + private final String value; + + OrgChannel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/OrgWithOrgUser.java b/src/main/java/com/vapi/api/types/OrgWithOrgUser.java new file mode 100644 index 0000000..a556a59 --- /dev/null +++ b/src/main/java/com/vapi/api/types/OrgWithOrgUser.java @@ -0,0 +1,832 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrgWithOrgUser.Builder.class) +public final class OrgWithOrgUser { + private final Optional hipaaEnabled; + + private final Optional subscription; + + private final Optional subscriptionId; + + private final String id; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional stripeCustomerId; + + private final Optional stripeSubscriptionId; + + private final Optional stripeSubscriptionItemId; + + private final Optional stripeSubscriptionCurrentPeriodStart; + + private final Optional stripeSubscriptionStatus; + + private final Optional plan; + + private final Optional name; + + private final Optional channel; + + private final Optional billingLimit; + + private final Optional serverUrl; + + private final Optional serverUrlSecret; + + private final Optional concurrencyLimit; + + private final Optional invitedByUserId; + + private final Optional role; + + private final Map additionalProperties; + + private OrgWithOrgUser( + Optional hipaaEnabled, + Optional subscription, + Optional subscriptionId, + String id, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional stripeCustomerId, + Optional stripeSubscriptionId, + Optional stripeSubscriptionItemId, + Optional stripeSubscriptionCurrentPeriodStart, + Optional stripeSubscriptionStatus, + Optional plan, + Optional name, + Optional channel, + Optional billingLimit, + Optional serverUrl, + Optional serverUrlSecret, + Optional concurrencyLimit, + Optional invitedByUserId, + Optional role, + Map additionalProperties) { + this.hipaaEnabled = hipaaEnabled; + this.subscription = subscription; + this.subscriptionId = subscriptionId; + this.id = id; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.stripeCustomerId = stripeCustomerId; + this.stripeSubscriptionId = stripeSubscriptionId; + this.stripeSubscriptionItemId = stripeSubscriptionItemId; + this.stripeSubscriptionCurrentPeriodStart = stripeSubscriptionCurrentPeriodStart; + this.stripeSubscriptionStatus = stripeSubscriptionStatus; + this.plan = plan; + this.name = name; + this.channel = channel; + this.billingLimit = billingLimit; + this.serverUrl = serverUrl; + this.serverUrlSecret = serverUrlSecret; + this.concurrencyLimit = concurrencyLimit; + this.invitedByUserId = invitedByUserId; + this.role = role; + this.additionalProperties = additionalProperties; + } + + /** + * @return When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + * When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. + * This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements. + */ + @JsonProperty("hipaaEnabled") + public Optional getHipaaEnabled() { + return hipaaEnabled; + } + + @JsonProperty("subscription") + public Optional getSubscription() { + return subscription; + } + + /** + * @return This is the ID of the subscription the org belongs to. + */ + @JsonProperty("subscriptionId") + public Optional getSubscriptionId() { + return subscriptionId; + } + + /** + * @return This is the unique identifier for the org. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the ISO 8601 date-time string of when the org was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the org was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the Stripe customer for the org. + */ + @JsonProperty("stripeCustomerId") + public Optional getStripeCustomerId() { + return stripeCustomerId; + } + + /** + * @return This is the subscription for the org. + */ + @JsonProperty("stripeSubscriptionId") + public Optional getStripeSubscriptionId() { + return stripeSubscriptionId; + } + + /** + * @return This is the subscription's subscription item. + */ + @JsonProperty("stripeSubscriptionItemId") + public Optional getStripeSubscriptionItemId() { + return stripeSubscriptionItemId; + } + + /** + * @return This is the subscription's current period start. + */ + @JsonProperty("stripeSubscriptionCurrentPeriodStart") + public Optional getStripeSubscriptionCurrentPeriodStart() { + return stripeSubscriptionCurrentPeriodStart; + } + + /** + * @return This is the subscription's status. + */ + @JsonProperty("stripeSubscriptionStatus") + public Optional getStripeSubscriptionStatus() { + return stripeSubscriptionStatus; + } + + /** + * @return This is the plan for the org. + */ + @JsonProperty("plan") + public Optional getPlan() { + return plan; + } + + /** + * @return This is the name of the org. This is just for your own reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return This is the channel of the org. There is the cluster the API traffic for the org will be directed. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + /** + * @return This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. + */ + @JsonProperty("billingLimit") + public Optional getBillingLimit() { + return billingLimit; + } + + /** + * @return This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + *

      All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

      + */ + @JsonProperty("serverUrl") + public Optional getServerUrl() { + return serverUrl; + } + + /** + * @return This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + */ + @JsonProperty("serverUrlSecret") + public Optional getServerUrlSecret() { + return serverUrlSecret; + } + + /** + * @return This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at support@vapi.ai. + */ + @JsonProperty("concurrencyLimit") + public Optional getConcurrencyLimit() { + return concurrencyLimit; + } + + @JsonProperty("invitedByUserId") + public Optional getInvitedByUserId() { + return invitedByUserId; + } + + @JsonProperty("role") + public Optional getRole() { + return role; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrgWithOrgUser && equalTo((OrgWithOrgUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrgWithOrgUser other) { + return hipaaEnabled.equals(other.hipaaEnabled) + && subscription.equals(other.subscription) + && subscriptionId.equals(other.subscriptionId) + && id.equals(other.id) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && stripeCustomerId.equals(other.stripeCustomerId) + && stripeSubscriptionId.equals(other.stripeSubscriptionId) + && stripeSubscriptionItemId.equals(other.stripeSubscriptionItemId) + && stripeSubscriptionCurrentPeriodStart.equals(other.stripeSubscriptionCurrentPeriodStart) + && stripeSubscriptionStatus.equals(other.stripeSubscriptionStatus) + && plan.equals(other.plan) + && name.equals(other.name) + && channel.equals(other.channel) + && billingLimit.equals(other.billingLimit) + && serverUrl.equals(other.serverUrl) + && serverUrlSecret.equals(other.serverUrlSecret) + && concurrencyLimit.equals(other.concurrencyLimit) + && invitedByUserId.equals(other.invitedByUserId) + && role.equals(other.role); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.hipaaEnabled, + this.subscription, + this.subscriptionId, + this.id, + this.createdAt, + this.updatedAt, + this.stripeCustomerId, + this.stripeSubscriptionId, + this.stripeSubscriptionItemId, + this.stripeSubscriptionCurrentPeriodStart, + this.stripeSubscriptionStatus, + this.plan, + this.name, + this.channel, + this.billingLimit, + this.serverUrl, + this.serverUrlSecret, + this.concurrencyLimit, + this.invitedByUserId, + this.role); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CreatedAtStage id(@NotNull String id); + + Builder from(OrgWithOrgUser other); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + OrgWithOrgUser build(); + + _FinalStage hipaaEnabled(Optional hipaaEnabled); + + _FinalStage hipaaEnabled(Boolean hipaaEnabled); + + _FinalStage subscription(Optional subscription); + + _FinalStage subscription(Subscription subscription); + + _FinalStage subscriptionId(Optional subscriptionId); + + _FinalStage subscriptionId(String subscriptionId); + + _FinalStage stripeCustomerId(Optional stripeCustomerId); + + _FinalStage stripeCustomerId(String stripeCustomerId); + + _FinalStage stripeSubscriptionId(Optional stripeSubscriptionId); + + _FinalStage stripeSubscriptionId(String stripeSubscriptionId); + + _FinalStage stripeSubscriptionItemId(Optional stripeSubscriptionItemId); + + _FinalStage stripeSubscriptionItemId(String stripeSubscriptionItemId); + + _FinalStage stripeSubscriptionCurrentPeriodStart(Optional stripeSubscriptionCurrentPeriodStart); + + _FinalStage stripeSubscriptionCurrentPeriodStart(OffsetDateTime stripeSubscriptionCurrentPeriodStart); + + _FinalStage stripeSubscriptionStatus(Optional stripeSubscriptionStatus); + + _FinalStage stripeSubscriptionStatus(String stripeSubscriptionStatus); + + _FinalStage plan(Optional plan); + + _FinalStage plan(OrgPlan plan); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage channel(Optional channel); + + _FinalStage channel(OrgWithOrgUserChannel channel); + + _FinalStage billingLimit(Optional billingLimit); + + _FinalStage billingLimit(Double billingLimit); + + _FinalStage serverUrl(Optional serverUrl); + + _FinalStage serverUrl(String serverUrl); + + _FinalStage serverUrlSecret(Optional serverUrlSecret); + + _FinalStage serverUrlSecret(String serverUrlSecret); + + _FinalStage concurrencyLimit(Optional concurrencyLimit); + + _FinalStage concurrencyLimit(Double concurrencyLimit); + + _FinalStage invitedByUserId(Optional invitedByUserId); + + _FinalStage invitedByUserId(String invitedByUserId); + + _FinalStage role(Optional role); + + _FinalStage role(OrgWithOrgUserRole role); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional role = Optional.empty(); + + private Optional invitedByUserId = Optional.empty(); + + private Optional concurrencyLimit = Optional.empty(); + + private Optional serverUrlSecret = Optional.empty(); + + private Optional serverUrl = Optional.empty(); + + private Optional billingLimit = Optional.empty(); + + private Optional channel = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional plan = Optional.empty(); + + private Optional stripeSubscriptionStatus = Optional.empty(); + + private Optional stripeSubscriptionCurrentPeriodStart = Optional.empty(); + + private Optional stripeSubscriptionItemId = Optional.empty(); + + private Optional stripeSubscriptionId = Optional.empty(); + + private Optional stripeCustomerId = Optional.empty(); + + private Optional subscriptionId = Optional.empty(); + + private Optional subscription = Optional.empty(); + + private Optional hipaaEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(OrgWithOrgUser other) { + hipaaEnabled(other.getHipaaEnabled()); + subscription(other.getSubscription()); + subscriptionId(other.getSubscriptionId()); + id(other.getId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + stripeCustomerId(other.getStripeCustomerId()); + stripeSubscriptionId(other.getStripeSubscriptionId()); + stripeSubscriptionItemId(other.getStripeSubscriptionItemId()); + stripeSubscriptionCurrentPeriodStart(other.getStripeSubscriptionCurrentPeriodStart()); + stripeSubscriptionStatus(other.getStripeSubscriptionStatus()); + plan(other.getPlan()); + name(other.getName()); + channel(other.getChannel()); + billingLimit(other.getBillingLimit()); + serverUrl(other.getServerUrl()); + serverUrlSecret(other.getServerUrlSecret()); + concurrencyLimit(other.getConcurrencyLimit()); + invitedByUserId(other.getInvitedByUserId()); + role(other.getRole()); + return this; + } + + /** + *

      This is the unique identifier for the org.

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

      This is the ISO 8601 date-time string of when the org was created.

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

      This is the ISO 8601 date-time string of when the org was last updated.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updatedAt") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage role(OrgWithOrgUserRole role) { + this.role = Optional.ofNullable(role); + return this; + } + + @java.lang.Override + @JsonSetter(value = "role", nulls = Nulls.SKIP) + public _FinalStage role(Optional role) { + this.role = role; + return this; + } + + @java.lang.Override + public _FinalStage invitedByUserId(String invitedByUserId) { + this.invitedByUserId = Optional.ofNullable(invitedByUserId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "invitedByUserId", nulls = Nulls.SKIP) + public _FinalStage invitedByUserId(Optional invitedByUserId) { + this.invitedByUserId = invitedByUserId; + return this; + } + + /** + *

      This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at support@vapi.ai.

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

      This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.

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

      This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports.

      + *

      All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.

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

      This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai.

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

      This is the channel of the org. There is the cluster the API traffic for the org will be directed.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage channel(OrgWithOrgUserChannel 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; + } + + /** + *

      This is the name of the org. This is just for your own reference.

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

      This is the plan for the org.

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

      This is the subscription's status.

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

      This is the subscription's current period start.

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

      This is the subscription's subscription item.

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

      This is the subscription for the org.

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

      This is the Stripe customer for the org.

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

      This is the ID of the subscription the org belongs to.

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

      When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + * When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. + * This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hipaaEnabled(Boolean hipaaEnabled) { + this.hipaaEnabled = Optional.ofNullable(hipaaEnabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hipaaEnabled", nulls = Nulls.SKIP) + public _FinalStage hipaaEnabled(Optional hipaaEnabled) { + this.hipaaEnabled = hipaaEnabled; + return this; + } + + @java.lang.Override + public OrgWithOrgUser build() { + return new OrgWithOrgUser( + hipaaEnabled, + subscription, + subscriptionId, + id, + createdAt, + updatedAt, + stripeCustomerId, + stripeSubscriptionId, + stripeSubscriptionItemId, + stripeSubscriptionCurrentPeriodStart, + stripeSubscriptionStatus, + plan, + name, + channel, + billingLimit, + serverUrl, + serverUrlSecret, + concurrencyLimit, + invitedByUserId, + role, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/OrgWithOrgUserChannel.java b/src/main/java/com/vapi/api/types/OrgWithOrgUserChannel.java new file mode 100644 index 0000000..62ab37b --- /dev/null +++ b/src/main/java/com/vapi/api/types/OrgWithOrgUserChannel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OrgWithOrgUserChannel { + DEFAULT("default"), + + WEEKLY("weekly"); + + private final String value; + + OrgWithOrgUserChannel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/OrgWithOrgUserRole.java b/src/main/java/com/vapi/api/types/OrgWithOrgUserRole.java new file mode 100644 index 0000000..49c7f99 --- /dev/null +++ b/src/main/java/com/vapi/api/types/OrgWithOrgUserRole.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OrgWithOrgUserRole { + ADMIN("admin"), + + EDITOR("editor"), + + VIEWER("viewer"); + + private final String value; + + OrgWithOrgUserRole(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/Payment.java b/src/main/java/com/vapi/api/types/Payment.java new file mode 100644 index 0000000..cf10842 --- /dev/null +++ b/src/main/java/com/vapi/api/types/Payment.java @@ -0,0 +1,574 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +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 = Payment.Builder.class) +public final class Payment { + private final String id; + + private final Optional orgId; + + private final String cost; + + private final List> costs; + + private final PaymentStatus status; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final boolean isAutoReload; + + private final String subscriptionId; + + private final Optional callId; + + private final Optional phoneNumberId; + + private final Optional stripePaymentIntentId; + + private final Optional stripeInvoiceId; + + private final Map additionalProperties; + + private Payment( + String id, + Optional orgId, + String cost, + List> costs, + PaymentStatus status, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + boolean isAutoReload, + String subscriptionId, + Optional callId, + Optional phoneNumberId, + Optional stripePaymentIntentId, + Optional stripeInvoiceId, + Map additionalProperties) { + this.id = id; + this.orgId = orgId; + this.cost = cost; + this.costs = costs; + this.status = status; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.isAutoReload = isAutoReload; + this.subscriptionId = subscriptionId; + this.callId = callId; + this.phoneNumberId = phoneNumberId; + this.stripePaymentIntentId = stripePaymentIntentId; + this.stripeInvoiceId = stripeInvoiceId; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the id of the payment + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the id of the org + */ + @JsonProperty("orgId") + public Optional getOrgId() { + return orgId; + } + + /** + * @return This is the total cost of the payment, which is the sum of all the costs in the costs object. + *

      Note: this is a string to avoid floating point precision issues.

      + */ + @JsonProperty("cost") + public String getCost() { + return cost; + } + + /** + * @return This is the itemized breakdown of payment amounts + */ + @JsonProperty("costs") + public List> getCosts() { + return costs; + } + + /** + * @return This is the status of the payment + */ + @JsonProperty("status") + public PaymentStatus getStatus() { + return status; + } + + /** + * @return This is the timestamp when the payment was created + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the timestamp when the payment was last updated + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This indicates if this payment was automatically generated by the auto-reload feature + */ + @JsonProperty("isAutoReload") + public boolean getIsAutoReload() { + return isAutoReload; + } + + /** + * @return This is the id of the subscription the payment belongs to + */ + @JsonProperty("subscriptionId") + public String getSubscriptionId() { + return subscriptionId; + } + + /** + * @return This is the id of the call + */ + @JsonProperty("callId") + public Optional getCallId() { + return callId; + } + + /** + * @return This is the id of the purchased phone number + */ + @JsonProperty("phoneNumberId") + public Optional getPhoneNumberId() { + return phoneNumberId; + } + + /** + * @return This is the id of the associated stripe payment intent + */ + @JsonProperty("stripePaymentIntentId") + public Optional getStripePaymentIntentId() { + return stripePaymentIntentId; + } + + /** + * @return This is the id of the associated stripe invoice + */ + @JsonProperty("stripeInvoiceId") + public Optional getStripeInvoiceId() { + return stripeInvoiceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Payment && equalTo((Payment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Payment other) { + return id.equals(other.id) + && orgId.equals(other.orgId) + && cost.equals(other.cost) + && costs.equals(other.costs) + && status.equals(other.status) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && isAutoReload == other.isAutoReload + && subscriptionId.equals(other.subscriptionId) + && callId.equals(other.callId) + && phoneNumberId.equals(other.phoneNumberId) + && stripePaymentIntentId.equals(other.stripePaymentIntentId) + && stripeInvoiceId.equals(other.stripeInvoiceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.orgId, + this.cost, + this.costs, + this.status, + this.createdAt, + this.updatedAt, + this.isAutoReload, + this.subscriptionId, + this.callId, + this.phoneNumberId, + this.stripePaymentIntentId, + this.stripeInvoiceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CostStage id(@NotNull String id); + + Builder from(Payment other); + } + + public interface CostStage { + StatusStage cost(@NotNull String cost); + } + + public interface StatusStage { + CreatedAtStage status(@NotNull PaymentStatus status); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + IsAutoReloadStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface IsAutoReloadStage { + SubscriptionIdStage isAutoReload(boolean isAutoReload); + } + + public interface SubscriptionIdStage { + _FinalStage subscriptionId(@NotNull String subscriptionId); + } + + public interface _FinalStage { + Payment build(); + + _FinalStage orgId(Optional orgId); + + _FinalStage orgId(String orgId); + + _FinalStage costs(List> costs); + + _FinalStage addCosts(Map costs); + + _FinalStage addAllCosts(List> costs); + + _FinalStage callId(Optional callId); + + _FinalStage callId(String callId); + + _FinalStage phoneNumberId(Optional phoneNumberId); + + _FinalStage phoneNumberId(String phoneNumberId); + + _FinalStage stripePaymentIntentId(Optional stripePaymentIntentId); + + _FinalStage stripePaymentIntentId(String stripePaymentIntentId); + + _FinalStage stripeInvoiceId(Optional stripeInvoiceId); + + _FinalStage stripeInvoiceId(String stripeInvoiceId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + CostStage, + StatusStage, + CreatedAtStage, + UpdatedAtStage, + IsAutoReloadStage, + SubscriptionIdStage, + _FinalStage { + private String id; + + private String cost; + + private PaymentStatus status; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private boolean isAutoReload; + + private String subscriptionId; + + private Optional stripeInvoiceId = Optional.empty(); + + private Optional stripePaymentIntentId = Optional.empty(); + + private Optional phoneNumberId = Optional.empty(); + + private Optional callId = Optional.empty(); + + private List> costs = new ArrayList<>(); + + private Optional orgId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Payment other) { + id(other.getId()); + orgId(other.getOrgId()); + cost(other.getCost()); + costs(other.getCosts()); + status(other.getStatus()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + isAutoReload(other.getIsAutoReload()); + subscriptionId(other.getSubscriptionId()); + callId(other.getCallId()); + phoneNumberId(other.getPhoneNumberId()); + stripePaymentIntentId(other.getStripePaymentIntentId()); + stripeInvoiceId(other.getStripeInvoiceId()); + return this; + } + + /** + *

      This is the id of the payment

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

      This is the total cost of the payment, which is the sum of all the costs in the costs object.

      + *

      Note: this is a string to avoid floating point precision issues.

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

      This is the status of the payment

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

      This is the timestamp when the payment was created

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

      This is the timestamp when the payment was last updated

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

      This indicates if this payment was automatically generated by the auto-reload feature

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("isAutoReload") + public SubscriptionIdStage isAutoReload(boolean isAutoReload) { + this.isAutoReload = isAutoReload; + return this; + } + + /** + *

      This is the id of the subscription the payment belongs to

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

      This is the id of the associated stripe invoice

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

      This is the id of the associated stripe payment intent

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

      This is the id of the purchased phone number

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

      This is the id of the call

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

      This is the itemized breakdown of payment amounts

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

      This is the itemized breakdown of payment amounts

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCosts(Map costs) { + this.costs.add(costs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "costs", nulls = Nulls.SKIP) + public _FinalStage costs(List> costs) { + this.costs.clear(); + this.costs.addAll(costs); + return this; + } + + /** + *

      This is the id of the org

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage orgId(String orgId) { + this.orgId = Optional.ofNullable(orgId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "orgId", nulls = Nulls.SKIP) + public _FinalStage orgId(Optional orgId) { + this.orgId = orgId; + return this; + } + + @java.lang.Override + public Payment build() { + return new Payment( + id, + orgId, + cost, + costs, + status, + createdAt, + updatedAt, + isAutoReload, + subscriptionId, + callId, + phoneNumberId, + stripePaymentIntentId, + stripeInvoiceId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/PaymentRetryDto.java b/src/main/java/com/vapi/api/types/PaymentRetryDto.java new file mode 100644 index 0000000..021dd15 --- /dev/null +++ b/src/main/java/com/vapi/api/types/PaymentRetryDto.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentRetryDto.Builder.class) +public final class PaymentRetryDto { + private final String paymentId; + + private final Map additionalProperties; + + private PaymentRetryDto(String paymentId, Map additionalProperties) { + this.paymentId = paymentId; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the payment ID to retry. + */ + @JsonProperty("paymentId") + public String getPaymentId() { + return paymentId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRetryDto && equalTo((PaymentRetryDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentRetryDto other) { + return paymentId.equals(other.paymentId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.paymentId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PaymentIdStage builder() { + return new Builder(); + } + + public interface PaymentIdStage { + _FinalStage paymentId(@NotNull String paymentId); + + Builder from(PaymentRetryDto other); + } + + public interface _FinalStage { + PaymentRetryDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PaymentIdStage, _FinalStage { + private String paymentId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PaymentRetryDto other) { + paymentId(other.getPaymentId()); + return this; + } + + /** + *

      This is the payment ID to retry.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("paymentId") + public _FinalStage paymentId(@NotNull String paymentId) { + this.paymentId = Objects.requireNonNull(paymentId, "paymentId must not be null"); + return this; + } + + @java.lang.Override + public PaymentRetryDto build() { + return new PaymentRetryDto(paymentId, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/PaymentStatus.java b/src/main/java/com/vapi/api/types/PaymentStatus.java new file mode 100644 index 0000000..8486a8f --- /dev/null +++ b/src/main/java/com/vapi/api/types/PaymentStatus.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PaymentStatus { + PAST_DUE("past-due"), + + PENDING("pending"), + + FINALIZED("finalized"), + + REFUNDED("refunded"); + + private final String value; + + PaymentStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/PaymentsPaginatedResponse.java b/src/main/java/com/vapi/api/types/PaymentsPaginatedResponse.java new file mode 100644 index 0000000..4414e3b --- /dev/null +++ b/src/main/java/com/vapi/api/types/PaymentsPaginatedResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentsPaginatedResponse.Builder.class) +public final class PaymentsPaginatedResponse { + private final List results; + + private final PaginationMeta metadata; + + private final Map additionalProperties; + + private PaymentsPaginatedResponse( + List results, PaginationMeta metadata, Map additionalProperties) { + this.results = results; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("results") + public List getResults() { + return results; + } + + @JsonProperty("metadata") + public PaginationMeta getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentsPaginatedResponse && equalTo((PaymentsPaginatedResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentsPaginatedResponse other) { + return results.equals(other.results) && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.results, this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MetadataStage builder() { + return new Builder(); + } + + public interface MetadataStage { + _FinalStage metadata(@NotNull PaginationMeta metadata); + + Builder from(PaymentsPaginatedResponse other); + } + + public interface _FinalStage { + PaymentsPaginatedResponse build(); + + _FinalStage results(List results); + + _FinalStage addResults(Payment results); + + _FinalStage addAllResults(List results); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MetadataStage, _FinalStage { + private PaginationMeta metadata; + + private List results = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PaymentsPaginatedResponse other) { + results(other.getResults()); + metadata(other.getMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("metadata") + public _FinalStage metadata(@NotNull PaginationMeta metadata) { + this.metadata = Objects.requireNonNull(metadata, "metadata must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllResults(List results) { + this.results.addAll(results); + return this; + } + + @java.lang.Override + public _FinalStage addResults(Payment results) { + this.results.add(results); + return this; + } + + @java.lang.Override + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public _FinalStage results(List results) { + this.results.clear(); + this.results.addAll(results); + return this; + } + + @java.lang.Override + public PaymentsPaginatedResponse build() { + return new PaymentsPaginatedResponse(results, metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/PerplexityAiCredential.java b/src/main/java/com/vapi/api/types/PerplexityAiCredential.java index d9a69b3..c35c8f5 100644 --- a/src/main/java/com/vapi/api/types/PerplexityAiCredential.java +++ b/src/main/java/com/vapi/api/types/PerplexityAiCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class PerplexityAiCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private PerplexityAiCredential( @@ -38,12 +42,14 @@ private PerplexityAiCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(PerplexityAiCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { PerplexityAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(PerplexityAiCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public PerplexityAiCredential build() { - return new PerplexityAiCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new PerplexityAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/PerplexityAiModel.java b/src/main/java/com/vapi/api/types/PerplexityAiModel.java index f07f962..c835edc 100644 --- a/src/main/java/com/vapi/api/types/PerplexityAiModel.java +++ b/src/main/java/com/vapi/api/types/PerplexityAiModel.java @@ -28,12 +28,14 @@ public final class PerplexityAiModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final String model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private PerplexityAiModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private PerplexityAiModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(PerplexityAiModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(PerplexityAiModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

      These are the options for the knowledge base.

      + *

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

      This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

      + *

      This is the ID of the knowledge base the model will use.

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

      These are the options for the knowledge base.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public PerplexityAiModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/PhoneNumberPaginatedResponse.java b/src/main/java/com/vapi/api/types/PhoneNumberPaginatedResponse.java new file mode 100644 index 0000000..70c67dd --- /dev/null +++ b/src/main/java/com/vapi/api/types/PhoneNumberPaginatedResponse.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneNumberPaginatedResponse.Builder.class) +public final class PhoneNumberPaginatedResponse { + private final List results; + + private final PaginationMeta metadata; + + private final Map additionalProperties; + + private PhoneNumberPaginatedResponse( + List results, + PaginationMeta metadata, + Map additionalProperties) { + this.results = results; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return A list of phone numbers, which can be of any provider type. + */ + @JsonProperty("results") + public List getResults() { + return results; + } + + /** + * @return Metadata about the pagination. + */ + @JsonProperty("metadata") + public PaginationMeta getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneNumberPaginatedResponse && equalTo((PhoneNumberPaginatedResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneNumberPaginatedResponse other) { + return results.equals(other.results) && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.results, this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MetadataStage builder() { + return new Builder(); + } + + public interface MetadataStage { + _FinalStage metadata(@NotNull PaginationMeta metadata); + + Builder from(PhoneNumberPaginatedResponse other); + } + + public interface _FinalStage { + PhoneNumberPaginatedResponse build(); + + _FinalStage results(List results); + + _FinalStage addResults(PhoneNumberPaginatedResponseResultsItem results); + + _FinalStage addAllResults(List results); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MetadataStage, _FinalStage { + private PaginationMeta metadata; + + private List results = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhoneNumberPaginatedResponse other) { + results(other.getResults()); + metadata(other.getMetadata()); + return this; + } + + /** + *

      Metadata about the pagination.

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

      A list of phone numbers, which can be of any provider type.

      + * @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; + } + + /** + *

      A list of phone numbers, which can be of any provider type.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addResults(PhoneNumberPaginatedResponseResultsItem results) { + this.results.add(results); + return this; + } + + @java.lang.Override + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public _FinalStage results(List results) { + this.results.clear(); + this.results.addAll(results); + return this; + } + + @java.lang.Override + public PhoneNumberPaginatedResponse build() { + return new PhoneNumberPaginatedResponse(results, metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/PhoneNumberPaginatedResponseResultsItem.java b/src/main/java/com/vapi/api/types/PhoneNumberPaginatedResponseResultsItem.java new file mode 100644 index 0000000..158ce4a --- /dev/null +++ b/src/main/java/com/vapi/api/types/PhoneNumberPaginatedResponseResultsItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class PhoneNumberPaginatedResponseResultsItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private PhoneNumberPaginatedResponseResultsItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static PhoneNumberPaginatedResponseResultsItem byoPhoneNumber(ByoPhoneNumber value) { + return new PhoneNumberPaginatedResponseResultsItem(new ByoPhoneNumberValue(value)); + } + + public static PhoneNumberPaginatedResponseResultsItem twilio(TwilioPhoneNumber value) { + return new PhoneNumberPaginatedResponseResultsItem(new TwilioValue(value)); + } + + public static PhoneNumberPaginatedResponseResultsItem vonage(VonagePhoneNumber value) { + return new PhoneNumberPaginatedResponseResultsItem(new VonageValue(value)); + } + + public static PhoneNumberPaginatedResponseResultsItem vapi(VapiPhoneNumber value) { + return new PhoneNumberPaginatedResponseResultsItem(new VapiValue(value)); + } + + public boolean isByoPhoneNumber() { + return value instanceof ByoPhoneNumberValue; + } + + public boolean isTwilio() { + return value instanceof TwilioValue; + } + + public boolean isVonage() { + return value instanceof VonageValue; + } + + public boolean isVapi() { + return value instanceof VapiValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getByoPhoneNumber() { + if (isByoPhoneNumber()) { + return Optional.of(((ByoPhoneNumberValue) value).value); + } + return Optional.empty(); + } + + public Optional getTwilio() { + if (isTwilio()) { + return Optional.of(((TwilioValue) value).value); + } + return Optional.empty(); + } + + public Optional getVonage() { + if (isVonage()) { + return Optional.of(((VonageValue) value).value); + } + return Optional.empty(); + } + + public Optional getVapi() { + if (isVapi()) { + return Optional.of(((VapiValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitByoPhoneNumber(ByoPhoneNumber byoPhoneNumber); + + T visitTwilio(TwilioPhoneNumber twilio); + + T visitVonage(VonagePhoneNumber vonage); + + T visitVapi(VapiPhoneNumber vapi); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(ByoPhoneNumberValue.class), + @JsonSubTypes.Type(TwilioValue.class), + @JsonSubTypes.Type(VonageValue.class), + @JsonSubTypes.Type(VapiValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("byo-phone-number") + private static final class ByoPhoneNumberValue implements Value { + @JsonUnwrapped + private ByoPhoneNumber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ByoPhoneNumberValue() {} + + private ByoPhoneNumberValue(ByoPhoneNumber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitByoPhoneNumber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ByoPhoneNumberValue && equalTo((ByoPhoneNumberValue) other); + } + + private boolean equalTo(ByoPhoneNumberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "PhoneNumberPaginatedResponseResultsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("twilio") + private static final class TwilioValue implements Value { + @JsonUnwrapped + private TwilioPhoneNumber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TwilioValue() {} + + private TwilioValue(TwilioPhoneNumber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTwilio(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TwilioValue && equalTo((TwilioValue) other); + } + + private boolean equalTo(TwilioValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "PhoneNumberPaginatedResponseResultsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("vonage") + private static final class VonageValue implements Value { + @JsonUnwrapped + private VonagePhoneNumber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VonageValue() {} + + private VonageValue(VonagePhoneNumber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVonage(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VonageValue && equalTo((VonageValue) other); + } + + private boolean equalTo(VonageValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "PhoneNumberPaginatedResponseResultsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("vapi") + private static final class VapiValue implements Value { + @JsonUnwrapped + private VapiPhoneNumber value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VapiValue() {} + + private VapiValue(VapiPhoneNumber value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVapi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VapiValue && equalTo((VapiValue) other); + } + + private boolean equalTo(VapiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "PhoneNumberPaginatedResponseResultsItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "PhoneNumberPaginatedResponseResultsItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/PlayHtCredential.java b/src/main/java/com/vapi/api/types/PlayHtCredential.java index 7d003c4..67c69c3 100644 --- a/src/main/java/com/vapi/api/types/PlayHtCredential.java +++ b/src/main/java/com/vapi/api/types/PlayHtCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class PlayHtCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final String userId; private final Map additionalProperties; @@ -40,6 +44,7 @@ private PlayHtCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, String userId, Map additionalProperties) { this.apiKey = apiKey; @@ -47,6 +52,7 @@ private PlayHtCredential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.userId = userId; this.additionalProperties = additionalProperties; } @@ -96,6 +102,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @JsonProperty("userId") public String getUserId() { return userId; @@ -118,12 +132,13 @@ private boolean equalTo(PlayHtCredential other) { && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) + && name.equals(other.name) && userId.equals(other.userId); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.userId); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name, this.userId); } @java.lang.Override @@ -163,6 +178,10 @@ public interface UserIdStage { public interface _FinalStage { PlayHtCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -180,6 +199,8 @@ public static final class Builder private String userId; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -192,6 +213,7 @@ public Builder from(PlayHtCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); userId(other.getUserId()); return this; } @@ -258,9 +280,26 @@ public _FinalStage userId(@NotNull String userId) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public PlayHtCredential build() { - return new PlayHtCredential(apiKey, id, orgId, createdAt, updatedAt, userId, additionalProperties); + return new PlayHtCredential(apiKey, id, orgId, createdAt, updatedAt, name, userId, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/PlayHtVoice.java b/src/main/java/com/vapi/api/types/PlayHtVoice.java index 2e35e30..db4a2ff 100644 --- a/src/main/java/com/vapi/api/types/PlayHtVoice.java +++ b/src/main/java/com/vapi/api/types/PlayHtVoice.java @@ -21,8 +21,6 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PlayHtVoice.Builder.class) public final class PlayHtVoice { - private final Optional fillerInjectionEnabled; - private final PlayHtVoiceId voiceId; private final Optional speed; @@ -37,12 +35,17 @@ public final class PlayHtVoice { private final Optional textGuidance; + private final Optional model; + + private final Optional language; + private final Optional chunkPlan; + private final Optional fallbackPlan; + private final Map additionalProperties; private PlayHtVoice( - Optional fillerInjectionEnabled, PlayHtVoiceId voiceId, Optional speed, Optional temperature, @@ -50,9 +53,11 @@ private PlayHtVoice( Optional voiceGuidance, Optional styleGuidance, Optional textGuidance, + Optional model, + Optional language, Optional chunkPlan, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.speed = speed; this.temperature = temperature; @@ -60,19 +65,13 @@ private PlayHtVoice( this.voiceGuidance = voiceGuidance; this.styleGuidance = styleGuidance; this.textGuidance = textGuidance; + this.model = model; + this.language = language; this.chunkPlan = chunkPlan; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. */ @@ -129,6 +128,22 @@ public Optional getTextGuidance() { return textGuidance; } + /** + * @return Playht voice model/engine to use. + */ + @JsonProperty("model") + public Optional getModel() { + return model; + } + + /** + * @return The language to use for the speech. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + /** * @return This is the plan for chunking the model output before it is sent to the voice provider. */ @@ -137,6 +152,14 @@ public Optional getChunkPlan() { return chunkPlan; } + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -149,21 +172,22 @@ public Map getAdditionalProperties() { } private boolean equalTo(PlayHtVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) + return voiceId.equals(other.voiceId) && speed.equals(other.speed) && temperature.equals(other.temperature) && emotion.equals(other.emotion) && voiceGuidance.equals(other.voiceGuidance) && styleGuidance.equals(other.styleGuidance) && textGuidance.equals(other.textGuidance) - && chunkPlan.equals(other.chunkPlan); + && model.equals(other.model) + && language.equals(other.language) + && chunkPlan.equals(other.chunkPlan) + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { return Objects.hash( - this.fillerInjectionEnabled, this.voiceId, this.speed, this.temperature, @@ -171,7 +195,10 @@ public int hashCode() { this.voiceGuidance, this.styleGuidance, this.textGuidance, - this.chunkPlan); + this.model, + this.language, + this.chunkPlan, + this.fallbackPlan); } @java.lang.Override @@ -192,10 +219,6 @@ public interface VoiceIdStage { public interface _FinalStage { PlayHtVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage speed(Optional speed); _FinalStage speed(Double speed); @@ -220,17 +243,35 @@ public interface _FinalStage { _FinalStage textGuidance(Double textGuidance); + _FinalStage model(Optional model); + + _FinalStage model(PlayHtVoiceModel model); + + _FinalStage language(Optional language); + + _FinalStage language(PlayHtVoiceLanguage language); + _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private PlayHtVoiceId voiceId; + private Optional fallbackPlan = Optional.empty(); + private Optional chunkPlan = Optional.empty(); + private Optional language = Optional.empty(); + + private Optional model = Optional.empty(); + private Optional textGuidance = Optional.empty(); private Optional styleGuidance = Optional.empty(); @@ -243,8 +284,6 @@ public static final class Builder implements VoiceIdStage, _FinalStage { private Optional speed = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -252,7 +291,6 @@ private Builder() {} @java.lang.Override public Builder from(PlayHtVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); speed(other.getSpeed()); temperature(other.getTemperature()); @@ -260,7 +298,10 @@ public Builder from(PlayHtVoice other) { voiceGuidance(other.getVoiceGuidance()); styleGuidance(other.getStyleGuidance()); textGuidance(other.getTextGuidance()); + model(other.getModel()); + language(other.getLanguage()); chunkPlan(other.getChunkPlan()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -275,6 +316,23 @@ public _FinalStage voiceId(@NotNull PlayHtVoiceId voiceId) { return this; } + /** + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -292,6 +350,40 @@ public _FinalStage chunkPlan(Optional chunkPlan) { return this; } + /** + *

      The language to use for the speech.

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

      Playht voice model/engine to use.

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

      A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -394,28 +486,9 @@ public _FinalStage speed(Optional speed) { return this; } - /** - *

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; - return this; - } - @java.lang.Override public PlayHtVoice build() { return new PlayHtVoice( - fillerInjectionEnabled, voiceId, speed, temperature, @@ -423,7 +496,10 @@ public PlayHtVoice build() { voiceGuidance, styleGuidance, textGuidance, + model, + language, chunkPlan, + fallbackPlan, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/PlayHtVoiceLanguage.java b/src/main/java/com/vapi/api/types/PlayHtVoiceLanguage.java new file mode 100644 index 0000000..0fa4be5 --- /dev/null +++ b/src/main/java/com/vapi/api/types/PlayHtVoiceLanguage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PlayHtVoiceLanguage { + AFRIKAANS("afrikaans"), + + ALBANIAN("albanian"), + + AMHARIC("amharic"), + + ARABIC("arabic"), + + BENGALI("bengali"), + + BULGARIAN("bulgarian"), + + CATALAN("catalan"), + + CROATIAN("croatian"), + + CZECH("czech"), + + DANISH("danish"), + + DUTCH("dutch"), + + ENGLISH("english"), + + FRENCH("french"), + + GALICIAN("galician"), + + GERMAN("german"), + + GREEK("greek"), + + HEBREW("hebrew"), + + HINDI("hindi"), + + HUNGARIAN("hungarian"), + + INDONESIAN("indonesian"), + + ITALIAN("italian"), + + JAPANESE("japanese"), + + KOREAN("korean"), + + MALAY("malay"), + + MANDARIN("mandarin"), + + POLISH("polish"), + + PORTUGUESE("portuguese"), + + RUSSIAN("russian"), + + SERBIAN("serbian"), + + SPANISH("spanish"), + + SWEDISH("swedish"), + + TAGALOG("tagalog"), + + THAI("thai"), + + TURKISH("turkish"), + + UKRAINIAN("ukrainian"), + + URDU("urdu"), + + XHOSA("xhosa"); + + private final String value; + + PlayHtVoiceLanguage(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/PlayHtVoiceModel.java b/src/main/java/com/vapi/api/types/PlayHtVoiceModel.java new file mode 100644 index 0000000..b4c5106 --- /dev/null +++ b/src/main/java/com/vapi/api/types/PlayHtVoiceModel.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PlayHtVoiceModel { + PLAY_HT_20("PlayHT2.0"), + + PLAY_HT_20_TURBO("PlayHT2.0-turbo"), + + PLAY_30_MINI("Play3.0-mini"); + + private final String value; + + PlayHtVoiceModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/RegexOption.java b/src/main/java/com/vapi/api/types/RegexOption.java index a6434f0..8695f89 100644 --- a/src/main/java/com/vapi/api/types/RegexOption.java +++ b/src/main/java/com/vapi/api/types/RegexOption.java @@ -34,7 +34,7 @@ private RegexOption(RegexOptionType type, boolean enabled, Map a /** * @return This is the type of the regex option. Options are: *
        - *
      • ignore-case: Ignores the case of the text being matched.
      • + *
      • ignore-case: Ignores the case of the text being matched. Add
      • *
      • whole-word: Matches whole words only.
      • *
      • multi-line: Matches across multiple lines.
      • *
      @@ -117,7 +117,7 @@ public Builder from(RegexOption other) { /** *

      This is the type of the regex option. Options are:

      *
        - *
      • ignore-case: Ignores the case of the text being matched.
      • + *
      • ignore-case: Ignores the case of the text being matched. Add
      • *
      • whole-word: Matches whole words only.
      • *
      • multi-line: Matches across multiple lines.
      • *
      diff --git a/src/main/java/com/vapi/api/types/RegexReplacement.java b/src/main/java/com/vapi/api/types/RegexReplacement.java index ba7b992..3414b25 100644 --- a/src/main/java/com/vapi/api/types/RegexReplacement.java +++ b/src/main/java/com/vapi/api/types/RegexReplacement.java @@ -40,6 +40,14 @@ private RegexReplacement( /** * @return This is the regex pattern to replace. + *

      Note:

      + *
        + *
      • This works by using the string.replace method in Node.JS. Eg. "hello there".replace(/hello/g, "hi") will return "hi there".
      • + *
      + *

      Hot tip:

      + *
        + *
      • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
      • + *
      */ @JsonProperty("regex") public String getRegex() { @@ -47,7 +55,7 @@ public String getRegex() { } /** - * @return These are the options for the regex replacement. Default all options are disabled. + * @return These are the options for the regex replacement. Defaults to all disabled. *

      @default []

      */ @JsonProperty("options") @@ -133,6 +141,14 @@ public Builder from(RegexReplacement other) { /** *

      This is the regex pattern to replace.

      + *

      Note:

      + *
        + *
      • This works by using the string.replace method in Node.JS. Eg. "hello there".replace(/hello/g, "hi") will return "hi there".
      • + *
      + *

      Hot tip:

      + *
        + *
      • In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
      • + *
      * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -154,7 +170,7 @@ public _FinalStage value(@NotNull String value) { } /** - *

      These are the options for the regex replacement. Default all options are disabled.

      + *

      These are the options for the regex replacement. Defaults to all disabled.

      *

      @default []

      * @return Reference to {@code this} so that method calls can be chained together. */ diff --git a/src/main/java/com/vapi/api/types/RimeAiCredential.java b/src/main/java/com/vapi/api/types/RimeAiCredential.java index c71d572..a69734f 100644 --- a/src/main/java/com/vapi/api/types/RimeAiCredential.java +++ b/src/main/java/com/vapi/api/types/RimeAiCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class RimeAiCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private RimeAiCredential( @@ -38,12 +42,14 @@ private RimeAiCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(RimeAiCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { RimeAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(RimeAiCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public RimeAiCredential build() { - return new RimeAiCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new RimeAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/RimeAiVoice.java b/src/main/java/com/vapi/api/types/RimeAiVoice.java index 8915104..177d0f6 100644 --- a/src/main/java/com/vapi/api/types/RimeAiVoice.java +++ b/src/main/java/com/vapi/api/types/RimeAiVoice.java @@ -21,8 +21,6 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RimeAiVoice.Builder.class) public final class RimeAiVoice { - private final Optional fillerInjectionEnabled; - private final RimeAiVoiceId voiceId; private final Optional model; @@ -31,32 +29,25 @@ public final class RimeAiVoice { private final Optional chunkPlan; + private final Optional fallbackPlan; + private final Map additionalProperties; private RimeAiVoice( - Optional fillerInjectionEnabled, RimeAiVoiceId voiceId, Optional model, Optional speed, Optional chunkPlan, + Optional fallbackPlan, Map additionalProperties) { - this.fillerInjectionEnabled = fillerInjectionEnabled; this.voiceId = voiceId; this.model = model; this.speed = speed; this.chunkPlan = chunkPlan; + this.fallbackPlan = fallbackPlan; this.additionalProperties = additionalProperties; } - /** - * @return This determines whether fillers are injected into the model output before inputting it into the voice provider. - *

      Default false because you can achieve better results with prompting the model.

      - */ - @JsonProperty("fillerInjectionEnabled") - public Optional getFillerInjectionEnabled() { - return fillerInjectionEnabled; - } - /** * @return This is the provider-specific ID that will be used. */ @@ -89,6 +80,14 @@ public Optional getChunkPlan() { return chunkPlan; } + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -101,16 +100,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(RimeAiVoice other) { - return fillerInjectionEnabled.equals(other.fillerInjectionEnabled) - && voiceId.equals(other.voiceId) + return voiceId.equals(other.voiceId) && model.equals(other.model) && speed.equals(other.speed) - && chunkPlan.equals(other.chunkPlan); + && chunkPlan.equals(other.chunkPlan) + && fallbackPlan.equals(other.fallbackPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.fillerInjectionEnabled, this.voiceId, this.model, this.speed, this.chunkPlan); + return Objects.hash(this.voiceId, this.model, this.speed, this.chunkPlan, this.fallbackPlan); } @java.lang.Override @@ -131,10 +130,6 @@ public interface VoiceIdStage { public interface _FinalStage { RimeAiVoice build(); - _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled); - - _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled); - _FinalStage model(Optional model); _FinalStage model(RimeAiVoiceModel model); @@ -146,20 +141,24 @@ public interface _FinalStage { _FinalStage chunkPlan(Optional chunkPlan); _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements VoiceIdStage, _FinalStage { private RimeAiVoiceId voiceId; + private Optional fallbackPlan = Optional.empty(); + private Optional chunkPlan = Optional.empty(); private Optional speed = Optional.empty(); private Optional model = Optional.empty(); - private Optional fillerInjectionEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -167,11 +166,11 @@ private Builder() {} @java.lang.Override public Builder from(RimeAiVoice other) { - fillerInjectionEnabled(other.getFillerInjectionEnabled()); voiceId(other.getVoiceId()); model(other.getModel()); speed(other.getSpeed()); chunkPlan(other.getChunkPlan()); + fallbackPlan(other.getFallbackPlan()); return this; } @@ -186,6 +185,23 @@ public _FinalStage voiceId(@NotNull RimeAiVoiceId voiceId) { return this; } + /** + *

      This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

      This is the plan for chunking the model output before it is sent to the voice provider.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -237,27 +253,9 @@ public _FinalStage model(Optional model) { return this; } - /** - *

      This determines whether fillers are injected into the model output before inputting it into the voice provider.

      - *

      Default false because you can achieve better results with prompting the model.

      - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fillerInjectionEnabled(Boolean fillerInjectionEnabled) { - this.fillerInjectionEnabled = Optional.ofNullable(fillerInjectionEnabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "fillerInjectionEnabled", nulls = Nulls.SKIP) - public _FinalStage fillerInjectionEnabled(Optional fillerInjectionEnabled) { - this.fillerInjectionEnabled = fillerInjectionEnabled; - return this; - } - @java.lang.Override public RimeAiVoice build() { - return new RimeAiVoice(fillerInjectionEnabled, voiceId, model, speed, chunkPlan, additionalProperties); + return new RimeAiVoice(voiceId, model, speed, chunkPlan, fallbackPlan, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/RunpodCredential.java b/src/main/java/com/vapi/api/types/RunpodCredential.java index f925fe6..9bbe774 100644 --- a/src/main/java/com/vapi/api/types/RunpodCredential.java +++ b/src/main/java/com/vapi/api/types/RunpodCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class RunpodCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private RunpodCredential( @@ -38,12 +42,14 @@ private RunpodCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(RunpodCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { RunpodCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(RunpodCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public RunpodCredential build() { - return new RunpodCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new RunpodCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/S3Credential.java b/src/main/java/com/vapi/api/types/S3Credential.java index e8ae8b1..6facdf6 100644 --- a/src/main/java/com/vapi/api/types/S3Credential.java +++ b/src/main/java/com/vapi/api/types/S3Credential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -38,6 +40,8 @@ public final class S3Credential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private S3Credential( @@ -50,6 +54,7 @@ private S3Credential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.awsAccessKeyId = awsAccessKeyId; this.awsSecretAccessKey = awsSecretAccessKey; @@ -60,6 +65,7 @@ private S3Credential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -143,6 +149,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -163,7 +177,8 @@ private boolean equalTo(S3Credential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override @@ -177,7 +192,8 @@ public int hashCode() { this.id, this.orgId, this.createdAt, - this.updatedAt); + this.updatedAt, + this.name); } @java.lang.Override @@ -229,6 +245,10 @@ public interface UpdatedAtStage { public interface _FinalStage { S3Credential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -261,6 +281,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -277,6 +299,7 @@ public Builder from(S3Credential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -379,6 +402,23 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

      This is the name of credential. This is just for your reference.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public S3Credential build() { return new S3Credential( @@ -391,6 +431,7 @@ public S3Credential build() { orgId, createdAt, updatedAt, + name, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/Server.java b/src/main/java/com/vapi/api/types/Server.java index 7997294..50b5622 100644 --- a/src/main/java/com/vapi/api/types/Server.java +++ b/src/main/java/com/vapi/api/types/Server.java @@ -27,16 +27,20 @@ public final class Server { private final Optional secret; + private final Optional> headers; + private final Map additionalProperties; private Server( Optional timeoutSeconds, String url, Optional secret, + Optional> headers, Map additionalProperties) { this.timeoutSeconds = timeoutSeconds; this.url = url; this.secret = secret; + this.headers = headers; this.additionalProperties = additionalProperties; } @@ -66,6 +70,15 @@ public Optional getSecret() { return secret; } + /** + * @return These are the custom headers to include in the request sent to your server. + *

      Each key-value pair represents a header name and its value.

      + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +91,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(Server other) { - return timeoutSeconds.equals(other.timeoutSeconds) && url.equals(other.url) && secret.equals(other.secret); + return timeoutSeconds.equals(other.timeoutSeconds) + && url.equals(other.url) + && secret.equals(other.secret) + && headers.equals(other.headers); } @java.lang.Override public int hashCode() { - return Objects.hash(this.timeoutSeconds, this.url, this.secret); + return Objects.hash(this.timeoutSeconds, this.url, this.secret, this.headers); } @java.lang.Override @@ -111,12 +127,18 @@ public interface _FinalStage { _FinalStage secret(Optional secret); _FinalStage secret(String secret); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements UrlStage, _FinalStage { private String url; + private Optional> headers = Optional.empty(); + private Optional secret = Optional.empty(); private Optional timeoutSeconds = Optional.empty(); @@ -131,6 +153,7 @@ public Builder from(Server other) { timeoutSeconds(other.getTimeoutSeconds()); url(other.getUrl()); secret(other.getSecret()); + headers(other.getHeaders()); return this; } @@ -145,6 +168,24 @@ public _FinalStage url(@NotNull String url) { return this; } + /** + *

      These are the custom headers to include in the request sent to your server.

      + *

      Each key-value pair represents a header name and its value.

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

      This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.

      *

      Same precedence logic as server.

      @@ -183,7 +224,7 @@ public _FinalStage timeoutSeconds(Optional timeoutSeconds) { @java.lang.Override public Server build() { - return new Server(timeoutSeconds, url, secret, additionalProperties); + return new Server(timeoutSeconds, url, secret, headers, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ServerMessageEndOfCallReportEndedReason.java b/src/main/java/com/vapi/api/types/ServerMessageEndOfCallReportEndedReason.java index 0c226b3..babc229 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageEndOfCallReportEndedReason.java +++ b/src/main/java/com/vapi/api/types/ServerMessageEndOfCallReportEndedReason.java @@ -6,23 +6,29 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum ServerMessageEndOfCallReportEndedReason { - ASSISTANT_ERROR("assistant-error"), + PIPELINE_ERROR_OPENAI_VOICE_FAILED("pipeline-error-openai-voice-failed"), - ASSISTANT_NOT_FOUND("assistant-not-found"), + PIPELINE_ERROR_CARTESIA_VOICE_FAILED("pipeline-error-cartesia-voice-failed"), - DB_ERROR("db-error"), + PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED("pipeline-error-deepgram-voice-failed"), - NO_SERVER_AVAILABLE("no-server-available"), + PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED("pipeline-error-eleven-labs-voice-failed"), - LICENSE_CHECK_FAILED("license-check-failed"), + PIPELINE_ERROR_PLAYHT_VOICE_FAILED("pipeline-error-playht-voice-failed"), - PIPELINE_ERROR_OPENAI_LLM_FAILED("pipeline-error-openai-llm-failed"), + PIPELINE_ERROR_LMNT_VOICE_FAILED("pipeline-error-lmnt-voice-failed"), - PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED("pipeline-error-azure-openai-llm-failed"), + PIPELINE_ERROR_AZURE_VOICE_FAILED("pipeline-error-azure-voice-failed"), - PIPELINE_ERROR_GROQ_LLM_FAILED("pipeline-error-groq-llm-failed"), + PIPELINE_ERROR_RIME_AI_VOICE_FAILED("pipeline-error-rime-ai-voice-failed"), - PIPELINE_ERROR_ANTHROPIC_LLM_FAILED("pipeline-error-anthropic-llm-failed"), + PIPELINE_ERROR_NEETS_VOICE_FAILED("pipeline-error-neets-voice-failed"), + + DB_ERROR("db-error"), + + ASSISTANT_NOT_FOUND("assistant-not-found"), + + LICENSE_CHECK_FAILED("license-check-failed"), PIPELINE_ERROR_VAPI_LLM_FAILED("pipeline-error-vapi-llm-failed"), @@ -36,28 +42,6 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_VAPI_500_SERVER_ERROR("pipeline-error-vapi-500-server-error"), - PIPELINE_ERROR_OPENAI_VOICE_FAILED("pipeline-error-openai-voice-failed"), - - PIPELINE_ERROR_CARTESIA_VOICE_FAILED("pipeline-error-cartesia-voice-failed"), - - PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED("pipeline-error-deepgram-transcriber-failed"), - - PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED("pipeline-error-deepgram-voice-failed"), - - PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED("pipeline-error-gladia-transcriber-failed"), - - PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED("pipeline-error-eleven-labs-voice-failed"), - - PIPELINE_ERROR_PLAYHT_VOICE_FAILED("pipeline-error-playht-voice-failed"), - - PIPELINE_ERROR_LMNT_VOICE_FAILED("pipeline-error-lmnt-voice-failed"), - - PIPELINE_ERROR_AZURE_VOICE_FAILED("pipeline-error-azure-voice-failed"), - - PIPELINE_ERROR_RIME_AI_VOICE_FAILED("pipeline-error-rime-ai-voice-failed"), - - PIPELINE_ERROR_NEETS_VOICE_FAILED("pipeline-error-neets-voice-failed"), - PIPELINE_NO_AVAILABLE_MODEL("pipeline-no-available-model"), WORKER_SHUTDOWN("worker-shutdown"), @@ -82,6 +66,27 @@ public enum ServerMessageEndOfCallReportEndedReason { VAPIFAULT_TRANSPORT_CONNECTED_BUT_CALL_NOT_ACTIVE("vapifault-transport-connected-but-call-not-active"), + VAPIFAULT_CALL_STARTED_BUT_CONNECTION_TO_TRANSPORT_MISSING( + "vapifault-call-started-but-connection-to-transport-missing"), + + PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED("pipeline-error-deepgram-transcriber-failed"), + + PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED("pipeline-error-gladia-transcriber-failed"), + + PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED("pipeline-error-assembly-ai-transcriber-failed"), + + PIPELINE_ERROR_OPENAI_LLM_FAILED("pipeline-error-openai-llm-failed"), + + PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED("pipeline-error-azure-openai-llm-failed"), + + PIPELINE_ERROR_GROQ_LLM_FAILED("pipeline-error-groq-llm-failed"), + + PIPELINE_ERROR_GOOGLE_LLM_FAILED("pipeline-error-google-llm-failed"), + + PIPELINE_ERROR_XAI_LLM_FAILED("pipeline-error-xai-llm-failed"), + + PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED("pipeline-error-inflection-ai-llm-failed"), + ASSISTANT_NOT_INVALID("assistant-not-invalid"), ASSISTANT_NOT_PROVIDED("assistant-not-provided"), @@ -134,6 +139,37 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_OPENAI_500_SERVER_ERROR("pipeline-error-openai-500-server-error"), + PIPELINE_ERROR_GOOGLE_400_BAD_REQUEST_VALIDATION_FAILED("pipeline-error-google-400-bad-request-validation-failed"), + + PIPELINE_ERROR_GOOGLE_401_UNAUTHORIZED("pipeline-error-google-401-unauthorized"), + + PIPELINE_ERROR_GOOGLE_403_MODEL_ACCESS_DENIED("pipeline-error-google-403-model-access-denied"), + + PIPELINE_ERROR_GOOGLE_429_EXCEEDED_QUOTA("pipeline-error-google-429-exceeded-quota"), + + PIPELINE_ERROR_GOOGLE_500_SERVER_ERROR("pipeline-error-google-500-server-error"), + + PIPELINE_ERROR_XAI_400_BAD_REQUEST_VALIDATION_FAILED("pipeline-error-xai-400-bad-request-validation-failed"), + + PIPELINE_ERROR_XAI_401_UNAUTHORIZED("pipeline-error-xai-401-unauthorized"), + + PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED("pipeline-error-xai-403-model-access-denied"), + + PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA("pipeline-error-xai-429-exceeded-quota"), + + PIPELINE_ERROR_XAI_500_SERVER_ERROR("pipeline-error-xai-500-server-error"), + + PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED( + "pipeline-error-inflection-ai-400-bad-request-validation-failed"), + + PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED("pipeline-error-inflection-ai-401-unauthorized"), + + PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED("pipeline-error-inflection-ai-403-model-access-denied"), + + PIPELINE_ERROR_INFLECTION_AI_429_EXCEEDED_QUOTA("pipeline-error-inflection-ai-429-exceeded-quota"), + + PIPELINE_ERROR_INFLECTION_AI_500_SERVER_ERROR("pipeline-error-inflection-ai-500-server-error"), + PIPELINE_ERROR_AZURE_OPENAI_400_BAD_REQUEST_VALIDATION_FAILED( "pipeline-error-azure-openai-400-bad-request-validation-failed"), @@ -166,6 +202,8 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_ANTHROPIC_500_SERVER_ERROR("pipeline-error-anthropic-500-server-error"), + PIPELINE_ERROR_ANTHROPIC_LLM_FAILED("pipeline-error-anthropic-llm-failed"), + PIPELINE_ERROR_TOGETHER_AI_400_BAD_REQUEST_VALIDATION_FAILED( "pipeline-error-together-ai-400-bad-request-validation-failed"), @@ -256,6 +294,8 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_CUSTOM_LLM_LLM_FAILED("pipeline-error-custom-llm-llm-failed"), + PIPELINE_ERROR_CUSTOM_VOICE_FAILED("pipeline-error-custom-voice-failed"), + PIPELINE_ERROR_CARTESIA_SOCKET_HANG_UP("pipeline-error-cartesia-socket-hang-up"), PIPELINE_ERROR_CARTESIA_REQUESTED_PAYMENT("pipeline-error-cartesia-requested-payment"), @@ -266,8 +306,6 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_CARTESIA_522_SERVER_ERROR("pipeline-error-cartesia-522-server-error"), - PIPELINE_ERROR_CUSTOM_VOICE_FAILED("pipeline-error-custom-voice-failed"), - PIPELINE_ERROR_ELEVEN_LABS_VOICE_NOT_FOUND("pipeline-error-eleven-labs-voice-not-found"), PIPELINE_ERROR_ELEVEN_LABS_QUOTA_EXCEEDED("pipeline-error-eleven-labs-quota-exceeded"), @@ -317,6 +355,9 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_ELEVEN_LABS_MAX_CHARACTER_LIMIT_EXCEEDED("pipeline-error-eleven-labs-max-character-limit-exceeded"), + PIPELINE_ERROR_ELEVEN_LABS_BLOCKED_VOICE_POTENTIALLY_AGAINST_TERMS_OF_SERVICE_AND_AWAITING_VERIFICATION( + "pipeline-error-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification"), + PIPELINE_ERROR_PLAYHT_REQUEST_TIMED_OUT("pipeline-error-playht-request-timed-out"), PIPELINE_ERROR_PLAYHT_INVALID_VOICE("pipeline-error-playht-invalid-voice"), @@ -325,6 +366,8 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_PLAYHT_OUT_OF_CREDITS("pipeline-error-playht-out-of-credits"), + PIPELINE_ERROR_PLAYHT_INVALID_EMOTION("pipeline-error-playht-invalid-emotion"), + PIPELINE_ERROR_PLAYHT_VOICE_MUST_BE_A_VALID_VOICE_MANIFEST_URI( "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri"), @@ -341,26 +384,39 @@ public enum ServerMessageEndOfCallReportEndedReason { PIPELINE_ERROR_PLAYHT_504_GATEWAY_ERROR("pipeline-error-playht-504-gateway-error"), - PIPELINE_ERROR_DEEPGRAM_403_MODEL_ACCESS_DENIED("pipeline-error-deepgram-403-model-access-denied"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_403_MODEL_ACCESS_DENIED( + "pipeline-error-deepgram-returning-403-model-access-denied"), - PIPELINE_ERROR_DEEPGRAM_404_NOT_FOUND("pipeline-error-deepgram-404-not-found"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_401_INVALID_CREDENTIALS( + "pipeline-error-deepgram-returning-401-invalid-credentials"), - PIPELINE_ERROR_DEEPGRAM_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION( - "pipeline-error-deepgram-400-no-such-model-language-tier-combination"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_404_NOT_FOUND("pipeline-error-deepgram-returning-404-not-found"), - PIPELINE_ERROR_DEEPGRAM_500_RETURNING_INVALID_JSON("pipeline-error-deepgram-500-returning-invalid-json"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION( + "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination"), - SIP_GATEWAY_FAILED_TO_CONNECT_CALL("sip-gateway-failed-to-connect-call"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_500_INVALID_JSON("pipeline-error-deepgram-returning-500-invalid-json"), + + PIPELINE_ERROR_DEEPGRAM_RETURNING_502_NETWORK_ERROR("pipeline-error-deepgram-returning-502-network-error"), + + PIPELINE_ERROR_DEEPGRAM_RETURNING_502_BAD_GATEWAY_EHOSTUNREACH( + "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach"), + + PIPELINE_ERROR_TAVUS_VIDEO_FAILED("pipeline-error-tavus-video-failed"), + + PIPELINE_ERROR_CUSTOM_TRANSCRIBER_FAILED("pipeline-error-custom-transcriber-failed"), SILENCE_TIMED_OUT("silence-timed-out"), + SIP_GATEWAY_FAILED_TO_CONNECT_CALL("sip-gateway-failed-to-connect-call"), + TWILIO_FAILED_TO_CONNECT_CALL("twilio-failed-to-connect-call"), TWILIO_REPORTED_CUSTOMER_MISDIALED("twilio-reported-customer-misdialed"), - VOICEMAIL("voicemail"), + VONAGE_REJECTED("vonage-rejected"), - VONAGE_REJECTED("vonage-rejected"); + VOICEMAIL("voicemail"); private final String value; diff --git a/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequest.java b/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequest.java new file mode 100644 index 0000000..79990da --- /dev/null +++ b/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequest.java @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ServerMessageKnowledgeBaseRequest.Builder.class) +public final class ServerMessageKnowledgeBaseRequest { + private final Optional phoneNumber; + + private final Optional> messages; + + private final List messagesOpenAiFormatted; + + private final Optional timestamp; + + private final Optional artifact; + + private final Optional assistant; + + private final Optional customer; + + private final Optional call; + + private final Map additionalProperties; + + private ServerMessageKnowledgeBaseRequest( + Optional phoneNumber, + Optional> messages, + List messagesOpenAiFormatted, + Optional timestamp, + Optional artifact, + Optional assistant, + Optional customer, + Optional call, + Map additionalProperties) { + this.phoneNumber = phoneNumber; + this.messages = messages; + this.messagesOpenAiFormatted = messagesOpenAiFormatted; + this.timestamp = timestamp; + this.artifact = artifact; + this.assistant = assistant; + this.customer = customer; + this.call = call; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the phone number associated with the call. + *

      This matches one of the following:

      + *
        + *
      • call.phoneNumber,
      • + *
      • call.phoneNumberId.
      • + *
      + */ + @JsonProperty("phoneNumber") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return These are the messages that are going to be sent to the model right after the knowledge-base-request webhook completes. + */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return This is just messages formatted for OpenAI. + */ + @JsonProperty("messagesOpenAIFormatted") + public List getMessagesOpenAiFormatted() { + return messagesOpenAiFormatted; + } + + /** + * @return This is the ISO-8601 formatted timestamp of when the message was sent. + */ + @JsonProperty("timestamp") + public Optional getTimestamp() { + return timestamp; + } + + /** + * @return This is a live version of the call.artifact. + *

      This matches what is stored on call.artifact after the call.

      + */ + @JsonProperty("artifact") + public Optional getArtifact() { + return artifact; + } + + /** + * @return This is the assistant that is currently active. This is provided for convenience. + *

      This matches one of the following:

      + *
        + *
      • call.assistant,
      • + *
      • call.assistantId,
      • + *
      • call.squad[n].assistant,
      • + *
      • call.squad[n].assistantId,
      • + *
      • call.squadId->[n].assistant,
      • + *
      • call.squadId->[n].assistantId.
      • + *
      + */ + @JsonProperty("assistant") + public Optional getAssistant() { + return assistant; + } + + /** + * @return This is the customer associated with the call. + *

      This matches one of the following:

      + *
        + *
      • call.customer,
      • + *
      • call.customerId.
      • + *
      + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return This is the call object. + *

      This matches what was returned in POST /call.

      + *

      Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id.

      + */ + @JsonProperty("call") + public Optional getCall() { + return call; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ServerMessageKnowledgeBaseRequest && equalTo((ServerMessageKnowledgeBaseRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ServerMessageKnowledgeBaseRequest other) { + return phoneNumber.equals(other.phoneNumber) + && messages.equals(other.messages) + && messagesOpenAiFormatted.equals(other.messagesOpenAiFormatted) + && timestamp.equals(other.timestamp) + && artifact.equals(other.artifact) + && assistant.equals(other.assistant) + && customer.equals(other.customer) + && call.equals(other.call); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.phoneNumber, + this.messages, + this.messagesOpenAiFormatted, + this.timestamp, + this.artifact, + this.assistant, + this.customer, + this.call); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional phoneNumber = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private List messagesOpenAiFormatted = new ArrayList<>(); + + private Optional timestamp = Optional.empty(); + + private Optional artifact = Optional.empty(); + + private Optional assistant = Optional.empty(); + + private Optional customer = Optional.empty(); + + private Optional call = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ServerMessageKnowledgeBaseRequest other) { + phoneNumber(other.getPhoneNumber()); + messages(other.getMessages()); + messagesOpenAiFormatted(other.getMessagesOpenAiFormatted()); + timestamp(other.getTimestamp()); + artifact(other.getArtifact()); + assistant(other.getAssistant()); + customer(other.getCustomer()); + call(other.getCall()); + return this; + } + + @JsonSetter(value = "phoneNumber", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(ServerMessageKnowledgeBaseRequestPhoneNumber phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public Builder messages(Optional> messages) { + this.messages = messages; + return this; + } + + public Builder messages(List messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @JsonSetter(value = "messagesOpenAIFormatted", nulls = Nulls.SKIP) + public Builder messagesOpenAiFormatted(List messagesOpenAiFormatted) { + this.messagesOpenAiFormatted.clear(); + this.messagesOpenAiFormatted.addAll(messagesOpenAiFormatted); + return this; + } + + public Builder addMessagesOpenAiFormatted(OpenAiMessage messagesOpenAiFormatted) { + this.messagesOpenAiFormatted.add(messagesOpenAiFormatted); + return this; + } + + public Builder addAllMessagesOpenAiFormatted(List messagesOpenAiFormatted) { + this.messagesOpenAiFormatted.addAll(messagesOpenAiFormatted); + return this; + } + + @JsonSetter(value = "timestamp", nulls = Nulls.SKIP) + public Builder timestamp(Optional timestamp) { + this.timestamp = timestamp; + return this; + } + + public Builder timestamp(String timestamp) { + this.timestamp = Optional.ofNullable(timestamp); + return this; + } + + @JsonSetter(value = "artifact", nulls = Nulls.SKIP) + public Builder artifact(Optional artifact) { + this.artifact = artifact; + return this; + } + + public Builder artifact(Artifact artifact) { + this.artifact = Optional.ofNullable(artifact); + return this; + } + + @JsonSetter(value = "assistant", nulls = Nulls.SKIP) + public Builder assistant(Optional assistant) { + this.assistant = assistant; + return this; + } + + public Builder assistant(CreateAssistantDto assistant) { + this.assistant = Optional.ofNullable(assistant); + return this; + } + + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(CreateCustomerDto customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + @JsonSetter(value = "call", nulls = Nulls.SKIP) + public Builder call(Optional call) { + this.call = call; + return this; + } + + public Builder call(Call call) { + this.call = Optional.ofNullable(call); + return this; + } + + public ServerMessageKnowledgeBaseRequest build() { + return new ServerMessageKnowledgeBaseRequest( + phoneNumber, + messages, + messagesOpenAiFormatted, + timestamp, + artifact, + assistant, + customer, + call, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequestMessagesItem.java b/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequestMessagesItem.java new file mode 100644 index 0000000..326fe1b --- /dev/null +++ b/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequestMessagesItem.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ServerMessageKnowledgeBaseRequestMessagesItem.Deserializer.class) +public final class ServerMessageKnowledgeBaseRequestMessagesItem { + private final Object value; + + private final int type; + + private ServerMessageKnowledgeBaseRequestMessagesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((UserMessage) this.value); + } else if (this.type == 1) { + return visitor.visit((SystemMessage) this.value); + } else if (this.type == 2) { + return visitor.visit((BotMessage) this.value); + } else if (this.type == 3) { + return visitor.visit((ToolCallMessage) this.value); + } else if (this.type == 4) { + return visitor.visit((ToolCallResultMessage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ServerMessageKnowledgeBaseRequestMessagesItem + && equalTo((ServerMessageKnowledgeBaseRequestMessagesItem) other); + } + + private boolean equalTo(ServerMessageKnowledgeBaseRequestMessagesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ServerMessageKnowledgeBaseRequestMessagesItem of(UserMessage value) { + return new ServerMessageKnowledgeBaseRequestMessagesItem(value, 0); + } + + public static ServerMessageKnowledgeBaseRequestMessagesItem of(SystemMessage value) { + return new ServerMessageKnowledgeBaseRequestMessagesItem(value, 1); + } + + public static ServerMessageKnowledgeBaseRequestMessagesItem of(BotMessage value) { + return new ServerMessageKnowledgeBaseRequestMessagesItem(value, 2); + } + + public static ServerMessageKnowledgeBaseRequestMessagesItem of(ToolCallMessage value) { + return new ServerMessageKnowledgeBaseRequestMessagesItem(value, 3); + } + + public static ServerMessageKnowledgeBaseRequestMessagesItem of(ToolCallResultMessage value) { + return new ServerMessageKnowledgeBaseRequestMessagesItem(value, 4); + } + + public interface Visitor { + T visit(UserMessage value); + + T visit(SystemMessage value); + + T visit(BotMessage value); + + T visit(ToolCallMessage value); + + T visit(ToolCallResultMessage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ServerMessageKnowledgeBaseRequestMessagesItem.class); + } + + @java.lang.Override + public ServerMessageKnowledgeBaseRequestMessagesItem deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, UserMessage.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SystemMessage.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, BotMessage.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ToolCallMessage.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ToolCallResultMessage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ServerMessageLanguageChangedPhoneNumber.java b/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequestPhoneNumber.java similarity index 85% rename from src/main/java/com/vapi/api/types/ServerMessageLanguageChangedPhoneNumber.java rename to src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequestPhoneNumber.java index 1c8540c..42158da 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageLanguageChangedPhoneNumber.java +++ b/src/main/java/com/vapi/api/types/ServerMessageKnowledgeBaseRequestPhoneNumber.java @@ -14,11 +14,11 @@ import java.util.Objects; import java.util.Optional; -public final class ServerMessageLanguageChangedPhoneNumber { +public final class ServerMessageKnowledgeBaseRequestPhoneNumber { private final Value value; @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private ServerMessageLanguageChangedPhoneNumber(Value value) { + private ServerMessageKnowledgeBaseRequestPhoneNumber(Value value) { this.value = value; } @@ -26,20 +26,20 @@ public T visit(Visitor visitor) { return value.visit(visitor); } - public static ServerMessageLanguageChangedPhoneNumber byoPhoneNumber(CreateByoPhoneNumberDto value) { - return new ServerMessageLanguageChangedPhoneNumber(new ByoPhoneNumberValue(value)); + public static ServerMessageKnowledgeBaseRequestPhoneNumber byoPhoneNumber(CreateByoPhoneNumberDto value) { + return new ServerMessageKnowledgeBaseRequestPhoneNumber(new ByoPhoneNumberValue(value)); } - public static ServerMessageLanguageChangedPhoneNumber twilio(CreateTwilioPhoneNumberDto value) { - return new ServerMessageLanguageChangedPhoneNumber(new TwilioValue(value)); + public static ServerMessageKnowledgeBaseRequestPhoneNumber twilio(CreateTwilioPhoneNumberDto value) { + return new ServerMessageKnowledgeBaseRequestPhoneNumber(new TwilioValue(value)); } - public static ServerMessageLanguageChangedPhoneNumber vonage(CreateVonagePhoneNumberDto value) { - return new ServerMessageLanguageChangedPhoneNumber(new VonageValue(value)); + public static ServerMessageKnowledgeBaseRequestPhoneNumber vonage(CreateVonagePhoneNumberDto value) { + return new ServerMessageKnowledgeBaseRequestPhoneNumber(new VonageValue(value)); } - public static ServerMessageLanguageChangedPhoneNumber vapi(CreateVapiPhoneNumberDto value) { - return new ServerMessageLanguageChangedPhoneNumber(new VapiValue(value)); + public static ServerMessageKnowledgeBaseRequestPhoneNumber vapi(CreateVapiPhoneNumberDto value) { + return new ServerMessageKnowledgeBaseRequestPhoneNumber(new VapiValue(value)); } public boolean isByoPhoneNumber() { @@ -160,7 +160,7 @@ public int hashCode() { @java.lang.Override public String toString() { - return "ServerMessageLanguageChangedPhoneNumber{" + "value: " + value + "}"; + return "ServerMessageKnowledgeBaseRequestPhoneNumber{" + "value: " + value + "}"; } } @@ -198,7 +198,7 @@ public int hashCode() { @java.lang.Override public String toString() { - return "ServerMessageLanguageChangedPhoneNumber{" + "value: " + value + "}"; + return "ServerMessageKnowledgeBaseRequestPhoneNumber{" + "value: " + value + "}"; } } @@ -236,7 +236,7 @@ public int hashCode() { @java.lang.Override public String toString() { - return "ServerMessageLanguageChangedPhoneNumber{" + "value: " + value + "}"; + return "ServerMessageKnowledgeBaseRequestPhoneNumber{" + "value: " + value + "}"; } } @@ -274,7 +274,7 @@ public int hashCode() { @java.lang.Override public String toString() { - return "ServerMessageLanguageChangedPhoneNumber{" + "value: " + value + "}"; + return "ServerMessageKnowledgeBaseRequestPhoneNumber{" + "value: " + value + "}"; } } @@ -309,7 +309,7 @@ public int hashCode() { @java.lang.Override public String toString() { - return "ServerMessageLanguageChangedPhoneNumber{" + "type: " + type + ", value: " + value + "}"; + return "ServerMessageKnowledgeBaseRequestPhoneNumber{" + "type: " + type + ", value: " + value + "}"; } } } diff --git a/src/main/java/com/vapi/api/types/ServerMessageLanguageChanged.java b/src/main/java/com/vapi/api/types/ServerMessageLanguageChangeDetected.java similarity index 90% rename from src/main/java/com/vapi/api/types/ServerMessageLanguageChanged.java rename to src/main/java/com/vapi/api/types/ServerMessageLanguageChangeDetected.java index a594ca0..f13fd8e 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageLanguageChanged.java +++ b/src/main/java/com/vapi/api/types/ServerMessageLanguageChangeDetected.java @@ -19,9 +19,9 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ServerMessageLanguageChanged.Builder.class) -public final class ServerMessageLanguageChanged { - private final Optional phoneNumber; +@JsonDeserialize(builder = ServerMessageLanguageChangeDetected.Builder.class) +public final class ServerMessageLanguageChangeDetected { + private final Optional phoneNumber; private final Optional timestamp; @@ -37,8 +37,8 @@ public final class ServerMessageLanguageChanged { private final Map additionalProperties; - private ServerMessageLanguageChanged( - Optional phoneNumber, + private ServerMessageLanguageChangeDetected( + Optional phoneNumber, Optional timestamp, Optional artifact, Optional assistant, @@ -65,7 +65,7 @@ private ServerMessageLanguageChanged( * */ @JsonProperty("phoneNumber") - public Optional getPhoneNumber() { + public Optional getPhoneNumber() { return phoneNumber; } @@ -137,7 +137,8 @@ public String getLanguage() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ServerMessageLanguageChanged && equalTo((ServerMessageLanguageChanged) other); + return other instanceof ServerMessageLanguageChangeDetected + && equalTo((ServerMessageLanguageChangeDetected) other); } @JsonAnyGetter @@ -145,7 +146,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ServerMessageLanguageChanged other) { + private boolean equalTo(ServerMessageLanguageChangeDetected other) { return phoneNumber.equals(other.phoneNumber) && timestamp.equals(other.timestamp) && artifact.equals(other.artifact) @@ -179,15 +180,15 @@ public static LanguageStage builder() { public interface LanguageStage { _FinalStage language(@NotNull String language); - Builder from(ServerMessageLanguageChanged other); + Builder from(ServerMessageLanguageChangeDetected other); } public interface _FinalStage { - ServerMessageLanguageChanged build(); + ServerMessageLanguageChangeDetected build(); - _FinalStage phoneNumber(Optional phoneNumber); + _FinalStage phoneNumber(Optional phoneNumber); - _FinalStage phoneNumber(ServerMessageLanguageChangedPhoneNumber phoneNumber); + _FinalStage phoneNumber(ServerMessageLanguageChangeDetectedPhoneNumber phoneNumber); _FinalStage timestamp(Optional timestamp); @@ -224,7 +225,7 @@ public static final class Builder implements LanguageStage, _FinalStage { private Optional timestamp = Optional.empty(); - private Optional phoneNumber = Optional.empty(); + private Optional phoneNumber = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -232,7 +233,7 @@ public static final class Builder implements LanguageStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(ServerMessageLanguageChanged other) { + public Builder from(ServerMessageLanguageChangeDetected other) { phoneNumber(other.getPhoneNumber()); timestamp(other.getTimestamp()); artifact(other.getArtifact()); @@ -366,21 +367,21 @@ public _FinalStage timestamp(Optional timestamp) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage phoneNumber(ServerMessageLanguageChangedPhoneNumber phoneNumber) { + public _FinalStage phoneNumber(ServerMessageLanguageChangeDetectedPhoneNumber phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; } @java.lang.Override @JsonSetter(value = "phoneNumber", nulls = Nulls.SKIP) - public _FinalStage phoneNumber(Optional phoneNumber) { + public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; return this; } @java.lang.Override - public ServerMessageLanguageChanged build() { - return new ServerMessageLanguageChanged( + public ServerMessageLanguageChangeDetected build() { + return new ServerMessageLanguageChangeDetected( phoneNumber, timestamp, artifact, assistant, customer, call, language, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/ServerMessageLanguageChangeDetectedPhoneNumber.java b/src/main/java/com/vapi/api/types/ServerMessageLanguageChangeDetectedPhoneNumber.java new file mode 100644 index 0000000..e9543c8 --- /dev/null +++ b/src/main/java/com/vapi/api/types/ServerMessageLanguageChangeDetectedPhoneNumber.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class ServerMessageLanguageChangeDetectedPhoneNumber { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private ServerMessageLanguageChangeDetectedPhoneNumber(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static ServerMessageLanguageChangeDetectedPhoneNumber byoPhoneNumber(CreateByoPhoneNumberDto value) { + return new ServerMessageLanguageChangeDetectedPhoneNumber(new ByoPhoneNumberValue(value)); + } + + public static ServerMessageLanguageChangeDetectedPhoneNumber twilio(CreateTwilioPhoneNumberDto value) { + return new ServerMessageLanguageChangeDetectedPhoneNumber(new TwilioValue(value)); + } + + public static ServerMessageLanguageChangeDetectedPhoneNumber vonage(CreateVonagePhoneNumberDto value) { + return new ServerMessageLanguageChangeDetectedPhoneNumber(new VonageValue(value)); + } + + public static ServerMessageLanguageChangeDetectedPhoneNumber vapi(CreateVapiPhoneNumberDto value) { + return new ServerMessageLanguageChangeDetectedPhoneNumber(new VapiValue(value)); + } + + public boolean isByoPhoneNumber() { + return value instanceof ByoPhoneNumberValue; + } + + public boolean isTwilio() { + return value instanceof TwilioValue; + } + + public boolean isVonage() { + return value instanceof VonageValue; + } + + public boolean isVapi() { + return value instanceof VapiValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getByoPhoneNumber() { + if (isByoPhoneNumber()) { + return Optional.of(((ByoPhoneNumberValue) value).value); + } + return Optional.empty(); + } + + public Optional getTwilio() { + if (isTwilio()) { + return Optional.of(((TwilioValue) value).value); + } + return Optional.empty(); + } + + public Optional getVonage() { + if (isVonage()) { + return Optional.of(((VonageValue) value).value); + } + return Optional.empty(); + } + + public Optional getVapi() { + if (isVapi()) { + return Optional.of(((VapiValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitByoPhoneNumber(CreateByoPhoneNumberDto byoPhoneNumber); + + T visitTwilio(CreateTwilioPhoneNumberDto twilio); + + T visitVonage(CreateVonagePhoneNumberDto vonage); + + T visitVapi(CreateVapiPhoneNumberDto vapi); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(ByoPhoneNumberValue.class), + @JsonSubTypes.Type(TwilioValue.class), + @JsonSubTypes.Type(VonageValue.class), + @JsonSubTypes.Type(VapiValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("byo-phone-number") + private static final class ByoPhoneNumberValue implements Value { + @JsonUnwrapped + private CreateByoPhoneNumberDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ByoPhoneNumberValue() {} + + private ByoPhoneNumberValue(CreateByoPhoneNumberDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitByoPhoneNumber(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ByoPhoneNumberValue && equalTo((ByoPhoneNumberValue) other); + } + + private boolean equalTo(ByoPhoneNumberValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ServerMessageLanguageChangeDetectedPhoneNumber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("twilio") + private static final class TwilioValue implements Value { + @JsonUnwrapped + private CreateTwilioPhoneNumberDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TwilioValue() {} + + private TwilioValue(CreateTwilioPhoneNumberDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTwilio(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TwilioValue && equalTo((TwilioValue) other); + } + + private boolean equalTo(TwilioValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ServerMessageLanguageChangeDetectedPhoneNumber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("vonage") + private static final class VonageValue implements Value { + @JsonUnwrapped + private CreateVonagePhoneNumberDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VonageValue() {} + + private VonageValue(CreateVonagePhoneNumberDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVonage(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VonageValue && equalTo((VonageValue) other); + } + + private boolean equalTo(VonageValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ServerMessageLanguageChangeDetectedPhoneNumber{" + "value: " + value + "}"; + } + } + + @JsonTypeName("vapi") + private static final class VapiValue implements Value { + @JsonUnwrapped + private CreateVapiPhoneNumberDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VapiValue() {} + + private VapiValue(CreateVapiPhoneNumberDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVapi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VapiValue && equalTo((VapiValue) other); + } + + private boolean equalTo(VapiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ServerMessageLanguageChangeDetectedPhoneNumber{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "ServerMessageLanguageChangeDetectedPhoneNumber{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/ServerMessageMessage.java b/src/main/java/com/vapi/api/types/ServerMessageMessage.java index 2a7021e..0b5887c 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageMessage.java +++ b/src/main/java/com/vapi/api/types/ServerMessageMessage.java @@ -42,6 +42,10 @@ public static ServerMessageMessage hang(ServerMessageHang value) { return new ServerMessageMessage(new HangValue(value)); } + public static ServerMessageMessage knowledgeBaseRequest(ServerMessageKnowledgeBaseRequest value) { + return new ServerMessageMessage(new KnowledgeBaseRequestValue(value)); + } + public static ServerMessageMessage modelOutput(ServerMessageModelOutput value) { return new ServerMessageMessage(new ModelOutputValue(value)); } @@ -78,8 +82,8 @@ public static ServerMessageMessage userInterrupted(ServerMessageUserInterrupted return new ServerMessageMessage(new UserInterruptedValue(value)); } - public static ServerMessageMessage languageChanged(ServerMessageLanguageChanged value) { - return new ServerMessageMessage(new LanguageChangedValue(value)); + public static ServerMessageMessage languageChangeDetected(ServerMessageLanguageChangeDetected value) { + return new ServerMessageMessage(new LanguageChangeDetectedValue(value)); } public static ServerMessageMessage voiceInput(ServerMessageVoiceInput value) { @@ -106,6 +110,10 @@ public boolean isHang() { return value instanceof HangValue; } + public boolean isKnowledgeBaseRequest() { + return value instanceof KnowledgeBaseRequestValue; + } + public boolean isModelOutput() { return value instanceof ModelOutputValue; } @@ -142,8 +150,8 @@ public boolean isUserInterrupted() { return value instanceof UserInterruptedValue; } - public boolean isLanguageChanged() { - return value instanceof LanguageChangedValue; + public boolean isLanguageChangeDetected() { + return value instanceof LanguageChangeDetectedValue; } public boolean isVoiceInput() { @@ -186,6 +194,13 @@ public Optional getHang() { return Optional.empty(); } + public Optional getKnowledgeBaseRequest() { + if (isKnowledgeBaseRequest()) { + return Optional.of(((KnowledgeBaseRequestValue) value).value); + } + return Optional.empty(); + } + public Optional getModelOutput() { if (isModelOutput()) { return Optional.of(((ModelOutputValue) value).value); @@ -249,9 +264,9 @@ public Optional getUserInterrupted() { return Optional.empty(); } - public Optional getLanguageChanged() { - if (isLanguageChanged()) { - return Optional.of(((LanguageChangedValue) value).value); + public Optional getLanguageChangeDetected() { + if (isLanguageChangeDetected()) { + return Optional.of(((LanguageChangeDetectedValue) value).value); } return Optional.empty(); } @@ -291,6 +306,8 @@ public interface Visitor { T visitHang(ServerMessageHang hang); + T visitKnowledgeBaseRequest(ServerMessageKnowledgeBaseRequest knowledgeBaseRequest); + T visitModelOutput(ServerMessageModelOutput modelOutput); T visitPhoneCallControl(ServerMessagePhoneCallControl phoneCallControl); @@ -309,7 +326,7 @@ public interface Visitor { T visitUserInterrupted(ServerMessageUserInterrupted userInterrupted); - T visitLanguageChanged(ServerMessageLanguageChanged languageChanged); + T visitLanguageChangeDetected(ServerMessageLanguageChangeDetected languageChangeDetected); T visitVoiceInput(ServerMessageVoiceInput voiceInput); @@ -324,6 +341,7 @@ public interface Visitor { @JsonSubTypes.Type(ConversationUpdateValue.class), @JsonSubTypes.Type(EndOfCallReportValue.class), @JsonSubTypes.Type(HangValue.class), + @JsonSubTypes.Type(KnowledgeBaseRequestValue.class), @JsonSubTypes.Type(ModelOutputValue.class), @JsonSubTypes.Type(PhoneCallControlValue.class), @JsonSubTypes.Type(SpeechUpdateValue.class), @@ -333,7 +351,7 @@ public interface Visitor { @JsonSubTypes.Type(TransferUpdateValue.class), @JsonSubTypes.Type(TranscriptValue.class), @JsonSubTypes.Type(UserInterruptedValue.class), - @JsonSubTypes.Type(LanguageChangedValue.class), + @JsonSubTypes.Type(LanguageChangeDetectedValue.class), @JsonSubTypes.Type(VoiceInputValue.class), @JsonSubTypes.Type(VoiceRequestValue.class) }) @@ -494,6 +512,44 @@ public String toString() { } } + @JsonTypeName("knowledge-base-request") + private static final class KnowledgeBaseRequestValue implements Value { + @JsonUnwrapped + private ServerMessageKnowledgeBaseRequest value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private KnowledgeBaseRequestValue() {} + + private KnowledgeBaseRequestValue(ServerMessageKnowledgeBaseRequest value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitKnowledgeBaseRequest(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof KnowledgeBaseRequestValue && equalTo((KnowledgeBaseRequestValue) other); + } + + private boolean equalTo(KnowledgeBaseRequestValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "ServerMessageMessage{" + "value: " + value + "}"; + } + } + @JsonTypeName("model-output") private static final class ModelOutputValue implements Value { @JsonUnwrapped @@ -836,30 +892,30 @@ public String toString() { } } - @JsonTypeName("language-changed") - private static final class LanguageChangedValue implements Value { + @JsonTypeName("language-change-detected") + private static final class LanguageChangeDetectedValue implements Value { @JsonUnwrapped - private ServerMessageLanguageChanged value; + private ServerMessageLanguageChangeDetected value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private LanguageChangedValue() {} + private LanguageChangeDetectedValue() {} - private LanguageChangedValue(ServerMessageLanguageChanged value) { + private LanguageChangeDetectedValue(ServerMessageLanguageChangeDetected value) { this.value = value; } @java.lang.Override public T visit(Visitor visitor) { - return visitor.visitLanguageChanged(value); + return visitor.visitLanguageChangeDetected(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof LanguageChangedValue && equalTo((LanguageChangedValue) other); + return other instanceof LanguageChangeDetectedValue && equalTo((LanguageChangeDetectedValue) other); } - private boolean equalTo(LanguageChangedValue other) { + private boolean equalTo(LanguageChangeDetectedValue other) { return value.equals(other.value); } diff --git a/src/main/java/com/vapi/api/types/ServerMessageResponseKnowledgeBaseRequest.java b/src/main/java/com/vapi/api/types/ServerMessageResponseKnowledgeBaseRequest.java new file mode 100644 index 0000000..cc1da31 --- /dev/null +++ b/src/main/java/com/vapi/api/types/ServerMessageResponseKnowledgeBaseRequest.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ServerMessageResponseKnowledgeBaseRequest.Builder.class) +public final class ServerMessageResponseKnowledgeBaseRequest { + private final Optional> documents; + + private final Optional message; + + private final Map additionalProperties; + + private ServerMessageResponseKnowledgeBaseRequest( + Optional> documents, + Optional message, + Map additionalProperties) { + this.documents = documents; + this.message = message; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the list of documents that will be sent to the model alongside the messages to generate a response. + */ + @JsonProperty("documents") + public Optional> getDocuments() { + return documents; + } + + /** + * @return This can be used to skip the model output generation and speak a custom message. + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ServerMessageResponseKnowledgeBaseRequest + && equalTo((ServerMessageResponseKnowledgeBaseRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ServerMessageResponseKnowledgeBaseRequest other) { + return documents.equals(other.documents) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.documents, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> documents = Optional.empty(); + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ServerMessageResponseKnowledgeBaseRequest other) { + documents(other.getDocuments()); + message(other.getMessage()); + return this; + } + + @JsonSetter(value = "documents", nulls = Nulls.SKIP) + public Builder documents(Optional> documents) { + this.documents = documents; + return this; + } + + public Builder documents(List documents) { + this.documents = Optional.ofNullable(documents); + return this; + } + + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public Builder message(Optional message) { + this.message = message; + return this; + } + + public Builder message(CustomMessage message) { + this.message = Optional.ofNullable(message); + return this; + } + + public ServerMessageResponseKnowledgeBaseRequest build() { + return new ServerMessageResponseKnowledgeBaseRequest(documents, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/ServerMessageResponseMessageResponse.java b/src/main/java/com/vapi/api/types/ServerMessageResponseMessageResponse.java index a6c6fbd..f209abf 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageResponseMessageResponse.java +++ b/src/main/java/com/vapi/api/types/ServerMessageResponseMessageResponse.java @@ -33,10 +33,12 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((ServerMessageResponseAssistantRequest) this.value); } else if (this.type == 1) { - return visitor.visit((ServerMessageResponseToolCalls) this.value); + return visitor.visit((ServerMessageResponseKnowledgeBaseRequest) this.value); } else if (this.type == 2) { - return visitor.visit((ServerMessageResponseTransferDestinationRequest) this.value); + return visitor.visit((ServerMessageResponseToolCalls) this.value); } else if (this.type == 3) { + return visitor.visit((ServerMessageResponseTransferDestinationRequest) this.value); + } else if (this.type == 4) { return visitor.visit((ServerMessageResponseVoiceRequest) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); @@ -67,21 +69,27 @@ public static ServerMessageResponseMessageResponse of(ServerMessageResponseAssis return new ServerMessageResponseMessageResponse(value, 0); } - public static ServerMessageResponseMessageResponse of(ServerMessageResponseToolCalls value) { + public static ServerMessageResponseMessageResponse of(ServerMessageResponseKnowledgeBaseRequest value) { return new ServerMessageResponseMessageResponse(value, 1); } - public static ServerMessageResponseMessageResponse of(ServerMessageResponseTransferDestinationRequest value) { + public static ServerMessageResponseMessageResponse of(ServerMessageResponseToolCalls value) { return new ServerMessageResponseMessageResponse(value, 2); } - public static ServerMessageResponseMessageResponse of(ServerMessageResponseVoiceRequest value) { + public static ServerMessageResponseMessageResponse of(ServerMessageResponseTransferDestinationRequest value) { return new ServerMessageResponseMessageResponse(value, 3); } + public static ServerMessageResponseMessageResponse of(ServerMessageResponseVoiceRequest value) { + return new ServerMessageResponseMessageResponse(value, 4); + } + public interface Visitor { T visit(ServerMessageResponseAssistantRequest value); + T visit(ServerMessageResponseKnowledgeBaseRequest value); + T visit(ServerMessageResponseToolCalls value); T visit(ServerMessageResponseTransferDestinationRequest value); @@ -102,6 +110,11 @@ public ServerMessageResponseMessageResponse deserialize(JsonParser p, Deserializ return of(ObjectMappers.JSON_MAPPER.convertValue(value, ServerMessageResponseAssistantRequest.class)); } catch (IllegalArgumentException e) { } + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, ServerMessageResponseKnowledgeBaseRequest.class)); + } catch (IllegalArgumentException e) { + } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ServerMessageResponseToolCalls.class)); } catch (IllegalArgumentException e) { diff --git a/src/main/java/com/vapi/api/types/ServerMessageStatusUpdateEndedReason.java b/src/main/java/com/vapi/api/types/ServerMessageStatusUpdateEndedReason.java index f091666..35183bf 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageStatusUpdateEndedReason.java +++ b/src/main/java/com/vapi/api/types/ServerMessageStatusUpdateEndedReason.java @@ -6,23 +6,29 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum ServerMessageStatusUpdateEndedReason { - ASSISTANT_ERROR("assistant-error"), + PIPELINE_ERROR_OPENAI_VOICE_FAILED("pipeline-error-openai-voice-failed"), - ASSISTANT_NOT_FOUND("assistant-not-found"), + PIPELINE_ERROR_CARTESIA_VOICE_FAILED("pipeline-error-cartesia-voice-failed"), - DB_ERROR("db-error"), + PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED("pipeline-error-deepgram-voice-failed"), - NO_SERVER_AVAILABLE("no-server-available"), + PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED("pipeline-error-eleven-labs-voice-failed"), - LICENSE_CHECK_FAILED("license-check-failed"), + PIPELINE_ERROR_PLAYHT_VOICE_FAILED("pipeline-error-playht-voice-failed"), - PIPELINE_ERROR_OPENAI_LLM_FAILED("pipeline-error-openai-llm-failed"), + PIPELINE_ERROR_LMNT_VOICE_FAILED("pipeline-error-lmnt-voice-failed"), - PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED("pipeline-error-azure-openai-llm-failed"), + PIPELINE_ERROR_AZURE_VOICE_FAILED("pipeline-error-azure-voice-failed"), - PIPELINE_ERROR_GROQ_LLM_FAILED("pipeline-error-groq-llm-failed"), + PIPELINE_ERROR_RIME_AI_VOICE_FAILED("pipeline-error-rime-ai-voice-failed"), - PIPELINE_ERROR_ANTHROPIC_LLM_FAILED("pipeline-error-anthropic-llm-failed"), + PIPELINE_ERROR_NEETS_VOICE_FAILED("pipeline-error-neets-voice-failed"), + + DB_ERROR("db-error"), + + ASSISTANT_NOT_FOUND("assistant-not-found"), + + LICENSE_CHECK_FAILED("license-check-failed"), PIPELINE_ERROR_VAPI_LLM_FAILED("pipeline-error-vapi-llm-failed"), @@ -36,28 +42,6 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_VAPI_500_SERVER_ERROR("pipeline-error-vapi-500-server-error"), - PIPELINE_ERROR_OPENAI_VOICE_FAILED("pipeline-error-openai-voice-failed"), - - PIPELINE_ERROR_CARTESIA_VOICE_FAILED("pipeline-error-cartesia-voice-failed"), - - PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED("pipeline-error-deepgram-transcriber-failed"), - - PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED("pipeline-error-deepgram-voice-failed"), - - PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED("pipeline-error-gladia-transcriber-failed"), - - PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED("pipeline-error-eleven-labs-voice-failed"), - - PIPELINE_ERROR_PLAYHT_VOICE_FAILED("pipeline-error-playht-voice-failed"), - - PIPELINE_ERROR_LMNT_VOICE_FAILED("pipeline-error-lmnt-voice-failed"), - - PIPELINE_ERROR_AZURE_VOICE_FAILED("pipeline-error-azure-voice-failed"), - - PIPELINE_ERROR_RIME_AI_VOICE_FAILED("pipeline-error-rime-ai-voice-failed"), - - PIPELINE_ERROR_NEETS_VOICE_FAILED("pipeline-error-neets-voice-failed"), - PIPELINE_NO_AVAILABLE_MODEL("pipeline-no-available-model"), WORKER_SHUTDOWN("worker-shutdown"), @@ -82,6 +66,27 @@ public enum ServerMessageStatusUpdateEndedReason { VAPIFAULT_TRANSPORT_CONNECTED_BUT_CALL_NOT_ACTIVE("vapifault-transport-connected-but-call-not-active"), + VAPIFAULT_CALL_STARTED_BUT_CONNECTION_TO_TRANSPORT_MISSING( + "vapifault-call-started-but-connection-to-transport-missing"), + + PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED("pipeline-error-deepgram-transcriber-failed"), + + PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED("pipeline-error-gladia-transcriber-failed"), + + PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED("pipeline-error-assembly-ai-transcriber-failed"), + + PIPELINE_ERROR_OPENAI_LLM_FAILED("pipeline-error-openai-llm-failed"), + + PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED("pipeline-error-azure-openai-llm-failed"), + + PIPELINE_ERROR_GROQ_LLM_FAILED("pipeline-error-groq-llm-failed"), + + PIPELINE_ERROR_GOOGLE_LLM_FAILED("pipeline-error-google-llm-failed"), + + PIPELINE_ERROR_XAI_LLM_FAILED("pipeline-error-xai-llm-failed"), + + PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED("pipeline-error-inflection-ai-llm-failed"), + ASSISTANT_NOT_INVALID("assistant-not-invalid"), ASSISTANT_NOT_PROVIDED("assistant-not-provided"), @@ -134,6 +139,37 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_OPENAI_500_SERVER_ERROR("pipeline-error-openai-500-server-error"), + PIPELINE_ERROR_GOOGLE_400_BAD_REQUEST_VALIDATION_FAILED("pipeline-error-google-400-bad-request-validation-failed"), + + PIPELINE_ERROR_GOOGLE_401_UNAUTHORIZED("pipeline-error-google-401-unauthorized"), + + PIPELINE_ERROR_GOOGLE_403_MODEL_ACCESS_DENIED("pipeline-error-google-403-model-access-denied"), + + PIPELINE_ERROR_GOOGLE_429_EXCEEDED_QUOTA("pipeline-error-google-429-exceeded-quota"), + + PIPELINE_ERROR_GOOGLE_500_SERVER_ERROR("pipeline-error-google-500-server-error"), + + PIPELINE_ERROR_XAI_400_BAD_REQUEST_VALIDATION_FAILED("pipeline-error-xai-400-bad-request-validation-failed"), + + PIPELINE_ERROR_XAI_401_UNAUTHORIZED("pipeline-error-xai-401-unauthorized"), + + PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED("pipeline-error-xai-403-model-access-denied"), + + PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA("pipeline-error-xai-429-exceeded-quota"), + + PIPELINE_ERROR_XAI_500_SERVER_ERROR("pipeline-error-xai-500-server-error"), + + PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED( + "pipeline-error-inflection-ai-400-bad-request-validation-failed"), + + PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED("pipeline-error-inflection-ai-401-unauthorized"), + + PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED("pipeline-error-inflection-ai-403-model-access-denied"), + + PIPELINE_ERROR_INFLECTION_AI_429_EXCEEDED_QUOTA("pipeline-error-inflection-ai-429-exceeded-quota"), + + PIPELINE_ERROR_INFLECTION_AI_500_SERVER_ERROR("pipeline-error-inflection-ai-500-server-error"), + PIPELINE_ERROR_AZURE_OPENAI_400_BAD_REQUEST_VALIDATION_FAILED( "pipeline-error-azure-openai-400-bad-request-validation-failed"), @@ -166,6 +202,8 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_ANTHROPIC_500_SERVER_ERROR("pipeline-error-anthropic-500-server-error"), + PIPELINE_ERROR_ANTHROPIC_LLM_FAILED("pipeline-error-anthropic-llm-failed"), + PIPELINE_ERROR_TOGETHER_AI_400_BAD_REQUEST_VALIDATION_FAILED( "pipeline-error-together-ai-400-bad-request-validation-failed"), @@ -256,6 +294,8 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_CUSTOM_LLM_LLM_FAILED("pipeline-error-custom-llm-llm-failed"), + PIPELINE_ERROR_CUSTOM_VOICE_FAILED("pipeline-error-custom-voice-failed"), + PIPELINE_ERROR_CARTESIA_SOCKET_HANG_UP("pipeline-error-cartesia-socket-hang-up"), PIPELINE_ERROR_CARTESIA_REQUESTED_PAYMENT("pipeline-error-cartesia-requested-payment"), @@ -266,8 +306,6 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_CARTESIA_522_SERVER_ERROR("pipeline-error-cartesia-522-server-error"), - PIPELINE_ERROR_CUSTOM_VOICE_FAILED("pipeline-error-custom-voice-failed"), - PIPELINE_ERROR_ELEVEN_LABS_VOICE_NOT_FOUND("pipeline-error-eleven-labs-voice-not-found"), PIPELINE_ERROR_ELEVEN_LABS_QUOTA_EXCEEDED("pipeline-error-eleven-labs-quota-exceeded"), @@ -317,6 +355,9 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_ELEVEN_LABS_MAX_CHARACTER_LIMIT_EXCEEDED("pipeline-error-eleven-labs-max-character-limit-exceeded"), + PIPELINE_ERROR_ELEVEN_LABS_BLOCKED_VOICE_POTENTIALLY_AGAINST_TERMS_OF_SERVICE_AND_AWAITING_VERIFICATION( + "pipeline-error-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification"), + PIPELINE_ERROR_PLAYHT_REQUEST_TIMED_OUT("pipeline-error-playht-request-timed-out"), PIPELINE_ERROR_PLAYHT_INVALID_VOICE("pipeline-error-playht-invalid-voice"), @@ -325,6 +366,8 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_PLAYHT_OUT_OF_CREDITS("pipeline-error-playht-out-of-credits"), + PIPELINE_ERROR_PLAYHT_INVALID_EMOTION("pipeline-error-playht-invalid-emotion"), + PIPELINE_ERROR_PLAYHT_VOICE_MUST_BE_A_VALID_VOICE_MANIFEST_URI( "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri"), @@ -341,26 +384,39 @@ public enum ServerMessageStatusUpdateEndedReason { PIPELINE_ERROR_PLAYHT_504_GATEWAY_ERROR("pipeline-error-playht-504-gateway-error"), - PIPELINE_ERROR_DEEPGRAM_403_MODEL_ACCESS_DENIED("pipeline-error-deepgram-403-model-access-denied"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_403_MODEL_ACCESS_DENIED( + "pipeline-error-deepgram-returning-403-model-access-denied"), - PIPELINE_ERROR_DEEPGRAM_404_NOT_FOUND("pipeline-error-deepgram-404-not-found"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_401_INVALID_CREDENTIALS( + "pipeline-error-deepgram-returning-401-invalid-credentials"), - PIPELINE_ERROR_DEEPGRAM_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION( - "pipeline-error-deepgram-400-no-such-model-language-tier-combination"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_404_NOT_FOUND("pipeline-error-deepgram-returning-404-not-found"), - PIPELINE_ERROR_DEEPGRAM_500_RETURNING_INVALID_JSON("pipeline-error-deepgram-500-returning-invalid-json"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION( + "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination"), - SIP_GATEWAY_FAILED_TO_CONNECT_CALL("sip-gateway-failed-to-connect-call"), + PIPELINE_ERROR_DEEPGRAM_RETURNING_500_INVALID_JSON("pipeline-error-deepgram-returning-500-invalid-json"), + + PIPELINE_ERROR_DEEPGRAM_RETURNING_502_NETWORK_ERROR("pipeline-error-deepgram-returning-502-network-error"), + + PIPELINE_ERROR_DEEPGRAM_RETURNING_502_BAD_GATEWAY_EHOSTUNREACH( + "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach"), + + PIPELINE_ERROR_TAVUS_VIDEO_FAILED("pipeline-error-tavus-video-failed"), + + PIPELINE_ERROR_CUSTOM_TRANSCRIBER_FAILED("pipeline-error-custom-transcriber-failed"), SILENCE_TIMED_OUT("silence-timed-out"), + SIP_GATEWAY_FAILED_TO_CONNECT_CALL("sip-gateway-failed-to-connect-call"), + TWILIO_FAILED_TO_CONNECT_CALL("twilio-failed-to-connect-call"), TWILIO_REPORTED_CUSTOMER_MISDIALED("twilio-reported-customer-misdialed"), - VOICEMAIL("voicemail"), + VONAGE_REJECTED("vonage-rejected"), - VONAGE_REJECTED("vonage-rejected"); + VOICEMAIL("voicemail"); private final String value; diff --git a/src/main/java/com/vapi/api/types/ServerMessageToolCallsToolWithToolCallListItem.java b/src/main/java/com/vapi/api/types/ServerMessageToolCallsToolWithToolCallListItem.java index fbf3f06..369b0fd 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageToolCallsToolWithToolCallListItem.java +++ b/src/main/java/com/vapi/api/types/ServerMessageToolCallsToolWithToolCallListItem.java @@ -3,257 +3,142 @@ */ package com.vapi.api.types; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; import java.util.Objects; -import java.util.Optional; +@JsonDeserialize(using = ServerMessageToolCallsToolWithToolCallListItem.Deserializer.class) public final class ServerMessageToolCallsToolWithToolCallListItem { - private final Value value; + private final Object value; - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private ServerMessageToolCallsToolWithToolCallListItem(Value value) { - this.value = value; - } + private final int type; - public T visit(Visitor visitor) { - return value.visit(visitor); + private ServerMessageToolCallsToolWithToolCallListItem(Object value, int type) { + this.value = value; + this.type = type; } - public static ServerMessageToolCallsToolWithToolCallListItem function(FunctionToolWithToolCall value) { - return new ServerMessageToolCallsToolWithToolCallListItem(new FunctionValue(value)); + @JsonValue + public Object get() { + return this.value; } - public static ServerMessageToolCallsToolWithToolCallListItem ghl(GhlToolWithToolCall value) { - return new ServerMessageToolCallsToolWithToolCallListItem(new GhlValue(value)); + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FunctionToolWithToolCall) this.value); + } else if (this.type == 1) { + return visitor.visit((GhlToolWithToolCall) this.value); + } else if (this.type == 2) { + return visitor.visit((MakeToolWithToolCall) this.value); + } else if (this.type == 3) { + return visitor.visit((Object) this.value); + } else if (this.type == 4) { + return visitor.visit((Object) this.value); + } else if (this.type == 5) { + return visitor.visit((Object) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); } - public static ServerMessageToolCallsToolWithToolCallListItem make(MakeToolWithToolCall value) { - return new ServerMessageToolCallsToolWithToolCallListItem(new MakeValue(value)); + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ServerMessageToolCallsToolWithToolCallListItem + && equalTo((ServerMessageToolCallsToolWithToolCallListItem) other); } - public boolean isFunction() { - return value instanceof FunctionValue; + private boolean equalTo(ServerMessageToolCallsToolWithToolCallListItem other) { + return value.equals(other.value); } - public boolean isGhl() { - return value instanceof GhlValue; + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); } - public boolean isMake() { - return value instanceof MakeValue; + @java.lang.Override + public String toString() { + return this.value.toString(); } - public boolean _isUnknown() { - return value instanceof _UnknownValue; + public static ServerMessageToolCallsToolWithToolCallListItem of(FunctionToolWithToolCall value) { + return new ServerMessageToolCallsToolWithToolCallListItem(value, 0); } - public Optional getFunction() { - if (isFunction()) { - return Optional.of(((FunctionValue) value).value); - } - return Optional.empty(); + public static ServerMessageToolCallsToolWithToolCallListItem of(GhlToolWithToolCall value) { + return new ServerMessageToolCallsToolWithToolCallListItem(value, 1); } - public Optional getGhl() { - if (isGhl()) { - return Optional.of(((GhlValue) value).value); - } - return Optional.empty(); + public static ServerMessageToolCallsToolWithToolCallListItem of(MakeToolWithToolCall value) { + return new ServerMessageToolCallsToolWithToolCallListItem(value, 2); } - public Optional getMake() { - if (isMake()) { - return Optional.of(((MakeValue) value).value); - } - return Optional.empty(); + public static ServerMessageToolCallsToolWithToolCallListItem of(Object value) { + return new ServerMessageToolCallsToolWithToolCallListItem(value, 3); } - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); + public static ServerMessageToolCallsToolWithToolCallListItem of(Object value) { + return new ServerMessageToolCallsToolWithToolCallListItem(value, 4); } - @JsonValue - private Value getValue() { - return this.value; + public static ServerMessageToolCallsToolWithToolCallListItem of(Object value) { + return new ServerMessageToolCallsToolWithToolCallListItem(value, 5); } public interface Visitor { - T visitFunction(FunctionToolWithToolCall function); - - T visitGhl(GhlToolWithToolCall ghl); - - T visitMake(MakeToolWithToolCall make); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({ - @JsonSubTypes.Type(FunctionValue.class), - @JsonSubTypes.Type(GhlValue.class), - @JsonSubTypes.Type(MakeValue.class) - }) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("function") - private static final class FunctionValue implements Value { - @JsonUnwrapped - private FunctionToolWithToolCall value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private FunctionValue() {} - - private FunctionValue(FunctionToolWithToolCall value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitFunction(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FunctionValue && equalTo((FunctionValue) other); - } - - private boolean equalTo(FunctionValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "ServerMessageToolCallsToolWithToolCallListItem{" + "value: " + value + "}"; - } - } - - @JsonTypeName("ghl") - private static final class GhlValue implements Value { - @JsonUnwrapped - private GhlToolWithToolCall value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private GhlValue() {} - - private GhlValue(GhlToolWithToolCall value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitGhl(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GhlValue && equalTo((GhlValue) other); - } - - private boolean equalTo(GhlValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "ServerMessageToolCallsToolWithToolCallListItem{" + "value: " + value + "}"; - } - } - - @JsonTypeName("make") - private static final class MakeValue implements Value { - @JsonUnwrapped - private MakeToolWithToolCall value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private MakeValue() {} - - private MakeValue(MakeToolWithToolCall value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitMake(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MakeValue && equalTo((MakeValue) other); - } - - private boolean equalTo(MakeValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "ServerMessageToolCallsToolWithToolCallListItem{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "ServerMessageToolCallsToolWithToolCallListItem{" + "type: " + type + ", value: " + value + "}"; + T visit(FunctionToolWithToolCall value); + + T visit(GhlToolWithToolCall value); + + T visit(MakeToolWithToolCall value); + + T visit(Object value); + + T visit(Object value); + + T visit(Object value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ServerMessageToolCallsToolWithToolCallListItem.class); + } + + @java.lang.Override + public ServerMessageToolCallsToolWithToolCallListItem deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FunctionToolWithToolCall.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, GhlToolWithToolCall.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, MakeToolWithToolCall.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/src/main/java/com/vapi/api/types/ServerMessageTransferUpdate.java b/src/main/java/com/vapi/api/types/ServerMessageTransferUpdate.java index 54ba6fd..3b93a00 100644 --- a/src/main/java/com/vapi/api/types/ServerMessageTransferUpdate.java +++ b/src/main/java/com/vapi/api/types/ServerMessageTransferUpdate.java @@ -38,6 +38,10 @@ public final class ServerMessageTransferUpdate { private final Optional fromAssistant; + private final Optional> toStepRecord; + + private final Optional> fromStepRecord; + private final Map additionalProperties; private ServerMessageTransferUpdate( @@ -50,6 +54,8 @@ private ServerMessageTransferUpdate( Optional call, Optional toAssistant, Optional fromAssistant, + Optional> toStepRecord, + Optional> fromStepRecord, Map additionalProperties) { this.phoneNumber = phoneNumber; this.destination = destination; @@ -60,6 +66,8 @@ private ServerMessageTransferUpdate( this.call = call; this.toAssistant = toAssistant; this.fromAssistant = fromAssistant; + this.toStepRecord = toStepRecord; + this.fromStepRecord = fromStepRecord; this.additionalProperties = additionalProperties; } @@ -157,6 +165,22 @@ public Optional getFromAssistant() { return fromAssistant; } + /** + * @return This is the step that the conversation moved to. + */ + @JsonProperty("toStepRecord") + public Optional> getToStepRecord() { + return toStepRecord; + } + + /** + * @return This is the step that the conversation moved from. = + */ + @JsonProperty("fromStepRecord") + public Optional> getFromStepRecord() { + return fromStepRecord; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -177,7 +201,9 @@ private boolean equalTo(ServerMessageTransferUpdate other) { && customer.equals(other.customer) && call.equals(other.call) && toAssistant.equals(other.toAssistant) - && fromAssistant.equals(other.fromAssistant); + && fromAssistant.equals(other.fromAssistant) + && toStepRecord.equals(other.toStepRecord) + && fromStepRecord.equals(other.fromStepRecord); } @java.lang.Override @@ -191,7 +217,9 @@ public int hashCode() { this.customer, this.call, this.toAssistant, - this.fromAssistant); + this.fromAssistant, + this.toStepRecord, + this.fromStepRecord); } @java.lang.Override @@ -223,6 +251,10 @@ public static final class Builder { private Optional fromAssistant = Optional.empty(); + private Optional> toStepRecord = Optional.empty(); + + private Optional> fromStepRecord = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +270,8 @@ public Builder from(ServerMessageTransferUpdate other) { call(other.getCall()); toAssistant(other.getToAssistant()); fromAssistant(other.getFromAssistant()); + toStepRecord(other.getToStepRecord()); + fromStepRecord(other.getFromStepRecord()); return this; } @@ -340,6 +374,28 @@ public Builder fromAssistant(CreateAssistantDto fromAssistant) { return this; } + @JsonSetter(value = "toStepRecord", nulls = Nulls.SKIP) + public Builder toStepRecord(Optional> toStepRecord) { + this.toStepRecord = toStepRecord; + return this; + } + + public Builder toStepRecord(Map toStepRecord) { + this.toStepRecord = Optional.ofNullable(toStepRecord); + return this; + } + + @JsonSetter(value = "fromStepRecord", nulls = Nulls.SKIP) + public Builder fromStepRecord(Optional> fromStepRecord) { + this.fromStepRecord = fromStepRecord; + return this; + } + + public Builder fromStepRecord(Map fromStepRecord) { + this.fromStepRecord = Optional.ofNullable(fromStepRecord); + return this; + } + public ServerMessageTransferUpdate build() { return new ServerMessageTransferUpdate( phoneNumber, @@ -351,6 +407,8 @@ public ServerMessageTransferUpdate build() { call, toAssistant, fromAssistant, + toStepRecord, + fromStepRecord, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/SipAuthentication.java b/src/main/java/com/vapi/api/types/SipAuthentication.java new file mode 100644 index 0000000..4f7e984 --- /dev/null +++ b/src/main/java/com/vapi/api/types/SipAuthentication.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SipAuthentication.Builder.class) +public final class SipAuthentication { + private final Optional realm; + + private final String username; + + private final String password; + + private final Map additionalProperties; + + private SipAuthentication( + Optional realm, String username, String password, Map additionalProperties) { + this.realm = realm; + this.username = username; + this.password = password; + this.additionalProperties = additionalProperties; + } + + /** + * @return This will be expected in the realm field of the authorization header of the SIP INVITE. Defaults to sip.vapi.ai. + */ + @JsonProperty("realm") + public Optional getRealm() { + return realm; + } + + /** + * @return This will be expected in the username field of the authorization header of the SIP INVITE. + */ + @JsonProperty("username") + public String getUsername() { + return username; + } + + /** + * @return This will be expected to generate the response field of the authorization header of the SIP INVITE, through digest authentication. + */ + @JsonProperty("password") + public String getPassword() { + return password; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SipAuthentication && equalTo((SipAuthentication) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SipAuthentication other) { + return realm.equals(other.realm) && username.equals(other.username) && password.equals(other.password); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.realm, this.username, this.password); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UsernameStage builder() { + return new Builder(); + } + + public interface UsernameStage { + PasswordStage username(@NotNull String username); + + Builder from(SipAuthentication other); + } + + public interface PasswordStage { + _FinalStage password(@NotNull String password); + } + + public interface _FinalStage { + SipAuthentication build(); + + _FinalStage realm(Optional realm); + + _FinalStage realm(String realm); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UsernameStage, PasswordStage, _FinalStage { + private String username; + + private String password; + + private Optional realm = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SipAuthentication other) { + realm(other.getRealm()); + username(other.getUsername()); + password(other.getPassword()); + return this; + } + + /** + *

      This will be expected in the username field of the authorization header of the SIP INVITE.

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

      This will be expected to generate the response field of the authorization header of the SIP INVITE, through digest authentication.

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

      This will be expected in the realm field of the authorization header of the SIP INVITE. Defaults to sip.vapi.ai.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage realm(String realm) { + this.realm = Optional.ofNullable(realm); + return this; + } + + @java.lang.Override + @JsonSetter(value = "realm", nulls = Nulls.SKIP) + public _FinalStage realm(Optional realm) { + this.realm = realm; + return this; + } + + @java.lang.Override + public SipAuthentication build() { + return new SipAuthentication(realm, username, password, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/StartSpeakingPlan.java b/src/main/java/com/vapi/api/types/StartSpeakingPlan.java index adc3751..1d19675 100644 --- a/src/main/java/com/vapi/api/types/StartSpeakingPlan.java +++ b/src/main/java/com/vapi/api/types/StartSpeakingPlan.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -24,6 +25,8 @@ public final class StartSpeakingPlan { private final Optional smartEndpointingEnabled; + private final Optional> customEndpointingRules; + private final Optional transcriptionEndpointingPlan; private final Map additionalProperties; @@ -31,17 +34,19 @@ public final class StartSpeakingPlan { private StartSpeakingPlan( Optional waitSeconds, Optional smartEndpointingEnabled, + Optional> customEndpointingRules, Optional transcriptionEndpointingPlan, Map additionalProperties) { this.waitSeconds = waitSeconds; this.smartEndpointingEnabled = smartEndpointingEnabled; + this.customEndpointingRules = customEndpointingRules; this.transcriptionEndpointingPlan = transcriptionEndpointingPlan; this.additionalProperties = additionalProperties; } /** * @return This is how long assistant waits before speaking. Defaults to 0.4. - *

      This is the minimum it will wait but if there is latency is the pipeline, this minimum will be exceeded. This is really a stopgap in case the pipeline is moving too fast.

      + *

      This is the minimum it will wait but if there is latency is the pipeline, this minimum will be exceeded. This is intended as a stopgap in case the pipeline is moving too fast.

      *

      Example:

      *
        *
      • If model generates tokens and voice generates bytes within 100ms, the pipeline still waits 300ms before outputting speech.
      • @@ -59,9 +64,13 @@ public Optional getWaitSeconds() { } /** - * @return This determines if a customer speech is considered done (endpointing) using the VAP model on customer's speech. This is good for middle-of-thought detection. + * @return This determines if a customer speech is considered done (endpointing) using a Vapi custom-trained model on customer's speech. This is good for middle-of-thought detection. *

        Once an endpoint is triggered, the request is sent to assistant.model.

        - *

        Default false since experimental.

        + *

        Usage:

        + *
          + *
        • If your conversations are long-form and you want assistant to wait smartly even if customer pauses for a bit to think, you can use this instead.
        • + *
        + *

        This overrides transcriptionEndpointingPlan.

        *

        @default false

        */ @JsonProperty("smartEndpointingEnabled") @@ -69,6 +78,23 @@ public Optional getSmartEndpointingEnabled() { return smartEndpointingEnabled; } + /** + * @return These are the custom endpointing rules to set an endpointing timeout based on a regex on the customer's speech or the assistant's last message. + *

        Usage:

        + *
          + *
        • If you have yes/no questions like "are you interested in a loan?", you can set a shorter timeout.
        • + *
        • If you have questions where the customer may pause to look up information like "what's my account number?", you can set a longer timeout.
        • + *
        • If you want to wait longer while customer is enumerating a list of numbers, you can set a longer timeout.
        • + *
        + *

        These override transcriptionEndpointingPlan and smartEndpointingEnabled when a rule is matched.

        + *

        The rules are evaluated in order and the first one that matches will be used.

        + *

        @default []

        + */ + @JsonProperty("customEndpointingRules") + public Optional> getCustomEndpointingRules() { + return customEndpointingRules; + } + /** * @return This determines how a customer speech is considered done (endpointing) using the transcription of customer's speech. *

        Once an endpoint is triggered, the request is sent to assistant.model.

        @@ -92,12 +118,17 @@ public Map getAdditionalProperties() { private boolean equalTo(StartSpeakingPlan other) { return waitSeconds.equals(other.waitSeconds) && smartEndpointingEnabled.equals(other.smartEndpointingEnabled) + && customEndpointingRules.equals(other.customEndpointingRules) && transcriptionEndpointingPlan.equals(other.transcriptionEndpointingPlan); } @java.lang.Override public int hashCode() { - return Objects.hash(this.waitSeconds, this.smartEndpointingEnabled, this.transcriptionEndpointingPlan); + return Objects.hash( + this.waitSeconds, + this.smartEndpointingEnabled, + this.customEndpointingRules, + this.transcriptionEndpointingPlan); } @java.lang.Override @@ -115,6 +146,8 @@ public static final class Builder { private Optional smartEndpointingEnabled = Optional.empty(); + private Optional> customEndpointingRules = Optional.empty(); + private Optional transcriptionEndpointingPlan = Optional.empty(); @JsonAnySetter @@ -125,6 +158,7 @@ private Builder() {} public Builder from(StartSpeakingPlan other) { waitSeconds(other.getWaitSeconds()); smartEndpointingEnabled(other.getSmartEndpointingEnabled()); + customEndpointingRules(other.getCustomEndpointingRules()); transcriptionEndpointingPlan(other.getTranscriptionEndpointingPlan()); return this; } @@ -151,6 +185,19 @@ public Builder smartEndpointingEnabled(Boolean smartEndpointingEnabled) { return this; } + @JsonSetter(value = "customEndpointingRules", nulls = Nulls.SKIP) + public Builder customEndpointingRules( + Optional> customEndpointingRules) { + this.customEndpointingRules = customEndpointingRules; + return this; + } + + public Builder customEndpointingRules( + List customEndpointingRules) { + this.customEndpointingRules = Optional.ofNullable(customEndpointingRules); + return this; + } + @JsonSetter(value = "transcriptionEndpointingPlan", nulls = Nulls.SKIP) public Builder transcriptionEndpointingPlan( Optional transcriptionEndpointingPlan) { @@ -165,7 +212,11 @@ public Builder transcriptionEndpointingPlan(TranscriptionEndpointingPlan transcr public StartSpeakingPlan build() { return new StartSpeakingPlan( - waitSeconds, smartEndpointingEnabled, transcriptionEndpointingPlan, additionalProperties); + waitSeconds, + smartEndpointingEnabled, + customEndpointingRules, + transcriptionEndpointingPlan, + additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/StartSpeakingPlanCustomEndpointingRulesItem.java b/src/main/java/com/vapi/api/types/StartSpeakingPlanCustomEndpointingRulesItem.java new file mode 100644 index 0000000..e0cb0df --- /dev/null +++ b/src/main/java/com/vapi/api/types/StartSpeakingPlanCustomEndpointingRulesItem.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class StartSpeakingPlanCustomEndpointingRulesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private StartSpeakingPlanCustomEndpointingRulesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static StartSpeakingPlanCustomEndpointingRulesItem assistant(AssistantCustomEndpointingRule value) { + return new StartSpeakingPlanCustomEndpointingRulesItem(new AssistantValue(value)); + } + + public static StartSpeakingPlanCustomEndpointingRulesItem customer(CustomerCustomEndpointingRule value) { + return new StartSpeakingPlanCustomEndpointingRulesItem(new CustomerValue(value)); + } + + public static StartSpeakingPlanCustomEndpointingRulesItem both(BothCustomEndpointingRule value) { + return new StartSpeakingPlanCustomEndpointingRulesItem(new BothValue(value)); + } + + public boolean isAssistant() { + return value instanceof AssistantValue; + } + + public boolean isCustomer() { + return value instanceof CustomerValue; + } + + public boolean isBoth() { + return value instanceof BothValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getAssistant() { + if (isAssistant()) { + return Optional.of(((AssistantValue) value).value); + } + return Optional.empty(); + } + + public Optional getCustomer() { + if (isCustomer()) { + return Optional.of(((CustomerValue) value).value); + } + return Optional.empty(); + } + + public Optional getBoth() { + if (isBoth()) { + return Optional.of(((BothValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitAssistant(AssistantCustomEndpointingRule assistant); + + T visitCustomer(CustomerCustomEndpointingRule customer); + + T visitBoth(BothCustomEndpointingRule both); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(AssistantValue.class), + @JsonSubTypes.Type(CustomerValue.class), + @JsonSubTypes.Type(BothValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("assistant") + private static final class AssistantValue implements Value { + @JsonUnwrapped + private AssistantCustomEndpointingRule value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AssistantValue() {} + + private AssistantValue(AssistantCustomEndpointingRule value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAssistant(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssistantValue && equalTo((AssistantValue) other); + } + + private boolean equalTo(AssistantValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "StartSpeakingPlanCustomEndpointingRulesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("customer") + private static final class CustomerValue implements Value { + @JsonUnwrapped + private CustomerCustomEndpointingRule value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CustomerValue() {} + + private CustomerValue(CustomerCustomEndpointingRule value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitCustomer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomerValue && equalTo((CustomerValue) other); + } + + private boolean equalTo(CustomerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "StartSpeakingPlanCustomEndpointingRulesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("both") + private static final class BothValue implements Value { + @JsonUnwrapped + private BothCustomEndpointingRule value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BothValue() {} + + private BothValue(BothCustomEndpointingRule value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBoth(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BothValue && equalTo((BothValue) other); + } + + private boolean equalTo(BothValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "StartSpeakingPlanCustomEndpointingRulesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "StartSpeakingPlanCustomEndpointingRulesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/Subscription.java b/src/main/java/com/vapi/api/types/Subscription.java new file mode 100644 index 0000000..e044771 --- /dev/null +++ b/src/main/java/com/vapi/api/types/Subscription.java @@ -0,0 +1,1221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +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 = Subscription.Builder.class) +public final class Subscription { + private final String id; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final SubscriptionType type; + + private final SubscriptionStatus status; + + private final String credits; + + private final double concurrencyLimit; + + private final double concurrencyLimitIncluded; + + private final double concurrencyLimitPurchased; + + private final Optional monthlyChargeScheduleId; + + private final Optional monthlyCreditCheckScheduleId; + + private final Optional stripeCustomerId; + + private final Optional stripePaymentMethodId; + + private final Optional slackSupportEnabled; + + private final Optional slackChannelId; + + private final Optional hipaaEnabled; + + private final Optional hipaaCommonPaperAgreementId; + + private final Optional stripePaymentMethodFingerprint; + + private final Optional stripeCustomerEmail; + + private final Optional referredByEmail; + + private final Optional autoReloadPlan; + + private final Optional minutesIncluded; + + private final Optional minutesUsed; + + private final Optional minutesOverageCost; + + private final Optional> providersIncluded; + + private final Optional outboundCallsDailyLimit; + + private final Optional outboundCallsCounter; + + private final Optional outboundCallsCounterNextResetAt; + + private final Optional> couponIds; + + private final Optional couponUsageLeft; + + private final Map additionalProperties; + + private Subscription( + String id, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + SubscriptionType type, + SubscriptionStatus status, + String credits, + double concurrencyLimit, + double concurrencyLimitIncluded, + double concurrencyLimitPurchased, + Optional monthlyChargeScheduleId, + Optional monthlyCreditCheckScheduleId, + Optional stripeCustomerId, + Optional stripePaymentMethodId, + Optional slackSupportEnabled, + Optional slackChannelId, + Optional hipaaEnabled, + Optional hipaaCommonPaperAgreementId, + Optional stripePaymentMethodFingerprint, + Optional stripeCustomerEmail, + Optional referredByEmail, + Optional autoReloadPlan, + Optional minutesIncluded, + Optional minutesUsed, + Optional minutesOverageCost, + Optional> providersIncluded, + Optional outboundCallsDailyLimit, + Optional outboundCallsCounter, + Optional outboundCallsCounterNextResetAt, + Optional> couponIds, + Optional couponUsageLeft, + Map additionalProperties) { + this.id = id; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.type = type; + this.status = status; + this.credits = credits; + this.concurrencyLimit = concurrencyLimit; + this.concurrencyLimitIncluded = concurrencyLimitIncluded; + this.concurrencyLimitPurchased = concurrencyLimitPurchased; + this.monthlyChargeScheduleId = monthlyChargeScheduleId; + this.monthlyCreditCheckScheduleId = monthlyCreditCheckScheduleId; + this.stripeCustomerId = stripeCustomerId; + this.stripePaymentMethodId = stripePaymentMethodId; + this.slackSupportEnabled = slackSupportEnabled; + this.slackChannelId = slackChannelId; + this.hipaaEnabled = hipaaEnabled; + this.hipaaCommonPaperAgreementId = hipaaCommonPaperAgreementId; + this.stripePaymentMethodFingerprint = stripePaymentMethodFingerprint; + this.stripeCustomerEmail = stripeCustomerEmail; + this.referredByEmail = referredByEmail; + this.autoReloadPlan = autoReloadPlan; + this.minutesIncluded = minutesIncluded; + this.minutesUsed = minutesUsed; + this.minutesOverageCost = minutesOverageCost; + this.providersIncluded = providersIncluded; + this.outboundCallsDailyLimit = outboundCallsDailyLimit; + this.outboundCallsCounter = outboundCallsCounter; + this.outboundCallsCounterNextResetAt = outboundCallsCounterNextResetAt; + this.couponIds = couponIds; + this.couponUsageLeft = couponUsageLeft; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the unique identifier for the subscription. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the timestamp when the subscription was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the timestamp when the subscription was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the type / tier of the subscription. + */ + @JsonProperty("type") + public SubscriptionType getType() { + return type; + } + + /** + * @return This is the status of the subscription. Past due subscriptions are subscriptions + * with past due payments. + */ + @JsonProperty("status") + public SubscriptionStatus getStatus() { + return status; + } + + /** + * @return This is the number of credits the subscription currently has. + *

        Note: This is a string to avoid floating point precision issues.

        + */ + @JsonProperty("credits") + public String getCredits() { + return credits; + } + + /** + * @return This is the total concurrency limit for the subscription. + */ + @JsonProperty("concurrencyLimit") + public double getConcurrencyLimit() { + return concurrencyLimit; + } + + /** + * @return This is the default concurrency limit for the subscription. + */ + @JsonProperty("concurrencyLimitIncluded") + public double getConcurrencyLimitIncluded() { + return concurrencyLimitIncluded; + } + + /** + * @return This is the purchased add-on concurrency limit for the subscription. + */ + @JsonProperty("concurrencyLimitPurchased") + public double getConcurrencyLimitPurchased() { + return concurrencyLimitPurchased; + } + + /** + * @return This is the ID of the monthly job that charges for subscription add ons and phone numbers. + */ + @JsonProperty("monthlyChargeScheduleId") + public Optional getMonthlyChargeScheduleId() { + return monthlyChargeScheduleId; + } + + /** + * @return This is the ID of the monthly job that checks whether the credit balance of the subscription + * is sufficient for the monthly charge. + */ + @JsonProperty("monthlyCreditCheckScheduleId") + public Optional getMonthlyCreditCheckScheduleId() { + return monthlyCreditCheckScheduleId; + } + + /** + * @return This is the Stripe customer ID. + */ + @JsonProperty("stripeCustomerId") + public Optional getStripeCustomerId() { + return stripeCustomerId; + } + + /** + * @return This is the Stripe payment ID. + */ + @JsonProperty("stripePaymentMethodId") + public Optional getStripePaymentMethodId() { + return stripePaymentMethodId; + } + + /** + * @return If this flag is true, then the user has purchased slack support. + */ + @JsonProperty("slackSupportEnabled") + public Optional getSlackSupportEnabled() { + return slackSupportEnabled; + } + + /** + * @return If this subscription has a slack support subscription, the slack channel's ID will be stored here. + */ + @JsonProperty("slackChannelId") + public Optional getSlackChannelId() { + return slackChannelId; + } + + /** + * @return This is the HIPAA enabled flag for the subscription. It determines whether orgs under this + * subscription have the option to enable HIPAA compliance. + */ + @JsonProperty("hipaaEnabled") + public Optional getHipaaEnabled() { + return hipaaEnabled; + } + + /** + * @return This is the ID for the Common Paper agreement outlining the HIPAA contract. + */ + @JsonProperty("hipaaCommonPaperAgreementId") + public Optional getHipaaCommonPaperAgreementId() { + return hipaaCommonPaperAgreementId; + } + + /** + * @return This is the Stripe fingerprint of the payment method (card). It allows us + * to detect users who try to abuse our system through multiple sign-ups. + */ + @JsonProperty("stripePaymentMethodFingerprint") + public Optional getStripePaymentMethodFingerprint() { + return stripePaymentMethodFingerprint; + } + + /** + * @return This is the stripe customer's email. + */ + @JsonProperty("stripeCustomerEmail") + public Optional getStripeCustomerEmail() { + return stripeCustomerEmail; + } + + /** + * @return This is the email of the referrer for the subscription. + */ + @JsonProperty("referredByEmail") + public Optional getReferredByEmail() { + return referredByEmail; + } + + /** + * @return This is the auto reload plan configured for the subscription. + */ + @JsonProperty("autoReloadPlan") + public Optional getAutoReloadPlan() { + return autoReloadPlan; + } + + /** + * @return The number of minutes included in the subscription. Enterprise only. + */ + @JsonProperty("minutesIncluded") + public Optional getMinutesIncluded() { + return minutesIncluded; + } + + /** + * @return The number of minutes used in the subscription. Enterprise only. + */ + @JsonProperty("minutesUsed") + public Optional getMinutesUsed() { + return minutesUsed; + } + + /** + * @return The per minute charge on minutes that exceed the included minutes. Enterprise only. + */ + @JsonProperty("minutesOverageCost") + public Optional getMinutesOverageCost() { + return minutesOverageCost; + } + + /** + * @return The list of providers included in the subscription. Enterprise only. + */ + @JsonProperty("providersIncluded") + public Optional> getProvidersIncluded() { + return providersIncluded; + } + + /** + * @return The maximum number of outbound calls this subscription may make in a day. Resets every night. + */ + @JsonProperty("outboundCallsDailyLimit") + public Optional getOutboundCallsDailyLimit() { + return outboundCallsDailyLimit; + } + + /** + * @return The current number of outbound calls the subscription has made in the current day. + */ + @JsonProperty("outboundCallsCounter") + public Optional getOutboundCallsCounter() { + return outboundCallsCounter; + } + + /** + * @return This is the timestamp at which the outbound calls counter is scheduled to reset at. + */ + @JsonProperty("outboundCallsCounterNextResetAt") + public Optional getOutboundCallsCounterNextResetAt() { + return outboundCallsCounterNextResetAt; + } + + /** + * @return This is the IDs of the coupons applicable to this subscription. + */ + @JsonProperty("couponIds") + public Optional> getCouponIds() { + return couponIds; + } + + /** + * @return This is the number of credits left obtained from a coupon. + */ + @JsonProperty("couponUsageLeft") + public Optional getCouponUsageLeft() { + return couponUsageLeft; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Subscription && equalTo((Subscription) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Subscription other) { + return id.equals(other.id) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && type.equals(other.type) + && status.equals(other.status) + && credits.equals(other.credits) + && concurrencyLimit == other.concurrencyLimit + && concurrencyLimitIncluded == other.concurrencyLimitIncluded + && concurrencyLimitPurchased == other.concurrencyLimitPurchased + && monthlyChargeScheduleId.equals(other.monthlyChargeScheduleId) + && monthlyCreditCheckScheduleId.equals(other.monthlyCreditCheckScheduleId) + && stripeCustomerId.equals(other.stripeCustomerId) + && stripePaymentMethodId.equals(other.stripePaymentMethodId) + && slackSupportEnabled.equals(other.slackSupportEnabled) + && slackChannelId.equals(other.slackChannelId) + && hipaaEnabled.equals(other.hipaaEnabled) + && hipaaCommonPaperAgreementId.equals(other.hipaaCommonPaperAgreementId) + && stripePaymentMethodFingerprint.equals(other.stripePaymentMethodFingerprint) + && stripeCustomerEmail.equals(other.stripeCustomerEmail) + && referredByEmail.equals(other.referredByEmail) + && autoReloadPlan.equals(other.autoReloadPlan) + && minutesIncluded.equals(other.minutesIncluded) + && minutesUsed.equals(other.minutesUsed) + && minutesOverageCost.equals(other.minutesOverageCost) + && providersIncluded.equals(other.providersIncluded) + && outboundCallsDailyLimit.equals(other.outboundCallsDailyLimit) + && outboundCallsCounter.equals(other.outboundCallsCounter) + && outboundCallsCounterNextResetAt.equals(other.outboundCallsCounterNextResetAt) + && couponIds.equals(other.couponIds) + && couponUsageLeft.equals(other.couponUsageLeft); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.createdAt, + this.updatedAt, + this.type, + this.status, + this.credits, + this.concurrencyLimit, + this.concurrencyLimitIncluded, + this.concurrencyLimitPurchased, + this.monthlyChargeScheduleId, + this.monthlyCreditCheckScheduleId, + this.stripeCustomerId, + this.stripePaymentMethodId, + this.slackSupportEnabled, + this.slackChannelId, + this.hipaaEnabled, + this.hipaaCommonPaperAgreementId, + this.stripePaymentMethodFingerprint, + this.stripeCustomerEmail, + this.referredByEmail, + this.autoReloadPlan, + this.minutesIncluded, + this.minutesUsed, + this.minutesOverageCost, + this.providersIncluded, + this.outboundCallsDailyLimit, + this.outboundCallsCounter, + this.outboundCallsCounterNextResetAt, + this.couponIds, + this.couponUsageLeft); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CreatedAtStage id(@NotNull String id); + + Builder from(Subscription other); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + TypeStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface TypeStage { + StatusStage type(@NotNull SubscriptionType type); + } + + public interface StatusStage { + CreditsStage status(@NotNull SubscriptionStatus status); + } + + public interface CreditsStage { + ConcurrencyLimitStage credits(@NotNull String credits); + } + + public interface ConcurrencyLimitStage { + ConcurrencyLimitIncludedStage concurrencyLimit(double concurrencyLimit); + } + + public interface ConcurrencyLimitIncludedStage { + ConcurrencyLimitPurchasedStage concurrencyLimitIncluded(double concurrencyLimitIncluded); + } + + public interface ConcurrencyLimitPurchasedStage { + _FinalStage concurrencyLimitPurchased(double concurrencyLimitPurchased); + } + + public interface _FinalStage { + Subscription build(); + + _FinalStage monthlyChargeScheduleId(Optional monthlyChargeScheduleId); + + _FinalStage monthlyChargeScheduleId(Double monthlyChargeScheduleId); + + _FinalStage monthlyCreditCheckScheduleId(Optional monthlyCreditCheckScheduleId); + + _FinalStage monthlyCreditCheckScheduleId(Double monthlyCreditCheckScheduleId); + + _FinalStage stripeCustomerId(Optional stripeCustomerId); + + _FinalStage stripeCustomerId(String stripeCustomerId); + + _FinalStage stripePaymentMethodId(Optional stripePaymentMethodId); + + _FinalStage stripePaymentMethodId(String stripePaymentMethodId); + + _FinalStage slackSupportEnabled(Optional slackSupportEnabled); + + _FinalStage slackSupportEnabled(Boolean slackSupportEnabled); + + _FinalStage slackChannelId(Optional slackChannelId); + + _FinalStage slackChannelId(String slackChannelId); + + _FinalStage hipaaEnabled(Optional hipaaEnabled); + + _FinalStage hipaaEnabled(Boolean hipaaEnabled); + + _FinalStage hipaaCommonPaperAgreementId(Optional hipaaCommonPaperAgreementId); + + _FinalStage hipaaCommonPaperAgreementId(String hipaaCommonPaperAgreementId); + + _FinalStage stripePaymentMethodFingerprint(Optional stripePaymentMethodFingerprint); + + _FinalStage stripePaymentMethodFingerprint(String stripePaymentMethodFingerprint); + + _FinalStage stripeCustomerEmail(Optional stripeCustomerEmail); + + _FinalStage stripeCustomerEmail(String stripeCustomerEmail); + + _FinalStage referredByEmail(Optional referredByEmail); + + _FinalStage referredByEmail(String referredByEmail); + + _FinalStage autoReloadPlan(Optional autoReloadPlan); + + _FinalStage autoReloadPlan(AutoReloadPlan autoReloadPlan); + + _FinalStage minutesIncluded(Optional minutesIncluded); + + _FinalStage minutesIncluded(Double minutesIncluded); + + _FinalStage minutesUsed(Optional minutesUsed); + + _FinalStage minutesUsed(Double minutesUsed); + + _FinalStage minutesOverageCost(Optional minutesOverageCost); + + _FinalStage minutesOverageCost(Double minutesOverageCost); + + _FinalStage providersIncluded(Optional> providersIncluded); + + _FinalStage providersIncluded(List providersIncluded); + + _FinalStage outboundCallsDailyLimit(Optional outboundCallsDailyLimit); + + _FinalStage outboundCallsDailyLimit(Double outboundCallsDailyLimit); + + _FinalStage outboundCallsCounter(Optional outboundCallsCounter); + + _FinalStage outboundCallsCounter(Double outboundCallsCounter); + + _FinalStage outboundCallsCounterNextResetAt(Optional outboundCallsCounterNextResetAt); + + _FinalStage outboundCallsCounterNextResetAt(OffsetDateTime outboundCallsCounterNextResetAt); + + _FinalStage couponIds(Optional> couponIds); + + _FinalStage couponIds(List couponIds); + + _FinalStage couponUsageLeft(Optional couponUsageLeft); + + _FinalStage couponUsageLeft(String couponUsageLeft); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + CreatedAtStage, + UpdatedAtStage, + TypeStage, + StatusStage, + CreditsStage, + ConcurrencyLimitStage, + ConcurrencyLimitIncludedStage, + ConcurrencyLimitPurchasedStage, + _FinalStage { + private String id; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private SubscriptionType type; + + private SubscriptionStatus status; + + private String credits; + + private double concurrencyLimit; + + private double concurrencyLimitIncluded; + + private double concurrencyLimitPurchased; + + private Optional couponUsageLeft = Optional.empty(); + + private Optional> couponIds = Optional.empty(); + + private Optional outboundCallsCounterNextResetAt = Optional.empty(); + + private Optional outboundCallsCounter = Optional.empty(); + + private Optional outboundCallsDailyLimit = Optional.empty(); + + private Optional> providersIncluded = Optional.empty(); + + private Optional minutesOverageCost = Optional.empty(); + + private Optional minutesUsed = Optional.empty(); + + private Optional minutesIncluded = Optional.empty(); + + private Optional autoReloadPlan = Optional.empty(); + + private Optional referredByEmail = Optional.empty(); + + private Optional stripeCustomerEmail = Optional.empty(); + + private Optional stripePaymentMethodFingerprint = Optional.empty(); + + private Optional hipaaCommonPaperAgreementId = Optional.empty(); + + private Optional hipaaEnabled = Optional.empty(); + + private Optional slackChannelId = Optional.empty(); + + private Optional slackSupportEnabled = Optional.empty(); + + private Optional stripePaymentMethodId = Optional.empty(); + + private Optional stripeCustomerId = Optional.empty(); + + private Optional monthlyCreditCheckScheduleId = Optional.empty(); + + private Optional monthlyChargeScheduleId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Subscription other) { + id(other.getId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + type(other.getType()); + status(other.getStatus()); + credits(other.getCredits()); + concurrencyLimit(other.getConcurrencyLimit()); + concurrencyLimitIncluded(other.getConcurrencyLimitIncluded()); + concurrencyLimitPurchased(other.getConcurrencyLimitPurchased()); + monthlyChargeScheduleId(other.getMonthlyChargeScheduleId()); + monthlyCreditCheckScheduleId(other.getMonthlyCreditCheckScheduleId()); + stripeCustomerId(other.getStripeCustomerId()); + stripePaymentMethodId(other.getStripePaymentMethodId()); + slackSupportEnabled(other.getSlackSupportEnabled()); + slackChannelId(other.getSlackChannelId()); + hipaaEnabled(other.getHipaaEnabled()); + hipaaCommonPaperAgreementId(other.getHipaaCommonPaperAgreementId()); + stripePaymentMethodFingerprint(other.getStripePaymentMethodFingerprint()); + stripeCustomerEmail(other.getStripeCustomerEmail()); + referredByEmail(other.getReferredByEmail()); + autoReloadPlan(other.getAutoReloadPlan()); + minutesIncluded(other.getMinutesIncluded()); + minutesUsed(other.getMinutesUsed()); + minutesOverageCost(other.getMinutesOverageCost()); + providersIncluded(other.getProvidersIncluded()); + outboundCallsDailyLimit(other.getOutboundCallsDailyLimit()); + outboundCallsCounter(other.getOutboundCallsCounter()); + outboundCallsCounterNextResetAt(other.getOutboundCallsCounterNextResetAt()); + couponIds(other.getCouponIds()); + couponUsageLeft(other.getCouponUsageLeft()); + return this; + } + + /** + *

        This is the unique identifier for the subscription.

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

        This is the timestamp when the subscription was created.

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

        This is the timestamp when the subscription was last updated.

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

        This is the type / tier of the subscription.

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

        This is the status of the subscription. Past due subscriptions are subscriptions + * with past due payments.

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

        This is the number of credits the subscription currently has.

        + *

        Note: This is a string to avoid floating point precision issues.

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

        This is the total concurrency limit for the subscription.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("concurrencyLimit") + public ConcurrencyLimitIncludedStage concurrencyLimit(double concurrencyLimit) { + this.concurrencyLimit = concurrencyLimit; + return this; + } + + /** + *

        This is the default concurrency limit for the subscription.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("concurrencyLimitIncluded") + public ConcurrencyLimitPurchasedStage concurrencyLimitIncluded(double concurrencyLimitIncluded) { + this.concurrencyLimitIncluded = concurrencyLimitIncluded; + return this; + } + + /** + *

        This is the purchased add-on concurrency limit for the subscription.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("concurrencyLimitPurchased") + public _FinalStage concurrencyLimitPurchased(double concurrencyLimitPurchased) { + this.concurrencyLimitPurchased = concurrencyLimitPurchased; + return this; + } + + /** + *

        This is the number of credits left obtained from a coupon.

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

        This is the IDs of the coupons applicable to this subscription.

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

        This is the timestamp at which the outbound calls counter is scheduled to reset at.

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

        The current number of outbound calls the subscription has made in the current day.

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

        The maximum number of outbound calls this subscription may make in a day. Resets every night.

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

        The list of providers included in the subscription. Enterprise only.

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

        The per minute charge on minutes that exceed the included minutes. Enterprise only.

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

        The number of minutes used in the subscription. Enterprise only.

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

        The number of minutes included in the subscription. Enterprise only.

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

        This is the auto reload plan configured for the subscription.

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

        This is the email of the referrer for the subscription.

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

        This is the stripe customer's email.

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

        This is the Stripe fingerprint of the payment method (card). It allows us + * to detect users who try to abuse our system through multiple sign-ups.

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

        This is the ID for the Common Paper agreement outlining the HIPAA contract.

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

        This is the HIPAA enabled flag for the subscription. It determines whether orgs under this + * subscription have the option to enable HIPAA compliance.

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

        If this subscription has a slack support subscription, the slack channel's ID will be stored here.

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

        If this flag is true, then the user has purchased slack support.

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

        This is the Stripe payment ID.

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

        This is the Stripe customer ID.

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

        This is the ID of the monthly job that checks whether the credit balance of the subscription + * is sufficient for the monthly charge.

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

        This is the ID of the monthly job that charges for subscription add ons and phone numbers.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage monthlyChargeScheduleId(Double monthlyChargeScheduleId) { + this.monthlyChargeScheduleId = Optional.ofNullable(monthlyChargeScheduleId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "monthlyChargeScheduleId", nulls = Nulls.SKIP) + public _FinalStage monthlyChargeScheduleId(Optional monthlyChargeScheduleId) { + this.monthlyChargeScheduleId = monthlyChargeScheduleId; + return this; + } + + @java.lang.Override + public Subscription build() { + return new Subscription( + id, + createdAt, + updatedAt, + type, + status, + credits, + concurrencyLimit, + concurrencyLimitIncluded, + concurrencyLimitPurchased, + monthlyChargeScheduleId, + monthlyCreditCheckScheduleId, + stripeCustomerId, + stripePaymentMethodId, + slackSupportEnabled, + slackChannelId, + hipaaEnabled, + hipaaCommonPaperAgreementId, + stripePaymentMethodFingerprint, + stripeCustomerEmail, + referredByEmail, + autoReloadPlan, + minutesIncluded, + minutesUsed, + minutesOverageCost, + providersIncluded, + outboundCallsDailyLimit, + outboundCallsCounter, + outboundCallsCounterNextResetAt, + couponIds, + couponUsageLeft, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/SubscriptionConcurrencyLineBuyDto.java b/src/main/java/com/vapi/api/types/SubscriptionConcurrencyLineBuyDto.java new file mode 100644 index 0000000..dbf5c99 --- /dev/null +++ b/src/main/java/com/vapi/api/types/SubscriptionConcurrencyLineBuyDto.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SubscriptionConcurrencyLineBuyDto.Builder.class) +public final class SubscriptionConcurrencyLineBuyDto { + private final double quantity; + + private final Map additionalProperties; + + private SubscriptionConcurrencyLineBuyDto(double quantity, Map additionalProperties) { + this.quantity = quantity; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the number of concurrency lines to purchase. + */ + @JsonProperty("quantity") + public double getQuantity() { + return quantity; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SubscriptionConcurrencyLineBuyDto && equalTo((SubscriptionConcurrencyLineBuyDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SubscriptionConcurrencyLineBuyDto other) { + return quantity == other.quantity; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.quantity); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static QuantityStage builder() { + return new Builder(); + } + + public interface QuantityStage { + _FinalStage quantity(double quantity); + + Builder from(SubscriptionConcurrencyLineBuyDto other); + } + + public interface _FinalStage { + SubscriptionConcurrencyLineBuyDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements QuantityStage, _FinalStage { + private double quantity; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SubscriptionConcurrencyLineBuyDto other) { + quantity(other.getQuantity()); + return this; + } + + /** + *

        This is the number of concurrency lines to purchase.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("quantity") + public _FinalStage quantity(double quantity) { + this.quantity = quantity; + return this; + } + + @java.lang.Override + public SubscriptionConcurrencyLineBuyDto build() { + return new SubscriptionConcurrencyLineBuyDto(quantity, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/SubscriptionConcurrencyLineRemoveDto.java b/src/main/java/com/vapi/api/types/SubscriptionConcurrencyLineRemoveDto.java new file mode 100644 index 0000000..41fab63 --- /dev/null +++ b/src/main/java/com/vapi/api/types/SubscriptionConcurrencyLineRemoveDto.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SubscriptionConcurrencyLineRemoveDto.Builder.class) +public final class SubscriptionConcurrencyLineRemoveDto { + private final double quantity; + + private final Map additionalProperties; + + private SubscriptionConcurrencyLineRemoveDto(double quantity, Map additionalProperties) { + this.quantity = quantity; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the number of concurrency lines to remove. + */ + @JsonProperty("quantity") + public double getQuantity() { + return quantity; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SubscriptionConcurrencyLineRemoveDto + && equalTo((SubscriptionConcurrencyLineRemoveDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SubscriptionConcurrencyLineRemoveDto other) { + return quantity == other.quantity; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.quantity); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static QuantityStage builder() { + return new Builder(); + } + + public interface QuantityStage { + _FinalStage quantity(double quantity); + + Builder from(SubscriptionConcurrencyLineRemoveDto other); + } + + public interface _FinalStage { + SubscriptionConcurrencyLineRemoveDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements QuantityStage, _FinalStage { + private double quantity; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SubscriptionConcurrencyLineRemoveDto other) { + quantity(other.getQuantity()); + return this; + } + + /** + *

        This is the number of concurrency lines to remove.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("quantity") + public _FinalStage quantity(double quantity) { + this.quantity = quantity; + return this; + } + + @java.lang.Override + public SubscriptionConcurrencyLineRemoveDto build() { + return new SubscriptionConcurrencyLineRemoveDto(quantity, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/SubscriptionCouponAddDto.java b/src/main/java/com/vapi/api/types/SubscriptionCouponAddDto.java new file mode 100644 index 0000000..b6dc1e7 --- /dev/null +++ b/src/main/java/com/vapi/api/types/SubscriptionCouponAddDto.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SubscriptionCouponAddDto.Builder.class) +public final class SubscriptionCouponAddDto { + private final String orgId; + + private final String couponCode; + + private final Map additionalProperties; + + private SubscriptionCouponAddDto(String orgId, String couponCode, Map additionalProperties) { + this.orgId = orgId; + this.couponCode = couponCode; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the ID of the org within the subscription which the coupon will take effect on. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the code of the coupon to apply to the subscription. + */ + @JsonProperty("couponCode") + public String getCouponCode() { + return couponCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SubscriptionCouponAddDto && equalTo((SubscriptionCouponAddDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SubscriptionCouponAddDto other) { + return orgId.equals(other.orgId) && couponCode.equals(other.couponCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.orgId, this.couponCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OrgIdStage builder() { + return new Builder(); + } + + public interface OrgIdStage { + CouponCodeStage orgId(@NotNull String orgId); + + Builder from(SubscriptionCouponAddDto other); + } + + public interface CouponCodeStage { + _FinalStage couponCode(@NotNull String couponCode); + } + + public interface _FinalStage { + SubscriptionCouponAddDto build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OrgIdStage, CouponCodeStage, _FinalStage { + private String orgId; + + private String couponCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SubscriptionCouponAddDto other) { + orgId(other.getOrgId()); + couponCode(other.getCouponCode()); + return this; + } + + /** + *

        This is the ID of the org within the subscription which the coupon will take effect on.

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

        This is the code of the coupon to apply to the subscription.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("couponCode") + public _FinalStage couponCode(@NotNull String couponCode) { + this.couponCode = Objects.requireNonNull(couponCode, "couponCode must not be null"); + return this; + } + + @java.lang.Override + public SubscriptionCouponAddDto build() { + return new SubscriptionCouponAddDto(orgId, couponCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/SubscriptionMonthlyCharge.java b/src/main/java/com/vapi/api/types/SubscriptionMonthlyCharge.java new file mode 100644 index 0000000..01bd029 --- /dev/null +++ b/src/main/java/com/vapi/api/types/SubscriptionMonthlyCharge.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SubscriptionMonthlyCharge.Builder.class) +public final class SubscriptionMonthlyCharge { + private final double monthlyCharge; + + private final List> costs; + + private final Map additionalProperties; + + private SubscriptionMonthlyCharge( + double monthlyCharge, List> costs, Map additionalProperties) { + this.monthlyCharge = monthlyCharge; + this.costs = costs; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the monthly charge for the subscription. + */ + @JsonProperty("monthlyCharge") + public double getMonthlyCharge() { + return monthlyCharge; + } + + /** + * @return These are the different costs that make up the monthly charge. + */ + @JsonProperty("costs") + public List> getCosts() { + return costs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SubscriptionMonthlyCharge && equalTo((SubscriptionMonthlyCharge) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SubscriptionMonthlyCharge other) { + return monthlyCharge == other.monthlyCharge && costs.equals(other.costs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.monthlyCharge, this.costs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MonthlyChargeStage builder() { + return new Builder(); + } + + public interface MonthlyChargeStage { + _FinalStage monthlyCharge(double monthlyCharge); + + Builder from(SubscriptionMonthlyCharge other); + } + + public interface _FinalStage { + SubscriptionMonthlyCharge build(); + + _FinalStage costs(List> costs); + + _FinalStage addCosts(Map costs); + + _FinalStage addAllCosts(List> costs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MonthlyChargeStage, _FinalStage { + private double monthlyCharge; + + private List> costs = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SubscriptionMonthlyCharge other) { + monthlyCharge(other.getMonthlyCharge()); + costs(other.getCosts()); + return this; + } + + /** + *

        This is the monthly charge for the subscription.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("monthlyCharge") + public _FinalStage monthlyCharge(double monthlyCharge) { + this.monthlyCharge = monthlyCharge; + return this; + } + + /** + *

        These are the different costs that make up the monthly charge.

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

        These are the different costs that make up the monthly charge.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCosts(Map costs) { + this.costs.add(costs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "costs", nulls = Nulls.SKIP) + public _FinalStage costs(List> costs) { + this.costs.clear(); + this.costs.addAll(costs); + return this; + } + + @java.lang.Override + public SubscriptionMonthlyCharge build() { + return new SubscriptionMonthlyCharge(monthlyCharge, costs, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/SubscriptionStatus.java b/src/main/java/com/vapi/api/types/SubscriptionStatus.java new file mode 100644 index 0000000..3c7c6cc --- /dev/null +++ b/src/main/java/com/vapi/api/types/SubscriptionStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SubscriptionStatus { + ACTIVE("active"), + + FROZEN("frozen"); + + private final String value; + + SubscriptionStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/SubscriptionType.java b/src/main/java/com/vapi/api/types/SubscriptionType.java new file mode 100644 index 0000000..009122a --- /dev/null +++ b/src/main/java/com/vapi/api/types/SubscriptionType.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SubscriptionType { + TRIAL("trial"), + + PAY_AS_YOU_GO("pay-as-you-go"), + + ENTERPRISE("enterprise"); + + private final String value; + + SubscriptionType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/SyncVoiceLibraryDtoProvidersItem.java b/src/main/java/com/vapi/api/types/SyncVoiceLibraryDtoProvidersItem.java index 9c73069..8e1c0ae 100644 --- a/src/main/java/com/vapi/api/types/SyncVoiceLibraryDtoProvidersItem.java +++ b/src/main/java/com/vapi/api/types/SyncVoiceLibraryDtoProvidersItem.java @@ -24,7 +24,9 @@ public enum SyncVoiceLibraryDtoProvidersItem { PLAYHT("playht"), - RIME_AI("rime-ai"); + RIME_AI("rime-ai"), + + TAVUS("tavus"); private final String value; diff --git a/src/main/java/com/vapi/api/types/TavusConversationProperties.java b/src/main/java/com/vapi/api/types/TavusConversationProperties.java new file mode 100644 index 0000000..de110da --- /dev/null +++ b/src/main/java/com/vapi/api/types/TavusConversationProperties.java @@ -0,0 +1,372 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TavusConversationProperties.Builder.class) +public final class TavusConversationProperties { + private final Optional maxCallDuration; + + private final Optional participantLeftTimeout; + + private final Optional participantAbsentTimeout; + + private final Optional enableRecording; + + private final Optional enableTranscription; + + private final Optional applyGreenscreen; + + private final Optional language; + + private final Optional recordingS3BucketName; + + private final Optional recordingS3BucketRegion; + + private final Optional awsAssumeRoleArn; + + private final Map additionalProperties; + + private TavusConversationProperties( + Optional maxCallDuration, + Optional participantLeftTimeout, + Optional participantAbsentTimeout, + Optional enableRecording, + Optional enableTranscription, + Optional applyGreenscreen, + Optional language, + Optional recordingS3BucketName, + Optional recordingS3BucketRegion, + Optional awsAssumeRoleArn, + Map additionalProperties) { + this.maxCallDuration = maxCallDuration; + this.participantLeftTimeout = participantLeftTimeout; + this.participantAbsentTimeout = participantAbsentTimeout; + this.enableRecording = enableRecording; + this.enableTranscription = enableTranscription; + this.applyGreenscreen = applyGreenscreen; + this.language = language; + this.recordingS3BucketName = recordingS3BucketName; + this.recordingS3BucketRegion = recordingS3BucketRegion; + this.awsAssumeRoleArn = awsAssumeRoleArn; + this.additionalProperties = additionalProperties; + } + + /** + * @return The maximum duration of the call in seconds. The default maxCallDuration is 3600 seconds (1 hour). + * Once the time limit specified by this parameter has been reached, the conversation will automatically shut down. + */ + @JsonProperty("maxCallDuration") + public Optional getMaxCallDuration() { + return maxCallDuration; + } + + /** + * @return The duration in seconds after which the call will be automatically shut down once the last participant leaves. + */ + @JsonProperty("participantLeftTimeout") + public Optional getParticipantLeftTimeout() { + return participantLeftTimeout; + } + + /** + * @return Starting from conversation creation, the duration in seconds after which the call will be automatically shut down if no participant joins the call. + * Default is 300 seconds (5 minutes). + */ + @JsonProperty("participantAbsentTimeout") + public Optional getParticipantAbsentTimeout() { + return participantAbsentTimeout; + } + + /** + * @return If true, the user will be able to record the conversation. + */ + @JsonProperty("enableRecording") + public Optional getEnableRecording() { + return enableRecording; + } + + /** + * @return If true, the user will be able to transcribe the conversation. + * You can find more instructions on displaying transcriptions if you are using your custom DailyJS components here. + * You need to have an event listener on Daily that listens for app-messages. + */ + @JsonProperty("enableTranscription") + public Optional getEnableTranscription() { + return enableTranscription; + } + + /** + * @return If true, the background will be replaced with a greenscreen (RGB values: [0, 255, 155]). + * You can use WebGL on the frontend to make the greenscreen transparent or change its color. + */ + @JsonProperty("applyGreenscreen") + public Optional getApplyGreenscreen() { + return applyGreenscreen; + } + + /** + * @return The language of the conversation. Please provide the full language name, not the two-letter code. + * If you are using your own TTS voice, please ensure it supports the language you provide. + * If you are using a stock replica or default persona, please note that only ElevenLabs and Cartesia supported languages are available. + * You can find a full list of supported languages for Cartesia here, for ElevenLabs here, and for PlayHT here. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The name of the S3 bucket where the recording will be stored. + */ + @JsonProperty("recordingS3BucketName") + public Optional getRecordingS3BucketName() { + return recordingS3BucketName; + } + + /** + * @return The region of the S3 bucket where the recording will be stored. + */ + @JsonProperty("recordingS3BucketRegion") + public Optional getRecordingS3BucketRegion() { + return recordingS3BucketRegion; + } + + /** + * @return The ARN of the role that will be assumed to access the S3 bucket. + */ + @JsonProperty("awsAssumeRoleArn") + public Optional getAwsAssumeRoleArn() { + return awsAssumeRoleArn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusConversationProperties && equalTo((TavusConversationProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TavusConversationProperties other) { + return maxCallDuration.equals(other.maxCallDuration) + && participantLeftTimeout.equals(other.participantLeftTimeout) + && participantAbsentTimeout.equals(other.participantAbsentTimeout) + && enableRecording.equals(other.enableRecording) + && enableTranscription.equals(other.enableTranscription) + && applyGreenscreen.equals(other.applyGreenscreen) + && language.equals(other.language) + && recordingS3BucketName.equals(other.recordingS3BucketName) + && recordingS3BucketRegion.equals(other.recordingS3BucketRegion) + && awsAssumeRoleArn.equals(other.awsAssumeRoleArn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.maxCallDuration, + this.participantLeftTimeout, + this.participantAbsentTimeout, + this.enableRecording, + this.enableTranscription, + this.applyGreenscreen, + this.language, + this.recordingS3BucketName, + this.recordingS3BucketRegion, + this.awsAssumeRoleArn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional maxCallDuration = Optional.empty(); + + private Optional participantLeftTimeout = Optional.empty(); + + private Optional participantAbsentTimeout = Optional.empty(); + + private Optional enableRecording = Optional.empty(); + + private Optional enableTranscription = Optional.empty(); + + private Optional applyGreenscreen = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional recordingS3BucketName = Optional.empty(); + + private Optional recordingS3BucketRegion = Optional.empty(); + + private Optional awsAssumeRoleArn = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TavusConversationProperties other) { + maxCallDuration(other.getMaxCallDuration()); + participantLeftTimeout(other.getParticipantLeftTimeout()); + participantAbsentTimeout(other.getParticipantAbsentTimeout()); + enableRecording(other.getEnableRecording()); + enableTranscription(other.getEnableTranscription()); + applyGreenscreen(other.getApplyGreenscreen()); + language(other.getLanguage()); + recordingS3BucketName(other.getRecordingS3BucketName()); + recordingS3BucketRegion(other.getRecordingS3BucketRegion()); + awsAssumeRoleArn(other.getAwsAssumeRoleArn()); + return this; + } + + @JsonSetter(value = "maxCallDuration", nulls = Nulls.SKIP) + public Builder maxCallDuration(Optional maxCallDuration) { + this.maxCallDuration = maxCallDuration; + return this; + } + + public Builder maxCallDuration(Double maxCallDuration) { + this.maxCallDuration = Optional.ofNullable(maxCallDuration); + return this; + } + + @JsonSetter(value = "participantLeftTimeout", nulls = Nulls.SKIP) + public Builder participantLeftTimeout(Optional participantLeftTimeout) { + this.participantLeftTimeout = participantLeftTimeout; + return this; + } + + public Builder participantLeftTimeout(Double participantLeftTimeout) { + this.participantLeftTimeout = Optional.ofNullable(participantLeftTimeout); + return this; + } + + @JsonSetter(value = "participantAbsentTimeout", nulls = Nulls.SKIP) + public Builder participantAbsentTimeout(Optional participantAbsentTimeout) { + this.participantAbsentTimeout = participantAbsentTimeout; + return this; + } + + public Builder participantAbsentTimeout(Double participantAbsentTimeout) { + this.participantAbsentTimeout = Optional.ofNullable(participantAbsentTimeout); + return this; + } + + @JsonSetter(value = "enableRecording", nulls = Nulls.SKIP) + public Builder enableRecording(Optional enableRecording) { + this.enableRecording = enableRecording; + return this; + } + + public Builder enableRecording(Boolean enableRecording) { + this.enableRecording = Optional.ofNullable(enableRecording); + return this; + } + + @JsonSetter(value = "enableTranscription", nulls = Nulls.SKIP) + public Builder enableTranscription(Optional enableTranscription) { + this.enableTranscription = enableTranscription; + return this; + } + + public Builder enableTranscription(Boolean enableTranscription) { + this.enableTranscription = Optional.ofNullable(enableTranscription); + return this; + } + + @JsonSetter(value = "applyGreenscreen", nulls = Nulls.SKIP) + public Builder applyGreenscreen(Optional applyGreenscreen) { + this.applyGreenscreen = applyGreenscreen; + return this; + } + + public Builder applyGreenscreen(Boolean applyGreenscreen) { + this.applyGreenscreen = Optional.ofNullable(applyGreenscreen); + return this; + } + + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public Builder language(Optional language) { + this.language = language; + return this; + } + + public Builder language(String language) { + this.language = Optional.ofNullable(language); + return this; + } + + @JsonSetter(value = "recordingS3BucketName", nulls = Nulls.SKIP) + public Builder recordingS3BucketName(Optional recordingS3BucketName) { + this.recordingS3BucketName = recordingS3BucketName; + return this; + } + + public Builder recordingS3BucketName(String recordingS3BucketName) { + this.recordingS3BucketName = Optional.ofNullable(recordingS3BucketName); + return this; + } + + @JsonSetter(value = "recordingS3BucketRegion", nulls = Nulls.SKIP) + public Builder recordingS3BucketRegion(Optional recordingS3BucketRegion) { + this.recordingS3BucketRegion = recordingS3BucketRegion; + return this; + } + + public Builder recordingS3BucketRegion(String recordingS3BucketRegion) { + this.recordingS3BucketRegion = Optional.ofNullable(recordingS3BucketRegion); + return this; + } + + @JsonSetter(value = "awsAssumeRoleArn", nulls = Nulls.SKIP) + public Builder awsAssumeRoleArn(Optional awsAssumeRoleArn) { + this.awsAssumeRoleArn = awsAssumeRoleArn; + return this; + } + + public Builder awsAssumeRoleArn(String awsAssumeRoleArn) { + this.awsAssumeRoleArn = Optional.ofNullable(awsAssumeRoleArn); + return this; + } + + public TavusConversationProperties build() { + return new TavusConversationProperties( + maxCallDuration, + participantLeftTimeout, + participantAbsentTimeout, + enableRecording, + enableTranscription, + applyGreenscreen, + language, + recordingS3BucketName, + recordingS3BucketRegion, + awsAssumeRoleArn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TavusCredential.java b/src/main/java/com/vapi/api/types/TavusCredential.java new file mode 100644 index 0000000..016af04 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TavusCredential.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TavusCredential.Builder.class) +public final class TavusCredential { + private final String apiKey; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private TavusCredential( + String apiKey, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.apiKey = apiKey; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "tavus"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusCredential && equalTo((TavusCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TavusCredential other) { + return apiKey.equals(other.apiKey) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + IdStage apiKey(@NotNull String apiKey); + + Builder from(TavusCredential other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + TavusCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ApiKeyStage, IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String apiKey; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TavusCredential other) { + apiKey(other.getApiKey()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the unique identifier for the credential.

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

        This is the unique identifier for the org that this credential belongs to.

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

        This is the ISO 8601 date-time string of when the credential was created.

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

        This is the ISO 8601 date-time string of when the assistant was last updated.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public TavusCredential build() { + return new TavusCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TavusVoice.java b/src/main/java/com/vapi/api/types/TavusVoice.java new file mode 100644 index 0000000..88cc4e0 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TavusVoice.java @@ -0,0 +1,428 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TavusVoice.Builder.class) +public final class TavusVoice { + private final TavusVoiceVoiceId voiceId; + + private final Optional chunkPlan; + + private final Optional personaId; + + private final Optional callbackUrl; + + private final Optional conversationName; + + private final Optional conversationalContext; + + private final Optional customGreeting; + + private final Optional properties; + + private final Optional fallbackPlan; + + private final Map additionalProperties; + + private TavusVoice( + TavusVoiceVoiceId voiceId, + Optional chunkPlan, + Optional personaId, + Optional callbackUrl, + Optional conversationName, + Optional conversationalContext, + Optional customGreeting, + Optional properties, + Optional fallbackPlan, + Map additionalProperties) { + this.voiceId = voiceId; + this.chunkPlan = chunkPlan; + this.personaId = personaId; + this.callbackUrl = callbackUrl; + this.conversationName = conversationName; + this.conversationalContext = conversationalContext; + this.customGreeting = customGreeting; + this.properties = properties; + this.fallbackPlan = fallbackPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider-specific ID that will be used. + */ + @JsonProperty("voiceId") + public TavusVoiceVoiceId getVoiceId() { + return voiceId; + } + + /** + * @return This is the plan for chunking the model output before it is sent to the voice provider. + */ + @JsonProperty("chunkPlan") + public Optional getChunkPlan() { + return chunkPlan; + } + + /** + * @return This is the unique identifier for the persona that the replica will use in the conversation. + */ + @JsonProperty("personaId") + public Optional getPersonaId() { + return personaId; + } + + /** + * @return This is the url that will receive webhooks with updates regarding the conversation state. + */ + @JsonProperty("callbackUrl") + public Optional getCallbackUrl() { + return callbackUrl; + } + + /** + * @return This is the name for the conversation. + */ + @JsonProperty("conversationName") + public Optional getConversationName() { + return conversationName; + } + + /** + * @return This is the context that will be appended to any context provided in the persona, if one is provided. + */ + @JsonProperty("conversationalContext") + public Optional getConversationalContext() { + return conversationalContext; + } + + /** + * @return This is the custom greeting that the replica will give once a participant joines the conversation. + */ + @JsonProperty("customGreeting") + public Optional getCustomGreeting() { + return customGreeting; + } + + /** + * @return These are optional properties used to customize the conversation. + */ + @JsonProperty("properties") + public Optional getProperties() { + return properties; + } + + /** + * @return This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + */ + @JsonProperty("fallbackPlan") + public Optional getFallbackPlan() { + return fallbackPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusVoice && equalTo((TavusVoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TavusVoice other) { + return voiceId.equals(other.voiceId) + && chunkPlan.equals(other.chunkPlan) + && personaId.equals(other.personaId) + && callbackUrl.equals(other.callbackUrl) + && conversationName.equals(other.conversationName) + && conversationalContext.equals(other.conversationalContext) + && customGreeting.equals(other.customGreeting) + && properties.equals(other.properties) + && fallbackPlan.equals(other.fallbackPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.voiceId, + this.chunkPlan, + this.personaId, + this.callbackUrl, + this.conversationName, + this.conversationalContext, + this.customGreeting, + this.properties, + this.fallbackPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VoiceIdStage builder() { + return new Builder(); + } + + public interface VoiceIdStage { + _FinalStage voiceId(@NotNull TavusVoiceVoiceId voiceId); + + Builder from(TavusVoice other); + } + + public interface _FinalStage { + TavusVoice build(); + + _FinalStage chunkPlan(Optional chunkPlan); + + _FinalStage chunkPlan(ChunkPlan chunkPlan); + + _FinalStage personaId(Optional personaId); + + _FinalStage personaId(String personaId); + + _FinalStage callbackUrl(Optional callbackUrl); + + _FinalStage callbackUrl(String callbackUrl); + + _FinalStage conversationName(Optional conversationName); + + _FinalStage conversationName(String conversationName); + + _FinalStage conversationalContext(Optional conversationalContext); + + _FinalStage conversationalContext(String conversationalContext); + + _FinalStage customGreeting(Optional customGreeting); + + _FinalStage customGreeting(String customGreeting); + + _FinalStage properties(Optional properties); + + _FinalStage properties(TavusConversationProperties properties); + + _FinalStage fallbackPlan(Optional fallbackPlan); + + _FinalStage fallbackPlan(FallbackPlan fallbackPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VoiceIdStage, _FinalStage { + private TavusVoiceVoiceId voiceId; + + private Optional fallbackPlan = Optional.empty(); + + private Optional properties = Optional.empty(); + + private Optional customGreeting = Optional.empty(); + + private Optional conversationalContext = Optional.empty(); + + private Optional conversationName = Optional.empty(); + + private Optional callbackUrl = Optional.empty(); + + private Optional personaId = Optional.empty(); + + private Optional chunkPlan = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TavusVoice other) { + voiceId(other.getVoiceId()); + chunkPlan(other.getChunkPlan()); + personaId(other.getPersonaId()); + callbackUrl(other.getCallbackUrl()); + conversationName(other.getConversationName()); + conversationalContext(other.getConversationalContext()); + customGreeting(other.getCustomGreeting()); + properties(other.getProperties()); + fallbackPlan(other.getFallbackPlan()); + return this; + } + + /** + *

        This is the provider-specific ID that will be used.

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

        This is the plan for voice provider fallbacks in the event that the primary voice provider fails.

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

        These are optional properties used to customize the conversation.

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

        This is the custom greeting that the replica will give once a participant joines the conversation.

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

        This is the context that will be appended to any context provided in the persona, if one is provided.

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

        This is the name for the conversation.

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

        This is the url that will receive webhooks with updates regarding the conversation state.

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

        This is the unique identifier for the persona that the replica will use in the conversation.

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

        This is the plan for chunking the model output before it is sent to the voice provider.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage chunkPlan(ChunkPlan chunkPlan) { + this.chunkPlan = Optional.ofNullable(chunkPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "chunkPlan", nulls = Nulls.SKIP) + public _FinalStage chunkPlan(Optional chunkPlan) { + this.chunkPlan = chunkPlan; + return this; + } + + @java.lang.Override + public TavusVoice build() { + return new TavusVoice( + voiceId, + chunkPlan, + personaId, + callbackUrl, + conversationName, + conversationalContext, + customGreeting, + properties, + fallbackPlan, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TavusVoiceVoiceId.java b/src/main/java/com/vapi/api/types/TavusVoiceVoiceId.java new file mode 100644 index 0000000..00fd726 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TavusVoiceVoiceId.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TavusVoiceVoiceId.Deserializer.class) +public final class TavusVoiceVoiceId { + private final Object value; + + private final int type; + + private TavusVoiceVoiceId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TavusVoiceVoiceId && equalTo((TavusVoiceVoiceId) other); + } + + private boolean equalTo(TavusVoiceVoiceId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TavusVoiceVoiceId of(String value) { + return new TavusVoiceVoiceId(value, 0); + } + + public static TavusVoiceVoiceId of(String value) { + return new TavusVoiceVoiceId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TavusVoiceVoiceId.class); + } + + @java.lang.Override + public TavusVoiceVoiceId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference() {})); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TextContent.java b/src/main/java/com/vapi/api/types/TextContent.java new file mode 100644 index 0000000..64c1f6f --- /dev/null +++ b/src/main/java/com/vapi/api/types/TextContent.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TextContent.Builder.class) +public final class TextContent { + private final String text; + + private final TextContentLanguage language; + + private final Map additionalProperties; + + private TextContent(String text, TextContentLanguage language, Map additionalProperties) { + this.text = text; + this.language = language; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return "text"; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @JsonProperty("language") + public TextContentLanguage getLanguage() { + return language; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextContent && equalTo((TextContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TextContent other) { + return text.equals(other.text) && language.equals(other.language); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text, this.language); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TextStage builder() { + return new Builder(); + } + + public interface TextStage { + LanguageStage text(@NotNull String text); + + Builder from(TextContent other); + } + + public interface LanguageStage { + _FinalStage language(@NotNull TextContentLanguage language); + } + + public interface _FinalStage { + TextContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TextStage, LanguageStage, _FinalStage { + private String text; + + private TextContentLanguage language; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TextContent other) { + text(other.getText()); + language(other.getLanguage()); + return this; + } + + @java.lang.Override + @JsonSetter("text") + public LanguageStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("language") + public _FinalStage language(@NotNull TextContentLanguage language) { + this.language = Objects.requireNonNull(language, "language must not be null"); + return this; + } + + @java.lang.Override + public TextContent build() { + return new TextContent(text, language, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TextContentLanguage.java b/src/main/java/com/vapi/api/types/TextContentLanguage.java new file mode 100644 index 0000000..dd9cebb --- /dev/null +++ b/src/main/java/com/vapi/api/types/TextContentLanguage.java @@ -0,0 +1,390 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TextContentLanguage { + AA("aa"), + + AB("ab"), + + AE("ae"), + + AF("af"), + + AK("ak"), + + AM("am"), + + AN("an"), + + AR("ar"), + + AS("as"), + + AV("av"), + + AY("ay"), + + AZ("az"), + + BA("ba"), + + BE("be"), + + BG("bg"), + + BH("bh"), + + BI("bi"), + + BM("bm"), + + BN("bn"), + + BO("bo"), + + BR("br"), + + BS("bs"), + + CA("ca"), + + CE("ce"), + + CH("ch"), + + CO("co"), + + CR("cr"), + + CS("cs"), + + CU("cu"), + + CV("cv"), + + CY("cy"), + + DA("da"), + + DE("de"), + + DV("dv"), + + DZ("dz"), + + EE("ee"), + + EL("el"), + + EN("en"), + + EO("eo"), + + ES("es"), + + ET("et"), + + EU("eu"), + + FA("fa"), + + FF("ff"), + + FI("fi"), + + FJ("fj"), + + FO("fo"), + + FR("fr"), + + FY("fy"), + + GA("ga"), + + GD("gd"), + + GL("gl"), + + GN("gn"), + + GU("gu"), + + GV("gv"), + + HA("ha"), + + HE("he"), + + HI("hi"), + + HO("ho"), + + HR("hr"), + + HT("ht"), + + HU("hu"), + + HY("hy"), + + HZ("hz"), + + IA("ia"), + + ID("id"), + + IE("ie"), + + IG("ig"), + + II("ii"), + + IK("ik"), + + IO("io"), + + IS("is"), + + IT("it"), + + IU("iu"), + + JA("ja"), + + JV("jv"), + + KA("ka"), + + KG("kg"), + + KI("ki"), + + KJ("kj"), + + KK("kk"), + + KL("kl"), + + KM("km"), + + KN("kn"), + + KO("ko"), + + KR("kr"), + + KS("ks"), + + KU("ku"), + + KV("kv"), + + KW("kw"), + + KY("ky"), + + LA("la"), + + LB("lb"), + + LG("lg"), + + LI("li"), + + LN("ln"), + + LO("lo"), + + LT("lt"), + + LU("lu"), + + LV("lv"), + + MG("mg"), + + MH("mh"), + + MI("mi"), + + MK("mk"), + + ML("ml"), + + MN("mn"), + + MR("mr"), + + MS("ms"), + + MT("mt"), + + MY("my"), + + NA("na"), + + NB("nb"), + + ND("nd"), + + NE("ne"), + + NG("ng"), + + NL("nl"), + + NN("nn"), + + NO("no"), + + NR("nr"), + + NV("nv"), + + NY("ny"), + + OC("oc"), + + OJ("oj"), + + OM("om"), + + OR("or"), + + OS("os"), + + PA("pa"), + + PI("pi"), + + PL("pl"), + + PS("ps"), + + PT("pt"), + + QU("qu"), + + RM("rm"), + + RN("rn"), + + RO("ro"), + + RU("ru"), + + RW("rw"), + + SA("sa"), + + SC("sc"), + + SD("sd"), + + SE("se"), + + SG("sg"), + + SI("si"), + + SK("sk"), + + SL("sl"), + + SM("sm"), + + SN("sn"), + + SO("so"), + + SQ("sq"), + + SR("sr"), + + SS("ss"), + + ST("st"), + + SU("su"), + + SV("sv"), + + SW("sw"), + + TA("ta"), + + TE("te"), + + TG("tg"), + + TH("th"), + + TI("ti"), + + TK("tk"), + + TL("tl"), + + TN("tn"), + + TO("to"), + + TR("tr"), + + TS("ts"), + + TT("tt"), + + TW("tw"), + + TY("ty"), + + UG("ug"), + + UK("uk"), + + UR("ur"), + + UZ("uz"), + + VE("ve"), + + VI("vi"), + + VO("vo"), + + WA("wa"), + + WO("wo"), + + XH("xh"), + + YI("yi"), + + YUE("yue"), + + YO("yo"), + + ZA("za"), + + ZH("zh"), + + ZU("zu"); + + private final String value; + + TextContentLanguage(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/TextEditorTool.java b/src/main/java/com/vapi/api/types/TextEditorTool.java new file mode 100644 index 0000000..8ebc07f --- /dev/null +++ b/src/main/java/com/vapi/api/types/TextEditorTool.java @@ -0,0 +1,397 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +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 = TextEditorTool.Builder.class) +public final class TextEditorTool { + private final Optional async; + + private final Optional> messages; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional function; + + private final Optional server; + + private final Map additionalProperties; + + private TextEditorTool( + Optional async, + Optional> messages, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional function, + Optional server, + Map additionalProperties) { + this.async = async; + this.messages = messages; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.function = function; + this.server = server; + this.additionalProperties = additionalProperties; + } + + /** + * @return This determines if the tool is async. + *

        If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

        + *

        If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

        + *

        Defaults to synchronous (false).

        + */ + @JsonProperty("async") + public Optional getAsync() { + return async; + } + + /** + * @return These are the messages that will be spoken to the user as the tool is running. + *

        For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

        + */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return The sub type of tool. + */ + @JsonProperty("subType") + public String getSubType() { + return "text_editor_20241022"; + } + + /** + * @return This is the unique identifier for the tool. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the organization that this tool belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the tool was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the tool was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the function definition of the tool. + *

        For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

        + *

        An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

        + */ + @JsonProperty("function") + public Optional getFunction() { + return function; + } + + /** + * @return This is the server that will be hit when this tool is requested by the model. + *

        All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

        + *

        This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

        + */ + @JsonProperty("server") + public Optional getServer() { + return server; + } + + /** + * @return The name of the tool, fixed to 'str_replace_editor' + */ + @JsonProperty("name") + public String getName() { + return "str_replace_editor"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TextEditorTool && equalTo((TextEditorTool) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TextEditorTool other) { + return async.equals(other.async) + && messages.equals(other.messages) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && function.equals(other.function) + && server.equals(other.server); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.async, + this.messages, + this.id, + this.orgId, + this.createdAt, + this.updatedAt, + this.function, + this.server); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + + Builder from(TextEditorTool other); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + TextEditorTool build(); + + _FinalStage async(Optional async); + + _FinalStage async(Boolean async); + + _FinalStage messages(Optional> messages); + + _FinalStage messages(List messages); + + _FinalStage function(Optional function); + + _FinalStage function(OpenAiFunction function); + + _FinalStage server(Optional server); + + _FinalStage server(Server server); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional server = Optional.empty(); + + private Optional function = Optional.empty(); + + private Optional> messages = Optional.empty(); + + private Optional async = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TextEditorTool other) { + async(other.getAsync()); + messages(other.getMessages()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + function(other.getFunction()); + server(other.getServer()); + return this; + } + + /** + *

        This is the unique identifier for the tool.

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

        This is the unique identifier for the organization that this tool belongs to.

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

        This is the ISO 8601 date-time string of when the tool was created.

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

        This is the ISO 8601 date-time string of when the tool was last updated.

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

        This is the server that will be hit when this tool is requested by the model.

        + *

        All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.

        + *

        This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.

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

        This is the function definition of the tool.

        + *

        For endCall, transferCall, and dtmf tools, this is auto-filled based on tool-specific fields like tool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.

        + *

        An example of an advanced use case is if you want to customize the message that's spoken for endCall tool. You can specify a function where it returns an argument "reason". Then, in messages array, you can have many "request-complete" messages. One of these messages will be triggered if the messages[].conditions matches the "reason" argument.

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

        These are the messages that will be spoken to the user as the tool is running.

        + *

        For some tools, this is auto-filled based on special fields like tool.destinations. For others like the function tool, these can be custom configured.

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

        This determines if the tool is async.

        + *

        If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

        + *

        If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

        + *

        Defaults to synchronous (false).

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage async(Boolean async) { + this.async = Optional.ofNullable(async); + return this; + } + + @java.lang.Override + @JsonSetter(value = "async", nulls = Nulls.SKIP) + public _FinalStage async(Optional async) { + this.async = async; + return this; + } + + @java.lang.Override + public TextEditorTool build() { + return new TextEditorTool( + async, messages, id, orgId, createdAt, updatedAt, function, server, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TextEditorToolMessagesItem.java b/src/main/java/com/vapi/api/types/TextEditorToolMessagesItem.java new file mode 100644 index 0000000..6edefe1 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TextEditorToolMessagesItem.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class TextEditorToolMessagesItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private TextEditorToolMessagesItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static TextEditorToolMessagesItem requestStart(ToolMessageStart value) { + return new TextEditorToolMessagesItem(new RequestStartValue(value)); + } + + public static TextEditorToolMessagesItem requestComplete(ToolMessageComplete value) { + return new TextEditorToolMessagesItem(new RequestCompleteValue(value)); + } + + public static TextEditorToolMessagesItem requestFailed(ToolMessageFailed value) { + return new TextEditorToolMessagesItem(new RequestFailedValue(value)); + } + + public static TextEditorToolMessagesItem requestResponseDelayed(ToolMessageDelayed value) { + return new TextEditorToolMessagesItem(new RequestResponseDelayedValue(value)); + } + + public boolean isRequestStart() { + return value instanceof RequestStartValue; + } + + public boolean isRequestComplete() { + return value instanceof RequestCompleteValue; + } + + public boolean isRequestFailed() { + return value instanceof RequestFailedValue; + } + + public boolean isRequestResponseDelayed() { + return value instanceof RequestResponseDelayedValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getRequestStart() { + if (isRequestStart()) { + return Optional.of(((RequestStartValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestComplete() { + if (isRequestComplete()) { + return Optional.of(((RequestCompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestFailed() { + if (isRequestFailed()) { + return Optional.of(((RequestFailedValue) value).value); + } + return Optional.empty(); + } + + public Optional getRequestResponseDelayed() { + if (isRequestResponseDelayed()) { + return Optional.of(((RequestResponseDelayedValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitRequestStart(ToolMessageStart requestStart); + + T visitRequestComplete(ToolMessageComplete requestComplete); + + T visitRequestFailed(ToolMessageFailed requestFailed); + + T visitRequestResponseDelayed(ToolMessageDelayed requestResponseDelayed); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(RequestStartValue.class), + @JsonSubTypes.Type(RequestCompleteValue.class), + @JsonSubTypes.Type(RequestFailedValue.class), + @JsonSubTypes.Type(RequestResponseDelayedValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("request-start") + private static final class RequestStartValue implements Value { + @JsonUnwrapped + private ToolMessageStart value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestStartValue() {} + + private RequestStartValue(ToolMessageStart value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestStart(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestStartValue && equalTo((RequestStartValue) other); + } + + private boolean equalTo(RequestStartValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "TextEditorToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-complete") + private static final class RequestCompleteValue implements Value { + @JsonUnwrapped + private ToolMessageComplete value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestCompleteValue() {} + + private RequestCompleteValue(ToolMessageComplete value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestCompleteValue && equalTo((RequestCompleteValue) other); + } + + private boolean equalTo(RequestCompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "TextEditorToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-failed") + private static final class RequestFailedValue implements Value { + @JsonUnwrapped + private ToolMessageFailed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestFailedValue() {} + + private RequestFailedValue(ToolMessageFailed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestFailed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestFailedValue && equalTo((RequestFailedValue) other); + } + + private boolean equalTo(RequestFailedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "TextEditorToolMessagesItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("request-response-delayed") + private static final class RequestResponseDelayedValue implements Value { + @JsonUnwrapped + private ToolMessageDelayed value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RequestResponseDelayedValue() {} + + private RequestResponseDelayedValue(ToolMessageDelayed value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRequestResponseDelayed(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RequestResponseDelayedValue && equalTo((RequestResponseDelayedValue) other); + } + + private boolean equalTo(RequestResponseDelayedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "TextEditorToolMessagesItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "TextEditorToolMessagesItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/vapi/api/types/TogetherAiCredential.java b/src/main/java/com/vapi/api/types/TogetherAiCredential.java index 8d9ab5b..8af9f89 100644 --- a/src/main/java/com/vapi/api/types/TogetherAiCredential.java +++ b/src/main/java/com/vapi/api/types/TogetherAiCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class TogetherAiCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final Map additionalProperties; private TogetherAiCredential( @@ -38,12 +42,14 @@ private TogetherAiCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, Map additionalProperties) { this.apiKey = apiKey; this.id = id; this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.additionalProperties = additionalProperties; } @@ -92,6 +98,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -108,12 +122,13 @@ private boolean equalTo(TogetherAiCredential other) { && id.equals(other.id) && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt); + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); } @java.lang.Override @@ -149,6 +164,10 @@ public interface UpdatedAtStage { public interface _FinalStage { TogetherAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -164,6 +183,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -176,6 +197,7 @@ public Builder from(TogetherAiCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); return this; } @@ -234,9 +256,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public TogetherAiCredential build() { - return new TogetherAiCredential(apiKey, id, orgId, createdAt, updatedAt, additionalProperties); + return new TogetherAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TogetherAiModel.java b/src/main/java/com/vapi/api/types/TogetherAiModel.java index c663ccf..388b83b 100644 --- a/src/main/java/com/vapi/api/types/TogetherAiModel.java +++ b/src/main/java/com/vapi/api/types/TogetherAiModel.java @@ -28,12 +28,14 @@ public final class TogetherAiModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final String model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -46,9 +48,10 @@ private TogetherAiModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -56,9 +59,10 @@ private TogetherAiModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -91,6 +95,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + /** * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b */ @@ -107,14 +127,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -158,9 +170,10 @@ private boolean equalTo(TogetherAiModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -172,9 +185,10 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -210,13 +224,17 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); - _FinalStage temperature(Optional temperature); + _FinalStage knowledgeBase(Optional knowledgeBase); - _FinalStage temperature(Double temperature); + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); - _FinalStage knowledgeBase(Optional knowledgeBase); + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); + _FinalStage knowledgeBaseId(String knowledgeBaseId); + + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); _FinalStage maxTokens(Optional maxTokens); @@ -241,10 +259,12 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -261,9 +281,10 @@ public Builder from(TogetherAiModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -337,36 +358,53 @@ public _FinalStage maxTokens(Optional maxTokens) { } /** - *

        These are the options for the knowledge base.

        + *

        This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

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

        This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

        + *

        This is the ID of the knowledge base the model will use.

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

        These are the options for the knowledge base.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @java.lang.Override + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public _FinalStage knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; return this; } @@ -429,9 +467,10 @@ public TogetherAiModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/ToolMessageComplete.java b/src/main/java/com/vapi/api/types/ToolMessageComplete.java index 005d010..1bd825b 100644 --- a/src/main/java/com/vapi/api/types/ToolMessageComplete.java +++ b/src/main/java/com/vapi/api/types/ToolMessageComplete.java @@ -17,27 +17,30 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ToolMessageComplete.Builder.class) public final class ToolMessageComplete { + private final Optional> contents; + private final Optional role; private final Optional endCallAfterSpokenEnabled; - private final String content; + private final Optional content; private final Optional> conditions; private final Map additionalProperties; private ToolMessageComplete( + Optional> contents, Optional role, Optional endCallAfterSpokenEnabled, - String content, + Optional content, Optional> conditions, Map additionalProperties) { + this.contents = contents; this.role = role; this.endCallAfterSpokenEnabled = endCallAfterSpokenEnabled; this.content = content; @@ -45,6 +48,20 @@ private ToolMessageComplete( this.additionalProperties = additionalProperties; } + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

        Usage:

        + *
          + *
        • If your assistants are multilingual, you can provide content for each language.
        • + *
        • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
        • + *
        + *

        This will override the content property.

        + */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + /** * @return This is optional and defaults to "assistant". *

        When role=assistant, content is said out loud.

        @@ -81,7 +98,7 @@ public Optional getEndCallAfterSpokenEnabled() { * @return This is the content that the assistant says when this message is triggered. */ @JsonProperty("content") - public String getContent() { + public Optional getContent() { return content; } @@ -105,7 +122,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(ToolMessageComplete other) { - return role.equals(other.role) + return contents.equals(other.contents) + && role.equals(other.role) && endCallAfterSpokenEnabled.equals(other.endCallAfterSpokenEnabled) && content.equals(other.content) && conditions.equals(other.conditions); @@ -113,7 +131,7 @@ private boolean equalTo(ToolMessageComplete other) { @java.lang.Override public int hashCode() { - return Objects.hash(this.role, this.endCallAfterSpokenEnabled, this.content, this.conditions); + return Objects.hash(this.contents, this.role, this.endCallAfterSpokenEnabled, this.content, this.conditions); } @java.lang.Override @@ -121,49 +139,29 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ContentStage builder() { + public static Builder builder() { return new Builder(); } - public interface ContentStage { - _FinalStage content(@NotNull String content); - - Builder from(ToolMessageComplete other); - } - - public interface _FinalStage { - ToolMessageComplete build(); - - _FinalStage role(Optional role); - - _FinalStage role(ToolMessageCompleteRole role); - - _FinalStage endCallAfterSpokenEnabled(Optional endCallAfterSpokenEnabled); - - _FinalStage endCallAfterSpokenEnabled(Boolean endCallAfterSpokenEnabled); - - _FinalStage conditions(Optional> conditions); - - _FinalStage conditions(List conditions); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ContentStage, _FinalStage { - private String content; + public static final class Builder { + private Optional> contents = Optional.empty(); - private Optional> conditions = Optional.empty(); + private Optional role = Optional.empty(); private Optional endCallAfterSpokenEnabled = Optional.empty(); - private Optional role = Optional.empty(); + private Optional content = Optional.empty(); + + private Optional> conditions = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ToolMessageComplete other) { + contents(other.getContents()); role(other.getRole()); endCallAfterSpokenEnabled(other.getEndCallAfterSpokenEnabled()); content(other.getContent()); @@ -171,87 +169,64 @@ public Builder from(ToolMessageComplete other) { return this; } - /** - *

        This is the content that the assistant says when this message is triggered.

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

        This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.

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

        This is an optional boolean that if true, the call will end after the message is spoken. Default is false.

        - *

        This is ignored if role is set to system.

        - *

        @default false

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

        This is optional and defaults to "assistant".

        - *

        When role=assistant, content is said out loud.

        - *

        When role=system, content is passed to the model in a system message. Example: - * system: default one - * assistant: - * user: - * assistant: - * user: - * assistant: - * user: - * assistant: tool called - * tool: your server response - * <--- system prompt as hint - * ---> model generates response which is spoken - * This is useful when you want to provide a hint to the model about what to say next.

        - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage role(ToolMessageCompleteRole role) { - this.role = Optional.ofNullable(role); + public Builder endCallAfterSpokenEnabled(Boolean endCallAfterSpokenEnabled) { + this.endCallAfterSpokenEnabled = Optional.ofNullable(endCallAfterSpokenEnabled); return this; } - @java.lang.Override - @JsonSetter(value = "role", nulls = Nulls.SKIP) - public _FinalStage role(Optional role) { - this.role = role; + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "conditions", nulls = Nulls.SKIP) + public Builder conditions(Optional> conditions) { + this.conditions = conditions; + return this; + } + + public Builder conditions(List conditions) { + this.conditions = Optional.ofNullable(conditions); return this; } - @java.lang.Override public ToolMessageComplete build() { - return new ToolMessageComplete(role, endCallAfterSpokenEnabled, content, conditions, additionalProperties); + return new ToolMessageComplete( + contents, role, endCallAfterSpokenEnabled, content, conditions, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ToolMessageDelayed.java b/src/main/java/com/vapi/api/types/ToolMessageDelayed.java index 0b5ce5f..99456fd 100644 --- a/src/main/java/com/vapi/api/types/ToolMessageDelayed.java +++ b/src/main/java/com/vapi/api/types/ToolMessageDelayed.java @@ -17,30 +17,47 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ToolMessageDelayed.Builder.class) public final class ToolMessageDelayed { + private final Optional> contents; + private final Optional timingMilliseconds; - private final String content; + private final Optional content; private final Optional> conditions; private final Map additionalProperties; private ToolMessageDelayed( + Optional> contents, Optional timingMilliseconds, - String content, + Optional content, Optional> conditions, Map additionalProperties) { + this.contents = contents; this.timingMilliseconds = timingMilliseconds; this.content = content; this.conditions = conditions; this.additionalProperties = additionalProperties; } + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

        Usage:

        + *
          + *
        • If your assistants are multilingual, you can provide content for each language.
        • + *
        • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
        • + *
        + *

        This will override the content property.

        + */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + /** * @return The number of milliseconds to wait for the server response before saying this message. */ @@ -53,7 +70,7 @@ public Optional getTimingMilliseconds() { * @return This is the content that the assistant says when this message is triggered. */ @JsonProperty("content") - public String getContent() { + public Optional getContent() { return content; } @@ -77,14 +94,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(ToolMessageDelayed other) { - return timingMilliseconds.equals(other.timingMilliseconds) + return contents.equals(other.contents) + && timingMilliseconds.equals(other.timingMilliseconds) && content.equals(other.content) && conditions.equals(other.conditions); } @java.lang.Override public int hashCode() { - return Objects.hash(this.timingMilliseconds, this.content, this.conditions); + return Objects.hash(this.contents, this.timingMilliseconds, this.content, this.conditions); } @java.lang.Override @@ -92,97 +110,79 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ContentStage builder() { + public static Builder builder() { return new Builder(); } - public interface ContentStage { - _FinalStage content(@NotNull String content); - - Builder from(ToolMessageDelayed other); - } - - public interface _FinalStage { - ToolMessageDelayed build(); - - _FinalStage timingMilliseconds(Optional timingMilliseconds); + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> contents = Optional.empty(); - _FinalStage timingMilliseconds(Double timingMilliseconds); + private Optional timingMilliseconds = Optional.empty(); - _FinalStage conditions(Optional> conditions); - - _FinalStage conditions(List conditions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ContentStage, _FinalStage { - private String content; + private Optional content = Optional.empty(); private Optional> conditions = Optional.empty(); - private Optional timingMilliseconds = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ToolMessageDelayed other) { + contents(other.getContents()); timingMilliseconds(other.getTimingMilliseconds()); content(other.getContent()); conditions(other.getConditions()); return this; } - /** - *

        This is the content that the assistant says when this message is triggered.

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

        This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.

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

        The number of milliseconds to wait for the server response before saying this message.

        - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage timingMilliseconds(Double timingMilliseconds) { + public Builder timingMilliseconds(Double timingMilliseconds) { this.timingMilliseconds = Optional.ofNullable(timingMilliseconds); return this; } - @java.lang.Override - @JsonSetter(value = "timingMilliseconds", nulls = Nulls.SKIP) - public _FinalStage timingMilliseconds(Optional timingMilliseconds) { - this.timingMilliseconds = timingMilliseconds; + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "conditions", nulls = Nulls.SKIP) + public Builder conditions(Optional> conditions) { + this.conditions = conditions; + return this; + } + + public Builder conditions(List conditions) { + this.conditions = Optional.ofNullable(conditions); return this; } - @java.lang.Override public ToolMessageDelayed build() { - return new ToolMessageDelayed(timingMilliseconds, content, conditions, additionalProperties); + return new ToolMessageDelayed(contents, timingMilliseconds, content, conditions, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ToolMessageFailed.java b/src/main/java/com/vapi/api/types/ToolMessageFailed.java index 6dc7af2..82aed94 100644 --- a/src/main/java/com/vapi/api/types/ToolMessageFailed.java +++ b/src/main/java/com/vapi/api/types/ToolMessageFailed.java @@ -17,30 +17,47 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ToolMessageFailed.Builder.class) public final class ToolMessageFailed { + private final Optional> contents; + private final Optional endCallAfterSpokenEnabled; - private final String content; + private final Optional content; private final Optional> conditions; private final Map additionalProperties; private ToolMessageFailed( + Optional> contents, Optional endCallAfterSpokenEnabled, - String content, + Optional content, Optional> conditions, Map additionalProperties) { + this.contents = contents; this.endCallAfterSpokenEnabled = endCallAfterSpokenEnabled; this.content = content; this.conditions = conditions; this.additionalProperties = additionalProperties; } + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

        Usage:

        + *
          + *
        • If your assistants are multilingual, you can provide content for each language.
        • + *
        • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
        • + *
        + *

        This will override the content property.

        + */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + /** * @return This is an optional boolean that if true, the call will end after the message is spoken. Default is false. *

        @default false

        @@ -54,7 +71,7 @@ public Optional getEndCallAfterSpokenEnabled() { * @return This is the content that the assistant says when this message is triggered. */ @JsonProperty("content") - public String getContent() { + public Optional getContent() { return content; } @@ -78,14 +95,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(ToolMessageFailed other) { - return endCallAfterSpokenEnabled.equals(other.endCallAfterSpokenEnabled) + return contents.equals(other.contents) + && endCallAfterSpokenEnabled.equals(other.endCallAfterSpokenEnabled) && content.equals(other.content) && conditions.equals(other.conditions); } @java.lang.Override public int hashCode() { - return Objects.hash(this.endCallAfterSpokenEnabled, this.content, this.conditions); + return Objects.hash(this.contents, this.endCallAfterSpokenEnabled, this.content, this.conditions); } @java.lang.Override @@ -93,98 +111,80 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ContentStage builder() { + public static Builder builder() { return new Builder(); } - public interface ContentStage { - _FinalStage content(@NotNull String content); - - Builder from(ToolMessageFailed other); - } - - public interface _FinalStage { - ToolMessageFailed build(); - - _FinalStage endCallAfterSpokenEnabled(Optional endCallAfterSpokenEnabled); + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> contents = Optional.empty(); - _FinalStage endCallAfterSpokenEnabled(Boolean endCallAfterSpokenEnabled); + private Optional endCallAfterSpokenEnabled = Optional.empty(); - _FinalStage conditions(Optional> conditions); - - _FinalStage conditions(List conditions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ContentStage, _FinalStage { - private String content; + private Optional content = Optional.empty(); private Optional> conditions = Optional.empty(); - private Optional endCallAfterSpokenEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ToolMessageFailed other) { + contents(other.getContents()); endCallAfterSpokenEnabled(other.getEndCallAfterSpokenEnabled()); content(other.getContent()); conditions(other.getConditions()); return this; } - /** - *

        This is the content that the assistant says when this message is triggered.

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

        This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.

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

        This is an optional boolean that if true, the call will end after the message is spoken. Default is false.

        - *

        @default false

        - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage endCallAfterSpokenEnabled(Boolean endCallAfterSpokenEnabled) { + public Builder endCallAfterSpokenEnabled(Boolean endCallAfterSpokenEnabled) { this.endCallAfterSpokenEnabled = Optional.ofNullable(endCallAfterSpokenEnabled); return this; } - @java.lang.Override - @JsonSetter(value = "endCallAfterSpokenEnabled", nulls = Nulls.SKIP) - public _FinalStage endCallAfterSpokenEnabled(Optional endCallAfterSpokenEnabled) { - this.endCallAfterSpokenEnabled = endCallAfterSpokenEnabled; + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "conditions", nulls = Nulls.SKIP) + public Builder conditions(Optional> conditions) { + this.conditions = conditions; + return this; + } + + public Builder conditions(List conditions) { + this.conditions = Optional.ofNullable(conditions); return this; } - @java.lang.Override public ToolMessageFailed build() { - return new ToolMessageFailed(endCallAfterSpokenEnabled, content, conditions, additionalProperties); + return new ToolMessageFailed( + contents, endCallAfterSpokenEnabled, content, conditions, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/ToolMessageStart.java b/src/main/java/com/vapi/api/types/ToolMessageStart.java index 64e82b7..af13262 100644 --- a/src/main/java/com/vapi/api/types/ToolMessageStart.java +++ b/src/main/java/com/vapi/api/types/ToolMessageStart.java @@ -17,29 +17,48 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ToolMessageStart.Builder.class) public final class ToolMessageStart { - private final String content; + private final Optional> contents; + + private final Optional content; private final Optional> conditions; private final Map additionalProperties; private ToolMessageStart( - String content, Optional> conditions, Map additionalProperties) { + Optional> contents, + Optional content, + Optional> conditions, + Map additionalProperties) { + this.contents = contents; this.content = content; this.conditions = conditions; this.additionalProperties = additionalProperties; } + /** + * @return This is an alternative to the content property. It allows to specify variants of the same content, one per language. + *

        Usage:

        + *
          + *
        • If your assistants are multilingual, you can provide content for each language.
        • + *
        • If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.
        • + *
        + *

        This will override the content property.

        + */ + @JsonProperty("contents") + public Optional> getContents() { + return contents; + } + /** * @return This is the content that the assistant says when this message is triggered. */ @JsonProperty("content") - public String getContent() { + public Optional getContent() { return content; } @@ -63,12 +82,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ToolMessageStart other) { - return content.equals(other.content) && conditions.equals(other.conditions); + return contents.equals(other.contents) && content.equals(other.content) && conditions.equals(other.conditions); } @java.lang.Override public int hashCode() { - return Objects.hash(this.content, this.conditions); + return Objects.hash(this.contents, this.content, this.conditions); } @java.lang.Override @@ -76,27 +95,15 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ContentStage builder() { + public static Builder builder() { return new Builder(); } - public interface ContentStage { - _FinalStage content(@NotNull String content); - - Builder from(ToolMessageStart other); - } - - public interface _FinalStage { - ToolMessageStart build(); - - _FinalStage conditions(Optional> conditions); - - _FinalStage conditions(List conditions); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ContentStage, _FinalStage { - private String content; + public static final class Builder { + private Optional> contents = Optional.empty(); + + private Optional content = Optional.empty(); private Optional> conditions = Optional.empty(); @@ -105,44 +112,48 @@ public static final class Builder implements ContentStage, _FinalStage { private Builder() {} - @java.lang.Override public Builder from(ToolMessageStart other) { + contents(other.getContents()); content(other.getContent()); conditions(other.getConditions()); return this; } - /** - *

        This is the content that the assistant says when this message is triggered.

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

        This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.

        - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage conditions(List conditions) { - this.conditions = Optional.ofNullable(conditions); + public Builder contents(List contents) { + this.contents = Optional.ofNullable(contents); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); return this; } - @java.lang.Override @JsonSetter(value = "conditions", nulls = Nulls.SKIP) - public _FinalStage conditions(Optional> conditions) { + public Builder conditions(Optional> conditions) { this.conditions = conditions; return this; } - @java.lang.Override + public Builder conditions(List conditions) { + this.conditions = Optional.ofNullable(conditions); + return this; + } + public ToolMessageStart build() { - return new ToolMessageStart(content, conditions, additionalProperties); + return new ToolMessageStart(contents, content, conditions, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TransferDestinationAssistant.java b/src/main/java/com/vapi/api/types/TransferDestinationAssistant.java index 7c8b9f0..c45a0ef 100644 --- a/src/main/java/com/vapi/api/types/TransferDestinationAssistant.java +++ b/src/main/java/com/vapi/api/types/TransferDestinationAssistant.java @@ -21,31 +21,45 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TransferDestinationAssistant.Builder.class) public final class TransferDestinationAssistant { + private final Optional message; + private final Optional transferMode; private final String assistantName; - private final Optional message; - private final Optional description; private final Map additionalProperties; private TransferDestinationAssistant( + Optional message, Optional transferMode, String assistantName, - Optional message, Optional description, Map additionalProperties) { + this.message = message; this.transferMode = transferMode; this.assistantName = assistantName; - this.message = message; this.description = description; this.additionalProperties = additionalProperties; } /** - * @return This is the mode to use for the transfer. Default is rolling-history. + * @return This is spoken to the customer before connecting them to the destination. + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + /** + * @return This is the mode to use for the transfer. Defaults to rolling-history. *
          *
        • *

          rolling-history: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer.

          @@ -86,7 +100,25 @@ private TransferDestinationAssistant( * assistant: (destination.message) * assistant: assistant2 first message (or model generated if firstMessageMode is set to assistant-speaks-first-with-model-generated-message)

          *
        • + *
        • + *

          delete-history: This deletes the entire conversation history on transfer.

          + *

          Example:

          + *

          Pre-transfer: + * system: assistant1 system message + * assistant: assistant1 first message + * user: hey, good morning + * assistant: how can i help? + * user: i need help with my account + * assistant: (destination.message)

          + *

          Post-transfer: + * system: assistant2 system message + * assistant: assistant2 first message + * user: Yes, please + * assistant: how can i help? + * user: i need help with my account

          + *
        • *
        + *

        @default 'rolling-history'

        */ @JsonProperty("transferMode") public Optional getTransferMode() { @@ -101,16 +133,6 @@ public String getAssistantName() { return assistantName; } - /** - * @return This is the message to say before transferring the call to the destination. - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        - */ - @JsonProperty("message") - public Optional getMessage() { - return message; - } - /** * @return This is the description of the destination, used by the AI to choose when and how to transfer the call. */ @@ -131,15 +153,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(TransferDestinationAssistant other) { - return transferMode.equals(other.transferMode) + return message.equals(other.message) + && transferMode.equals(other.transferMode) && assistantName.equals(other.assistantName) - && message.equals(other.message) && description.equals(other.description); } @java.lang.Override public int hashCode() { - return Objects.hash(this.transferMode, this.assistantName, this.message, this.description); + return Objects.hash(this.message, this.transferMode, this.assistantName, this.description); } @java.lang.Override @@ -160,13 +182,13 @@ public interface AssistantNameStage { public interface _FinalStage { TransferDestinationAssistant build(); - _FinalStage transferMode(Optional transferMode); + _FinalStage message(Optional message); - _FinalStage transferMode(TransferMode transferMode); + _FinalStage message(TransferDestinationAssistantMessage message); - _FinalStage message(Optional message); + _FinalStage transferMode(Optional transferMode); - _FinalStage message(String message); + _FinalStage transferMode(TransferMode transferMode); _FinalStage description(Optional description); @@ -179,10 +201,10 @@ public static final class Builder implements AssistantNameStage, _FinalStage { private Optional description = Optional.empty(); - private Optional message = Optional.empty(); - private Optional transferMode = Optional.empty(); + private Optional message = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -190,9 +212,9 @@ private Builder() {} @java.lang.Override public Builder from(TransferDestinationAssistant other) { + message(other.getMessage()); transferMode(other.getTransferMode()); assistantName(other.getAssistantName()); - message(other.getMessage()); description(other.getDescription()); return this; } @@ -226,26 +248,7 @@ public _FinalStage description(Optional description) { } /** - *

        This is the message to say before transferring the call to the destination.

        - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

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

        This is the mode to use for the transfer. Default is rolling-history.

        + *

        This is the mode to use for the transfer. Defaults to rolling-history.

        *
          *
        • *

          rolling-history: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer.

          @@ -286,7 +289,25 @@ public _FinalStage message(Optional message) { * assistant: (destination.message) * assistant: assistant2 first message (or model generated if firstMessageMode is set to assistant-speaks-first-with-model-generated-message)

          *
        • + *
        • + *

          delete-history: This deletes the entire conversation history on transfer.

          + *

          Example:

          + *

          Pre-transfer: + * system: assistant1 system message + * assistant: assistant1 first message + * user: hey, good morning + * assistant: how can i help? + * user: i need help with my account + * assistant: (destination.message)

          + *

          Post-transfer: + * system: assistant2 system message + * assistant: assistant2 first message + * user: Yes, please + * assistant: how can i help? + * user: i need help with my account

          + *
        • *
        + *

        @default 'rolling-history'

        * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -302,10 +323,33 @@ public _FinalStage transferMode(Optional transferMode) { return this; } + /** + *

        This is spoken to the customer before connecting them to the destination.

        + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage message(TransferDestinationAssistantMessage message) { + this.message = Optional.ofNullable(message); + return this; + } + + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + @java.lang.Override public TransferDestinationAssistant build() { return new TransferDestinationAssistant( - transferMode, assistantName, message, description, additionalProperties); + message, transferMode, assistantName, description, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TransferDestinationAssistantMessage.java b/src/main/java/com/vapi/api/types/TransferDestinationAssistantMessage.java new file mode 100644 index 0000000..e4baba8 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferDestinationAssistantMessage.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransferDestinationAssistantMessage.Deserializer.class) +public final class TransferDestinationAssistantMessage { + private final Object value; + + private final int type; + + private TransferDestinationAssistantMessage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomMessage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferDestinationAssistantMessage + && equalTo((TransferDestinationAssistantMessage) other); + } + + private boolean equalTo(TransferDestinationAssistantMessage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransferDestinationAssistantMessage of(String value) { + return new TransferDestinationAssistantMessage(value, 0); + } + + public static TransferDestinationAssistantMessage of(CustomMessage value) { + return new TransferDestinationAssistantMessage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CustomMessage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransferDestinationAssistantMessage.class); + } + + @java.lang.Override + public TransferDestinationAssistantMessage deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomMessage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransferDestinationNumber.java b/src/main/java/com/vapi/api/types/TransferDestinationNumber.java index d5679a4..a7c2d5a 100644 --- a/src/main/java/com/vapi/api/types/TransferDestinationNumber.java +++ b/src/main/java/com/vapi/api/types/TransferDestinationNumber.java @@ -21,6 +21,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TransferDestinationNumber.Builder.class) public final class TransferDestinationNumber { + private final Optional message; + private final Optional numberE164CheckEnabled; private final String number; @@ -29,29 +31,45 @@ public final class TransferDestinationNumber { private final Optional callerId; - private final Optional message; + private final Optional transferPlan; private final Optional description; private final Map additionalProperties; private TransferDestinationNumber( + Optional message, Optional numberE164CheckEnabled, String number, Optional extension, Optional callerId, - Optional message, + Optional transferPlan, Optional description, Map additionalProperties) { + this.message = message; this.numberE164CheckEnabled = numberE164CheckEnabled; this.number = number; this.extension = extension; this.callerId = callerId; - this.message = message; + this.transferPlan = transferPlan; this.description = description; this.additionalProperties = additionalProperties; } + /** + * @return This is spoken to the customer before connecting them to the destination. + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + /** * @return This is the flag to toggle the E164 check for the number field. This is an advanced property which should be used if you know your use case requires it. *

        Use cases:

        @@ -101,13 +119,12 @@ public Optional getCallerId() { } /** - * @return This is the message to say before transferring the call to the destination. - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        + * @return This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to blind-transfer. + *

        @default transferPlan.mode='blind-transfer'

        */ - @JsonProperty("message") - public Optional getMessage() { - return message; + @JsonProperty("transferPlan") + public Optional getTransferPlan() { + return transferPlan; } /** @@ -130,22 +147,24 @@ public Map getAdditionalProperties() { } private boolean equalTo(TransferDestinationNumber other) { - return numberE164CheckEnabled.equals(other.numberE164CheckEnabled) + return message.equals(other.message) + && numberE164CheckEnabled.equals(other.numberE164CheckEnabled) && number.equals(other.number) && extension.equals(other.extension) && callerId.equals(other.callerId) - && message.equals(other.message) + && transferPlan.equals(other.transferPlan) && description.equals(other.description); } @java.lang.Override public int hashCode() { return Objects.hash( + this.message, this.numberE164CheckEnabled, this.number, this.extension, this.callerId, - this.message, + this.transferPlan, this.description); } @@ -167,6 +186,10 @@ public interface NumberStage { public interface _FinalStage { TransferDestinationNumber build(); + _FinalStage message(Optional message); + + _FinalStage message(TransferDestinationNumberMessage message); + _FinalStage numberE164CheckEnabled(Optional numberE164CheckEnabled); _FinalStage numberE164CheckEnabled(Boolean numberE164CheckEnabled); @@ -179,9 +202,9 @@ public interface _FinalStage { _FinalStage callerId(String callerId); - _FinalStage message(Optional message); + _FinalStage transferPlan(Optional transferPlan); - _FinalStage message(String message); + _FinalStage transferPlan(TransferPlan transferPlan); _FinalStage description(Optional description); @@ -194,7 +217,7 @@ public static final class Builder implements NumberStage, _FinalStage { private Optional description = Optional.empty(); - private Optional message = Optional.empty(); + private Optional transferPlan = Optional.empty(); private Optional callerId = Optional.empty(); @@ -202,6 +225,8 @@ public static final class Builder implements NumberStage, _FinalStage { private Optional numberE164CheckEnabled = Optional.empty(); + private Optional message = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -209,11 +234,12 @@ private Builder() {} @java.lang.Override public Builder from(TransferDestinationNumber other) { + message(other.getMessage()); numberE164CheckEnabled(other.getNumberE164CheckEnabled()); number(other.getNumber()); extension(other.getExtension()); callerId(other.getCallerId()); - message(other.getMessage()); + transferPlan(other.getTransferPlan()); description(other.getDescription()); return this; } @@ -247,21 +273,20 @@ public _FinalStage description(Optional description) { } /** - *

        This is the message to say before transferring the call to the destination.

        - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        + *

        This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to blind-transfer.

        + *

        @default transferPlan.mode='blind-transfer'

        * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage message(String message) { - this.message = Optional.ofNullable(message); + public _FinalStage transferPlan(TransferPlan transferPlan) { + this.transferPlan = Optional.ofNullable(transferPlan); return this; } @java.lang.Override - @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { - this.message = message; + @JsonSetter(value = "transferPlan", nulls = Nulls.SKIP) + public _FinalStage transferPlan(Optional transferPlan) { + this.transferPlan = transferPlan; return this; } @@ -332,10 +357,40 @@ public _FinalStage numberE164CheckEnabled(Optional numberE164CheckEnabl return this; } + /** + *

        This is spoken to the customer before connecting them to the destination.

        + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage message(TransferDestinationNumberMessage message) { + this.message = Optional.ofNullable(message); + return this; + } + + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + @java.lang.Override public TransferDestinationNumber build() { return new TransferDestinationNumber( - numberE164CheckEnabled, number, extension, callerId, message, description, additionalProperties); + message, + numberE164CheckEnabled, + number, + extension, + callerId, + transferPlan, + description, + additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TransferDestinationNumberMessage.java b/src/main/java/com/vapi/api/types/TransferDestinationNumberMessage.java new file mode 100644 index 0000000..18a47b0 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferDestinationNumberMessage.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransferDestinationNumberMessage.Deserializer.class) +public final class TransferDestinationNumberMessage { + private final Object value; + + private final int type; + + private TransferDestinationNumberMessage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomMessage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferDestinationNumberMessage && equalTo((TransferDestinationNumberMessage) other); + } + + private boolean equalTo(TransferDestinationNumberMessage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransferDestinationNumberMessage of(String value) { + return new TransferDestinationNumberMessage(value, 0); + } + + public static TransferDestinationNumberMessage of(CustomMessage value) { + return new TransferDestinationNumberMessage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CustomMessage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransferDestinationNumberMessage.class); + } + + @java.lang.Override + public TransferDestinationNumberMessage deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomMessage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransferDestinationSip.java b/src/main/java/com/vapi/api/types/TransferDestinationSip.java index b32c4db..34c6cf7 100644 --- a/src/main/java/com/vapi/api/types/TransferDestinationSip.java +++ b/src/main/java/com/vapi/api/types/TransferDestinationSip.java @@ -21,25 +21,47 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TransferDestinationSip.Builder.class) public final class TransferDestinationSip { + private final Optional message; + private final String sipUri; - private final Optional message; + private final Optional transferPlan; + + private final Optional> sipHeaders; private final Optional description; private final Map additionalProperties; private TransferDestinationSip( + Optional message, String sipUri, - Optional message, + Optional transferPlan, + Optional> sipHeaders, Optional description, Map additionalProperties) { - this.sipUri = sipUri; this.message = message; + this.sipUri = sipUri; + this.transferPlan = transferPlan; + this.sipHeaders = sipHeaders; this.description = description; this.additionalProperties = additionalProperties; } + /** + * @return This is spoken to the customer before connecting them to the destination. + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + /** * @return This is the SIP URI to transfer the call to. */ @@ -49,13 +71,20 @@ public String getSipUri() { } /** - * @return This is the message to say before transferring the call to the destination. - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        + * @return This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to blind-transfer. + *

        @default transferPlan.mode='blind-transfer'

        */ - @JsonProperty("message") - public Optional getMessage() { - return message; + @JsonProperty("transferPlan") + public Optional getTransferPlan() { + return transferPlan; + } + + /** + * @return These are custom headers to be added to SIP refer during transfer call. + */ + @JsonProperty("sipHeaders") + public Optional> getSipHeaders() { + return sipHeaders; } /** @@ -78,12 +107,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(TransferDestinationSip other) { - return sipUri.equals(other.sipUri) && message.equals(other.message) && description.equals(other.description); + return message.equals(other.message) + && sipUri.equals(other.sipUri) + && transferPlan.equals(other.transferPlan) + && sipHeaders.equals(other.sipHeaders) + && description.equals(other.description); } @java.lang.Override public int hashCode() { - return Objects.hash(this.sipUri, this.message, this.description); + return Objects.hash(this.message, this.sipUri, this.transferPlan, this.sipHeaders, this.description); } @java.lang.Override @@ -104,9 +137,17 @@ public interface SipUriStage { public interface _FinalStage { TransferDestinationSip build(); - _FinalStage message(Optional message); + _FinalStage message(Optional message); + + _FinalStage message(TransferDestinationSipMessage message); + + _FinalStage transferPlan(Optional transferPlan); - _FinalStage message(String message); + _FinalStage transferPlan(TransferPlan transferPlan); + + _FinalStage sipHeaders(Optional> sipHeaders); + + _FinalStage sipHeaders(Map sipHeaders); _FinalStage description(Optional description); @@ -119,7 +160,11 @@ public static final class Builder implements SipUriStage, _FinalStage { private Optional description = Optional.empty(); - private Optional message = Optional.empty(); + private Optional> sipHeaders = Optional.empty(); + + private Optional transferPlan = Optional.empty(); + + private Optional message = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -128,8 +173,10 @@ private Builder() {} @java.lang.Override public Builder from(TransferDestinationSip other) { - sipUri(other.getSipUri()); message(other.getMessage()); + sipUri(other.getSipUri()); + transferPlan(other.getTransferPlan()); + sipHeaders(other.getSipHeaders()); description(other.getDescription()); return this; } @@ -163,27 +210,67 @@ public _FinalStage description(Optional description) { } /** - *

        This is the message to say before transferring the call to the destination.

        - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        + *

        These are custom headers to be added to SIP refer during transfer call.

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

        This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to blind-transfer.

        + *

        @default transferPlan.mode='blind-transfer'

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

        This is spoken to the customer before connecting them to the destination.

        + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage message(String message) { + public _FinalStage message(TransferDestinationSipMessage message) { this.message = Optional.ofNullable(message); return this; } @java.lang.Override @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { + public _FinalStage message(Optional message) { this.message = message; return this; } @java.lang.Override public TransferDestinationSip build() { - return new TransferDestinationSip(sipUri, message, description, additionalProperties); + return new TransferDestinationSip( + message, sipUri, transferPlan, sipHeaders, description, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TransferDestinationSipMessage.java b/src/main/java/com/vapi/api/types/TransferDestinationSipMessage.java new file mode 100644 index 0000000..52609df --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferDestinationSipMessage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransferDestinationSipMessage.Deserializer.class) +public final class TransferDestinationSipMessage { + private final Object value; + + private final int type; + + private TransferDestinationSipMessage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomMessage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferDestinationSipMessage && equalTo((TransferDestinationSipMessage) other); + } + + private boolean equalTo(TransferDestinationSipMessage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransferDestinationSipMessage of(String value) { + return new TransferDestinationSipMessage(value, 0); + } + + public static TransferDestinationSipMessage of(CustomMessage value) { + return new TransferDestinationSipMessage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CustomMessage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransferDestinationSipMessage.class); + } + + @java.lang.Override + public TransferDestinationSipMessage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomMessage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransferDestinationStep.java b/src/main/java/com/vapi/api/types/TransferDestinationStep.java index 0413abe..e2c31fb 100644 --- a/src/main/java/com/vapi/api/types/TransferDestinationStep.java +++ b/src/main/java/com/vapi/api/types/TransferDestinationStep.java @@ -21,41 +21,45 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TransferDestinationStep.Builder.class) public final class TransferDestinationStep { - private final String stepName; + private final Optional message; - private final Optional message; + private final String stepName; private final Optional description; private final Map additionalProperties; private TransferDestinationStep( + Optional message, String stepName, - Optional message, Optional description, Map additionalProperties) { - this.stepName = stepName; this.message = message; + this.stepName = stepName; this.description = description; this.additionalProperties = additionalProperties; } /** - * @return This is the step to transfer to. + * @return This is spoken to the customer before connecting them to the destination. + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        */ - @JsonProperty("stepName") - public String getStepName() { - return stepName; + @JsonProperty("message") + public Optional getMessage() { + return message; } /** - * @return This is the message to say before transferring the call to the destination. - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        + * @return This is the step to transfer to. */ - @JsonProperty("message") - public Optional getMessage() { - return message; + @JsonProperty("stepName") + public String getStepName() { + return stepName; } /** @@ -78,14 +82,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(TransferDestinationStep other) { - return stepName.equals(other.stepName) - && message.equals(other.message) + return message.equals(other.message) + && stepName.equals(other.stepName) && description.equals(other.description); } @java.lang.Override public int hashCode() { - return Objects.hash(this.stepName, this.message, this.description); + return Objects.hash(this.message, this.stepName, this.description); } @java.lang.Override @@ -106,9 +110,9 @@ public interface StepNameStage { public interface _FinalStage { TransferDestinationStep build(); - _FinalStage message(Optional message); + _FinalStage message(Optional message); - _FinalStage message(String message); + _FinalStage message(TransferDestinationStepMessage message); _FinalStage description(Optional description); @@ -121,7 +125,7 @@ public static final class Builder implements StepNameStage, _FinalStage { private Optional description = Optional.empty(); - private Optional message = Optional.empty(); + private Optional message = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -130,8 +134,8 @@ private Builder() {} @java.lang.Override public Builder from(TransferDestinationStep other) { - stepName(other.getStepName()); message(other.getMessage()); + stepName(other.getStepName()); description(other.getDescription()); return this; } @@ -165,27 +169,31 @@ public _FinalStage description(Optional description) { } /** - *

        This is the message to say before transferring the call to the destination.

        - *

        If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".

        - *

        If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.

        + *

        This is spoken to the customer before connecting them to the destination.

        + *

        Usage:

        + *
          + *
        • If this is not provided and transfer tool messages is not provided, default is "Transferring the call now".
        • + *
        • If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.
        • + *
        + *

        This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.

        * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage message(String message) { + public _FinalStage message(TransferDestinationStepMessage message) { this.message = Optional.ofNullable(message); return this; } @java.lang.Override @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { + public _FinalStage message(Optional message) { this.message = message; return this; } @java.lang.Override public TransferDestinationStep build() { - return new TransferDestinationStep(stepName, message, description, additionalProperties); + return new TransferDestinationStep(message, stepName, description, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TransferDestinationStepMessage.java b/src/main/java/com/vapi/api/types/TransferDestinationStepMessage.java new file mode 100644 index 0000000..cef4f8a --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferDestinationStepMessage.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransferDestinationStepMessage.Deserializer.class) +public final class TransferDestinationStepMessage { + private final Object value; + + private final int type; + + private TransferDestinationStepMessage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomMessage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferDestinationStepMessage && equalTo((TransferDestinationStepMessage) other); + } + + private boolean equalTo(TransferDestinationStepMessage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransferDestinationStepMessage of(String value) { + return new TransferDestinationStepMessage(value, 0); + } + + public static TransferDestinationStepMessage of(CustomMessage value) { + return new TransferDestinationStepMessage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CustomMessage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransferDestinationStepMessage.class); + } + + @java.lang.Override + public TransferDestinationStepMessage deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomMessage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransferPlan.java b/src/main/java/com/vapi/api/types/TransferPlan.java new file mode 100644 index 0000000..f1022c2 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferPlan.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TransferPlan.Builder.class) +public final class TransferPlan { + private final TransferPlanMode mode; + + private final Optional message; + + private final Optional summaryPlan; + + private final Map additionalProperties; + + private TransferPlan( + TransferPlanMode mode, + Optional message, + Optional summaryPlan, + Map additionalProperties) { + this.mode = mode; + this.message = message; + this.summaryPlan = summaryPlan; + this.additionalProperties = additionalProperties; + } + + /** + * @return This configures how transfer is executed and the experience of the destination party receiving the call. + *

        Usage:

        + *
          + *
        • blind-transfer: The assistant forwards the call to the destination without any message or summary.
        • + *
        • blind-transfer-add-summary-to-sip-header: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.
        • + *
        • warm-transfer-say-message: The assistant dials the destination, delivers the message to the destination party, connects the customer, and leaves the call.
        • + *
        • warm-transfer-say-summary: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.
        • + *
        • warm-transfer-wait-for-operator-to-speak-first-and-then-say-message: The assistant dials the destination, waits for the operator to speak, delivers the message to the destination party, and then connects the customer.
        • + *
        • warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.
        • + *
        + *

        @default 'blind-transfer'

        + */ + @JsonProperty("mode") + public TransferPlanMode getMode() { + return mode; + } + + /** + * @return This is the message the assistant will deliver to the destination party before connecting the customer. + *

        Usage:

        + *
          + *
        • Used only when mode is warm-transfer-say-message or warm-transfer-wait-for-operator-to-speak-first-and-then-say-message.
        • + *
        + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + /** + * @return This is the plan for generating a summary of the call to present to the destination party. + *

        Usage:

        + *
          + *
        • Used only when mode is warm-transfer-say-summary or warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary.
        • + *
        + */ + @JsonProperty("summaryPlan") + public Optional getSummaryPlan() { + return summaryPlan; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferPlan && equalTo((TransferPlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TransferPlan other) { + return mode.equals(other.mode) && message.equals(other.message) && summaryPlan.equals(other.summaryPlan); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mode, this.message, this.summaryPlan); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModeStage builder() { + return new Builder(); + } + + public interface ModeStage { + _FinalStage mode(@NotNull TransferPlanMode mode); + + Builder from(TransferPlan other); + } + + public interface _FinalStage { + TransferPlan build(); + + _FinalStage message(Optional message); + + _FinalStage message(TransferPlanMessage message); + + _FinalStage summaryPlan(Optional summaryPlan); + + _FinalStage summaryPlan(SummaryPlan summaryPlan); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModeStage, _FinalStage { + private TransferPlanMode mode; + + private Optional summaryPlan = Optional.empty(); + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TransferPlan other) { + mode(other.getMode()); + message(other.getMessage()); + summaryPlan(other.getSummaryPlan()); + return this; + } + + /** + *

        This configures how transfer is executed and the experience of the destination party receiving the call.

        + *

        Usage:

        + *
          + *
        • blind-transfer: The assistant forwards the call to the destination without any message or summary.
        • + *
        • blind-transfer-add-summary-to-sip-header: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.
        • + *
        • warm-transfer-say-message: The assistant dials the destination, delivers the message to the destination party, connects the customer, and leaves the call.
        • + *
        • warm-transfer-say-summary: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.
        • + *
        • warm-transfer-wait-for-operator-to-speak-first-and-then-say-message: The assistant dials the destination, waits for the operator to speak, delivers the message to the destination party, and then connects the customer.
        • + *
        • warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.
        • + *
        + *

        @default 'blind-transfer'

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

        This is the plan for generating a summary of the call to present to the destination party.

        + *

        Usage:

        + *
          + *
        • Used only when mode is warm-transfer-say-summary or warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary.
        • + *
        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage summaryPlan(SummaryPlan summaryPlan) { + this.summaryPlan = Optional.ofNullable(summaryPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "summaryPlan", nulls = Nulls.SKIP) + public _FinalStage summaryPlan(Optional summaryPlan) { + this.summaryPlan = summaryPlan; + return this; + } + + /** + *

        This is the message the assistant will deliver to the destination party before connecting the customer.

        + *

        Usage:

        + *
          + *
        • Used only when mode is warm-transfer-say-message or warm-transfer-wait-for-operator-to-speak-first-and-then-say-message.
        • + *
        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage message(TransferPlanMessage message) { + this.message = Optional.ofNullable(message); + return this; + } + + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @java.lang.Override + public TransferPlan build() { + return new TransferPlan(mode, message, summaryPlan, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransferPlanMessage.java b/src/main/java/com/vapi/api/types/TransferPlanMessage.java new file mode 100644 index 0000000..9a9be70 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferPlanMessage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.vapi.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransferPlanMessage.Deserializer.class) +public final class TransferPlanMessage { + private final Object value; + + private final int type; + + private TransferPlanMessage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomMessage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferPlanMessage && equalTo((TransferPlanMessage) other); + } + + private boolean equalTo(TransferPlanMessage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransferPlanMessage of(String value) { + return new TransferPlanMessage(value, 0); + } + + public static TransferPlanMessage of(CustomMessage value) { + return new TransferPlanMessage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CustomMessage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransferPlanMessage.class); + } + + @java.lang.Override + public TransferPlanMessage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomMessage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransferPlanMode.java b/src/main/java/com/vapi/api/types/TransferPlanMode.java new file mode 100644 index 0000000..065878d --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransferPlanMode.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TransferPlanMode { + BLIND_TRANSFER("blind-transfer"), + + BLIND_TRANSFER_ADD_SUMMARY_TO_SIP_HEADER("blind-transfer-add-summary-to-sip-header"), + + WARM_TRANSFER_SAY_MESSAGE("warm-transfer-say-message"), + + WARM_TRANSFER_SAY_SUMMARY("warm-transfer-say-summary"), + + WARM_TRANSFER_WAIT_FOR_OPERATOR_TO_SPEAK_FIRST_AND_THEN_SAY_MESSAGE( + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message"), + + WARM_TRANSFER_WAIT_FOR_OPERATOR_TO_SPEAK_FIRST_AND_THEN_SAY_SUMMARY( + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary"); + + private final String value; + + TransferPlanMode(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/Transport.java b/src/main/java/com/vapi/api/types/Transport.java new file mode 100644 index 0000000..41713fc --- /dev/null +++ b/src/main/java/com/vapi/api/types/Transport.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Transport.Builder.class) +public final class Transport { + private final Optional provider; + + private final Optional assistantVideoEnabled; + + private final Map additionalProperties; + + private Transport( + Optional provider, + Optional assistantVideoEnabled, + Map additionalProperties) { + this.provider = provider; + this.assistantVideoEnabled = assistantVideoEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the provider used for the call. + */ + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + /** + * @return This is determines whether the assistant will have video enabled. + *

        Only relevant for webCall type.

        + */ + @JsonProperty("assistantVideoEnabled") + public Optional getAssistantVideoEnabled() { + return assistantVideoEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Transport && equalTo((Transport) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Transport other) { + return provider.equals(other.provider) && assistantVideoEnabled.equals(other.assistantVideoEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider, this.assistantVideoEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + private Optional assistantVideoEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Transport other) { + provider(other.getProvider()); + assistantVideoEnabled(other.getAssistantVideoEnabled()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(TransportProvider provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + @JsonSetter(value = "assistantVideoEnabled", nulls = Nulls.SKIP) + public Builder assistantVideoEnabled(Optional assistantVideoEnabled) { + this.assistantVideoEnabled = assistantVideoEnabled; + return this; + } + + public Builder assistantVideoEnabled(Boolean assistantVideoEnabled) { + this.assistantVideoEnabled = Optional.ofNullable(assistantVideoEnabled); + return this; + } + + public Transport build() { + return new Transport(provider, assistantVideoEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TransportCost.java b/src/main/java/com/vapi/api/types/TransportCost.java index 31b352d..81a40fd 100644 --- a/src/main/java/com/vapi/api/types/TransportCost.java +++ b/src/main/java/com/vapi/api/types/TransportCost.java @@ -9,27 +9,41 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TransportCost.Builder.class) public final class TransportCost { + private final Optional provider; + private final double minutes; private final double cost; private final Map additionalProperties; - private TransportCost(double minutes, double cost, Map additionalProperties) { + private TransportCost( + Optional provider, + double minutes, + double cost, + Map additionalProperties) { + this.provider = provider; this.minutes = minutes; this.cost = cost; this.additionalProperties = additionalProperties; } + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + /** * @return This is the minutes of transport usage. This should match call.endedAt - call.startedAt. */ @@ -58,12 +72,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(TransportCost other) { - return minutes == other.minutes && cost == other.cost; + return provider.equals(other.provider) && minutes == other.minutes && cost == other.cost; } @java.lang.Override public int hashCode() { - return Objects.hash(this.minutes, this.cost); + return Objects.hash(this.provider, this.minutes, this.cost); } @java.lang.Override @@ -87,6 +101,10 @@ public interface CostStage { public interface _FinalStage { TransportCost build(); + + _FinalStage provider(Optional provider); + + _FinalStage provider(TransportCostProvider provider); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -95,6 +113,8 @@ public static final class Builder implements MinutesStage, CostStage, _FinalStag private double cost; + private Optional provider = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -102,6 +122,7 @@ private Builder() {} @java.lang.Override public Builder from(TransportCost other) { + provider(other.getProvider()); minutes(other.getMinutes()); cost(other.getCost()); return this; @@ -129,9 +150,22 @@ public _FinalStage cost(double cost) { return this; } + @java.lang.Override + public _FinalStage provider(TransportCostProvider provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + @java.lang.Override + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public _FinalStage provider(Optional provider) { + this.provider = provider; + return this; + } + @java.lang.Override public TransportCost build() { - return new TransportCost(minutes, cost, additionalProperties); + return new TransportCost(provider, minutes, cost, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/TransportCostProvider.java b/src/main/java/com/vapi/api/types/TransportCostProvider.java new file mode 100644 index 0000000..ea1c4df --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransportCostProvider.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TransportCostProvider { + TWILIO("twilio"), + + VONAGE("vonage"), + + VAPI("vapi"); + + private final String value; + + TransportCostProvider(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/TransportProvider.java b/src/main/java/com/vapi/api/types/TransportProvider.java new file mode 100644 index 0000000..c44075c --- /dev/null +++ b/src/main/java/com/vapi/api/types/TransportProvider.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TransportProvider { + TWILIO("twilio"), + + VONAGE("vonage"), + + VAPI("vapi"), + + DAILY("daily"); + + private final String value; + + TransportProvider(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/TrieveKnowledgeBase.java b/src/main/java/com/vapi/api/types/TrieveKnowledgeBase.java new file mode 100644 index 0000000..b640ff2 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TrieveKnowledgeBase.java @@ -0,0 +1,311 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TrieveKnowledgeBase.Builder.class) +public final class TrieveKnowledgeBase { + private final Optional name; + + private final TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan; + + private final Optional vectorStoreCreatePlan; + + private final Optional vectorStoreProviderId; + + private final String id; + + private final String orgId; + + private final Map additionalProperties; + + private TrieveKnowledgeBase( + Optional name, + TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan, + Optional vectorStoreCreatePlan, + Optional vectorStoreProviderId, + String id, + String orgId, + Map additionalProperties) { + this.name = name; + this.vectorStoreSearchPlan = vectorStoreSearchPlan; + this.vectorStoreCreatePlan = vectorStoreCreatePlan; + this.vectorStoreProviderId = vectorStoreProviderId; + this.id = id; + this.orgId = orgId; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the name of the knowledge base. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return This is the plan on how to search the vector store while a call is going on. + */ + @JsonProperty("vectorStoreSearchPlan") + public TrieveKnowledgeBaseVectorStoreSearchPlan getVectorStoreSearchPlan() { + return vectorStoreSearchPlan; + } + + /** + * @return This is the plan if you want us to create a new vector store on your behalf. To use an existing vector store from your account, use vectoreStoreProviderId + */ + @JsonProperty("vectorStoreCreatePlan") + public Optional getVectorStoreCreatePlan() { + return vectorStoreCreatePlan; + } + + /** + * @return This is an vector store that you already have on your account with the provider. To create a new vector store, use vectorStoreCreatePlan. + *

        Usage:

        + *
          + *
        • To bring your own vector store from Trieve, go to https://trieve.ai
        • + *
        • Create a dataset, and use the datasetId here.
        • + *
        + */ + @JsonProperty("vectorStoreProviderId") + public Optional getVectorStoreProviderId() { + return vectorStoreProviderId; + } + + /** + * @return This is the id of the knowledge base. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the org id of the knowledge base. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveKnowledgeBase && equalTo((TrieveKnowledgeBase) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TrieveKnowledgeBase other) { + return name.equals(other.name) + && vectorStoreSearchPlan.equals(other.vectorStoreSearchPlan) + && vectorStoreCreatePlan.equals(other.vectorStoreCreatePlan) + && vectorStoreProviderId.equals(other.vectorStoreProviderId) + && id.equals(other.id) + && orgId.equals(other.orgId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.vectorStoreSearchPlan, + this.vectorStoreCreatePlan, + this.vectorStoreProviderId, + this.id, + this.orgId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VectorStoreSearchPlanStage builder() { + return new Builder(); + } + + public interface VectorStoreSearchPlanStage { + IdStage vectorStoreSearchPlan(@NotNull TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan); + + Builder from(TrieveKnowledgeBase other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + _FinalStage orgId(@NotNull String orgId); + } + + public interface _FinalStage { + TrieveKnowledgeBase build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage vectorStoreCreatePlan(Optional vectorStoreCreatePlan); + + _FinalStage vectorStoreCreatePlan(TrieveKnowledgeBaseVectorStoreCreatePlan vectorStoreCreatePlan); + + _FinalStage vectorStoreProviderId(Optional vectorStoreProviderId); + + _FinalStage vectorStoreProviderId(String vectorStoreProviderId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VectorStoreSearchPlanStage, IdStage, OrgIdStage, _FinalStage { + private TrieveKnowledgeBaseVectorStoreSearchPlan vectorStoreSearchPlan; + + private String id; + + private String orgId; + + private Optional vectorStoreProviderId = Optional.empty(); + + private Optional vectorStoreCreatePlan = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TrieveKnowledgeBase other) { + name(other.getName()); + vectorStoreSearchPlan(other.getVectorStoreSearchPlan()); + vectorStoreCreatePlan(other.getVectorStoreCreatePlan()); + vectorStoreProviderId(other.getVectorStoreProviderId()); + id(other.getId()); + orgId(other.getOrgId()); + return this; + } + + /** + *

        This is the plan on how to search the vector store while a call is going on.

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

        This is the id of the knowledge base.

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

        This is the org id of the knowledge base.

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

        This is an vector store that you already have on your account with the provider. To create a new vector store, use vectorStoreCreatePlan.

        + *

        Usage:

        + *
          + *
        • To bring your own vector store from Trieve, go to https://trieve.ai
        • + *
        • Create a dataset, and use the datasetId here.
        • + *
        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage vectorStoreProviderId(String vectorStoreProviderId) { + this.vectorStoreProviderId = Optional.ofNullable(vectorStoreProviderId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "vectorStoreProviderId", nulls = Nulls.SKIP) + public _FinalStage vectorStoreProviderId(Optional vectorStoreProviderId) { + this.vectorStoreProviderId = vectorStoreProviderId; + return this; + } + + /** + *

        This is the plan if you want us to create a new vector store on your behalf. To use an existing vector store from your account, use vectoreStoreProviderId

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

        This is the name of the knowledge base.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public TrieveKnowledgeBase build() { + return new TrieveKnowledgeBase( + name, + vectorStoreSearchPlan, + vectorStoreCreatePlan, + vectorStoreProviderId, + id, + orgId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreCreatePlan.java b/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreCreatePlan.java new file mode 100644 index 0000000..114b04f --- /dev/null +++ b/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreCreatePlan.java @@ -0,0 +1,191 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TrieveKnowledgeBaseVectorStoreCreatePlan.Builder.class) +public final class TrieveKnowledgeBaseVectorStoreCreatePlan { + private final List fileIds; + + private final Optional targetSplitsPerChunk; + + private final Optional> splitDelimiters; + + private final Optional rebalanceChunks; + + private final Map additionalProperties; + + private TrieveKnowledgeBaseVectorStoreCreatePlan( + List fileIds, + Optional targetSplitsPerChunk, + Optional> splitDelimiters, + Optional rebalanceChunks, + Map additionalProperties) { + this.fileIds = fileIds; + this.targetSplitsPerChunk = targetSplitsPerChunk; + this.splitDelimiters = splitDelimiters; + this.rebalanceChunks = rebalanceChunks; + this.additionalProperties = additionalProperties; + } + + /** + * @return These are the file ids that will be used to create the vector store. To upload files, use the POST /files endpoint. + */ + @JsonProperty("fileIds") + public List getFileIds() { + return fileIds; + } + + /** + * @return This is an optional field which allows you to specify the number of splits you want per chunk. If not specified, the default 20 is used. However, you may want to use a different number. + */ + @JsonProperty("targetSplitsPerChunk") + public Optional getTargetSplitsPerChunk() { + return targetSplitsPerChunk; + } + + /** + * @return This is an optional field which allows you to specify the delimiters to use when splitting the file before chunking the text. If not specified, the default [.!?\n] are used to split into sentences. However, you may want to use spaces or other delimiters. + */ + @JsonProperty("splitDelimiters") + public Optional> getSplitDelimiters() { + return splitDelimiters; + } + + /** + * @return This is an optional field which allows you to specify whether or not to rebalance the chunks created from the file. If not specified, the default true is used. If true, Trieve will evenly distribute remainder splits across chunks such that 66 splits with a target_splits_per_chunk of 20 will result in 3 chunks with 22 splits each. + */ + @JsonProperty("rebalanceChunks") + public Optional getRebalanceChunks() { + return rebalanceChunks; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveKnowledgeBaseVectorStoreCreatePlan + && equalTo((TrieveKnowledgeBaseVectorStoreCreatePlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TrieveKnowledgeBaseVectorStoreCreatePlan other) { + return fileIds.equals(other.fileIds) + && targetSplitsPerChunk.equals(other.targetSplitsPerChunk) + && splitDelimiters.equals(other.splitDelimiters) + && rebalanceChunks.equals(other.rebalanceChunks); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fileIds, this.targetSplitsPerChunk, this.splitDelimiters, this.rebalanceChunks); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List fileIds = new ArrayList<>(); + + private Optional targetSplitsPerChunk = Optional.empty(); + + private Optional> splitDelimiters = Optional.empty(); + + private Optional rebalanceChunks = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TrieveKnowledgeBaseVectorStoreCreatePlan other) { + fileIds(other.getFileIds()); + targetSplitsPerChunk(other.getTargetSplitsPerChunk()); + splitDelimiters(other.getSplitDelimiters()); + rebalanceChunks(other.getRebalanceChunks()); + return this; + } + + @JsonSetter(value = "fileIds", nulls = Nulls.SKIP) + public Builder fileIds(List fileIds) { + this.fileIds.clear(); + this.fileIds.addAll(fileIds); + return this; + } + + public Builder addFileIds(String fileIds) { + this.fileIds.add(fileIds); + return this; + } + + public Builder addAllFileIds(List fileIds) { + this.fileIds.addAll(fileIds); + return this; + } + + @JsonSetter(value = "targetSplitsPerChunk", nulls = Nulls.SKIP) + public Builder targetSplitsPerChunk(Optional targetSplitsPerChunk) { + this.targetSplitsPerChunk = targetSplitsPerChunk; + return this; + } + + public Builder targetSplitsPerChunk(Double targetSplitsPerChunk) { + this.targetSplitsPerChunk = Optional.ofNullable(targetSplitsPerChunk); + return this; + } + + @JsonSetter(value = "splitDelimiters", nulls = Nulls.SKIP) + public Builder splitDelimiters(Optional> splitDelimiters) { + this.splitDelimiters = splitDelimiters; + return this; + } + + public Builder splitDelimiters(List splitDelimiters) { + this.splitDelimiters = Optional.ofNullable(splitDelimiters); + return this; + } + + @JsonSetter(value = "rebalanceChunks", nulls = Nulls.SKIP) + public Builder rebalanceChunks(Optional rebalanceChunks) { + this.rebalanceChunks = rebalanceChunks; + return this; + } + + public Builder rebalanceChunks(Boolean rebalanceChunks) { + this.rebalanceChunks = Optional.ofNullable(rebalanceChunks); + return this; + } + + public TrieveKnowledgeBaseVectorStoreCreatePlan build() { + return new TrieveKnowledgeBaseVectorStoreCreatePlan( + fileIds, targetSplitsPerChunk, splitDelimiters, rebalanceChunks, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreSearchPlan.java b/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreSearchPlan.java new file mode 100644 index 0000000..5ae4a7b --- /dev/null +++ b/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreSearchPlan.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TrieveKnowledgeBaseVectorStoreSearchPlan.Builder.class) +public final class TrieveKnowledgeBaseVectorStoreSearchPlan { + private final Optional removeStopWords; + + private final Optional scoreThreshold; + + private final TrieveKnowledgeBaseVectorStoreSearchPlanSearchType searchType; + + private final Map additionalProperties; + + private TrieveKnowledgeBaseVectorStoreSearchPlan( + Optional removeStopWords, + Optional scoreThreshold, + TrieveKnowledgeBaseVectorStoreSearchPlanSearchType searchType, + Map additionalProperties) { + this.removeStopWords = removeStopWords; + this.scoreThreshold = scoreThreshold; + this.searchType = searchType; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. This will preserve queries that are entirely stop words. + */ + @JsonProperty("removeStopWords") + public Optional getRemoveStopWords() { + return removeStopWords; + } + + /** + * @return This is the score threshold to filter out chunks with a score below the threshold for cosine distance metric. For Manhattan Distance, Euclidean Distance, and Dot Product, it will filter out scores above the threshold distance. This threshold applies before weight and bias modifications. If not specified, this defaults to no threshold. A threshold of 0 will default to no threshold. + */ + @JsonProperty("scoreThreshold") + public Optional getScoreThreshold() { + return scoreThreshold; + } + + /** + * @return This is the search method used when searching for relevant chunks from the vector store. + */ + @JsonProperty("searchType") + public TrieveKnowledgeBaseVectorStoreSearchPlanSearchType getSearchType() { + return searchType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrieveKnowledgeBaseVectorStoreSearchPlan + && equalTo((TrieveKnowledgeBaseVectorStoreSearchPlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TrieveKnowledgeBaseVectorStoreSearchPlan other) { + return removeStopWords.equals(other.removeStopWords) + && scoreThreshold.equals(other.scoreThreshold) + && searchType.equals(other.searchType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.removeStopWords, this.scoreThreshold, this.searchType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SearchTypeStage builder() { + return new Builder(); + } + + public interface SearchTypeStage { + _FinalStage searchType(@NotNull TrieveKnowledgeBaseVectorStoreSearchPlanSearchType searchType); + + Builder from(TrieveKnowledgeBaseVectorStoreSearchPlan other); + } + + public interface _FinalStage { + TrieveKnowledgeBaseVectorStoreSearchPlan build(); + + _FinalStage removeStopWords(Optional removeStopWords); + + _FinalStage removeStopWords(Boolean removeStopWords); + + _FinalStage scoreThreshold(Optional scoreThreshold); + + _FinalStage scoreThreshold(Double scoreThreshold); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SearchTypeStage, _FinalStage { + private TrieveKnowledgeBaseVectorStoreSearchPlanSearchType searchType; + + private Optional scoreThreshold = Optional.empty(); + + private Optional removeStopWords = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TrieveKnowledgeBaseVectorStoreSearchPlan other) { + removeStopWords(other.getRemoveStopWords()); + scoreThreshold(other.getScoreThreshold()); + searchType(other.getSearchType()); + return this; + } + + /** + *

        This is the search method used when searching for relevant chunks from the vector store.

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

        This is the score threshold to filter out chunks with a score below the threshold for cosine distance metric. For Manhattan Distance, Euclidean Distance, and Dot Product, it will filter out scores above the threshold distance. This threshold applies before weight and bias modifications. If not specified, this defaults to no threshold. A threshold of 0 will default to no threshold.

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

        If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. This will preserve queries that are entirely stop words.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage removeStopWords(Boolean removeStopWords) { + this.removeStopWords = Optional.ofNullable(removeStopWords); + return this; + } + + @java.lang.Override + @JsonSetter(value = "removeStopWords", nulls = Nulls.SKIP) + public _FinalStage removeStopWords(Optional removeStopWords) { + this.removeStopWords = removeStopWords; + return this; + } + + @java.lang.Override + public TrieveKnowledgeBaseVectorStoreSearchPlan build() { + return new TrieveKnowledgeBaseVectorStoreSearchPlan( + removeStopWords, scoreThreshold, searchType, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreSearchPlanSearchType.java b/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreSearchPlanSearchType.java new file mode 100644 index 0000000..f671e80 --- /dev/null +++ b/src/main/java/com/vapi/api/types/TrieveKnowledgeBaseVectorStoreSearchPlanSearchType.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TrieveKnowledgeBaseVectorStoreSearchPlanSearchType { + FULLTEXT("fulltext"), + + SEMANTIC("semantic"), + + HYBRID("hybrid"), + + BM_25("bm25"); + + private final String value; + + TrieveKnowledgeBaseVectorStoreSearchPlanSearchType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/TwilioCredential.java b/src/main/java/com/vapi/api/types/TwilioCredential.java index d82734b..c34e403 100644 --- a/src/main/java/com/vapi/api/types/TwilioCredential.java +++ b/src/main/java/com/vapi/api/types/TwilioCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -30,6 +32,8 @@ public final class TwilioCredential { private final OffsetDateTime updatedAt; + private final Optional name; + private final String accountSid; private final Map additionalProperties; @@ -40,6 +44,7 @@ private TwilioCredential( String orgId, OffsetDateTime createdAt, OffsetDateTime updatedAt, + Optional name, String accountSid, Map additionalProperties) { this.authToken = authToken; @@ -47,6 +52,7 @@ private TwilioCredential( this.orgId = orgId; this.createdAt = createdAt; this.updatedAt = updatedAt; + this.name = name; this.accountSid = accountSid; this.additionalProperties = additionalProperties; } @@ -96,6 +102,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @JsonProperty("accountSid") public String getAccountSid() { return accountSid; @@ -118,12 +132,14 @@ private boolean equalTo(TwilioCredential other) { && orgId.equals(other.orgId) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) + && name.equals(other.name) && accountSid.equals(other.accountSid); } @java.lang.Override public int hashCode() { - return Objects.hash(this.authToken, this.id, this.orgId, this.createdAt, this.updatedAt, this.accountSid); + return Objects.hash( + this.authToken, this.id, this.orgId, this.createdAt, this.updatedAt, this.name, this.accountSid); } @java.lang.Override @@ -163,6 +179,10 @@ public interface AccountSidStage { public interface _FinalStage { TwilioCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -186,6 +206,8 @@ public static final class Builder private String accountSid; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -198,6 +220,7 @@ public Builder from(TwilioCredential other) { orgId(other.getOrgId()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); + name(other.getName()); accountSid(other.getAccountSid()); return this; } @@ -264,9 +287,27 @@ public _FinalStage accountSid(@NotNull String accountSid) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public TwilioCredential build() { - return new TwilioCredential(authToken, id, orgId, createdAt, updatedAt, accountSid, additionalProperties); + return new TwilioCredential( + authToken, id, orgId, createdAt, updatedAt, name, accountSid, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateAnthropicCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateAnthropicCredentialDto.java index 0c97e4c..bbe3f13 100644 --- a/src/main/java/com/vapi/api/types/UpdateAnthropicCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateAnthropicCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateAnthropicCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateAnthropicCredentialDto(String apiKey, Map additionalProperties) { + private UpdateAnthropicCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateAnthropicCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateAnthropicCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateAnthropicCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateAnthropicCredentialDto build() { - return new UpdateAnthropicCredentialDto(apiKey, additionalProperties); + return new UpdateAnthropicCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateAnyscaleCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateAnyscaleCredentialDto.java index c0caea1..daaff23 100644 --- a/src/main/java/com/vapi/api/types/UpdateAnyscaleCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateAnyscaleCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateAnyscaleCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateAnyscaleCredentialDto(String apiKey, Map additionalProperties) { + private UpdateAnyscaleCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateAnyscaleCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateAnyscaleCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateAnyscaleCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateAnyscaleCredentialDto build() { - return new UpdateAnyscaleCredentialDto(apiKey, additionalProperties); + return new UpdateAnyscaleCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateAssemblyAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateAssemblyAiCredentialDto.java new file mode 100644 index 0000000..b04cc98 --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateAssemblyAiCredentialDto.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAssemblyAiCredentialDto.Builder.class) +public final class UpdateAssemblyAiCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateAssemblyAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "assembly-ai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAssemblyAiCredentialDto && equalTo((UpdateAssemblyAiCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAssemblyAiCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(UpdateAssemblyAiCredentialDto other); + } + + public interface _FinalStage { + UpdateAssemblyAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateAssemblyAiCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public UpdateAssemblyAiCredentialDto build() { + return new UpdateAssemblyAiCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateAzureCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateAzureCredentialDto.java new file mode 100644 index 0000000..511d056 --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateAzureCredentialDto.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAzureCredentialDto.Builder.class) +public final class UpdateAzureCredentialDto { + private final Optional region; + + private final Optional apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateAzureCredentialDto( + Optional region, + Optional apiKey, + Optional name, + Map additionalProperties) { + this.region = region; + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "azure"; + } + + /** + * @return This is the service being used in Azure. + */ + @JsonProperty("service") + public String getService() { + return "speech"; + } + + /** + * @return This is the region of the Azure resource. + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public Optional getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAzureCredentialDto && equalTo((UpdateAzureCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAzureCredentialDto other) { + return region.equals(other.region) && apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.region, this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional region = Optional.empty(); + + private Optional apiKey = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateAzureCredentialDto other) { + region(other.getRegion()); + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public Builder region(Optional region) { + this.region = region; + return this; + } + + public Builder region(UpdateAzureCredentialDtoRegion region) { + this.region = Optional.ofNullable(region); + return this; + } + + @JsonSetter(value = "apiKey", nulls = Nulls.SKIP) + public Builder apiKey(Optional apiKey) { + this.apiKey = apiKey; + return this; + } + + public Builder apiKey(String apiKey) { + this.apiKey = Optional.ofNullable(apiKey); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + public UpdateAzureCredentialDto build() { + return new UpdateAzureCredentialDto(region, apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateAzureCredentialDtoRegion.java b/src/main/java/com/vapi/api/types/UpdateAzureCredentialDtoRegion.java new file mode 100644 index 0000000..a08a214 --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateAzureCredentialDtoRegion.java @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UpdateAzureCredentialDtoRegion { + AUSTRALIA("australia"), + + CANADA("canada"), + + EASTUS_2("eastus2"), + + EASTUS("eastus"), + + FRANCE("france"), + + INDIA("india"), + + JAPAN("japan"), + + UAENORTH("uaenorth"), + + NORTHCENTRALUS("northcentralus"), + + NORWAY("norway"), + + SOUTHCENTRALUS("southcentralus"), + + SWEDEN("sweden"), + + SWITZERLAND("switzerland"), + + UK("uk"), + + WESTUS("westus"), + + WESTUS_3("westus3"); + + private final String value; + + UpdateAzureCredentialDtoRegion(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDto.java index 6b02745..e03dead 100644 --- a/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDto.java @@ -17,6 +17,7 @@ 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) @@ -30,6 +31,8 @@ public final class UpdateAzureOpenAiCredentialDto { private final String openAiEndpoint; + private final Optional name; + private final Map additionalProperties; private UpdateAzureOpenAiCredentialDto( @@ -37,11 +40,13 @@ private UpdateAzureOpenAiCredentialDto( List models, String openAiKey, String openAiEndpoint, + Optional name, Map additionalProperties) { this.region = region; this.models = models; this.openAiKey = openAiKey; this.openAiEndpoint = openAiEndpoint; + this.name = name; this.additionalProperties = additionalProperties; } @@ -73,6 +78,14 @@ public String getOpenAiEndpoint() { return openAiEndpoint; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -88,12 +101,13 @@ private boolean equalTo(UpdateAzureOpenAiCredentialDto other) { return region.equals(other.region) && models.equals(other.models) && openAiKey.equals(other.openAiKey) - && openAiEndpoint.equals(other.openAiEndpoint); + && openAiEndpoint.equals(other.openAiEndpoint) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.region, this.models, this.openAiKey, this.openAiEndpoint); + return Objects.hash(this.region, this.models, this.openAiKey, this.openAiEndpoint, this.name); } @java.lang.Override @@ -127,6 +141,10 @@ public interface _FinalStage { _FinalStage addModels(UpdateAzureOpenAiCredentialDtoModelsItem models); _FinalStage addAllModels(List models); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -137,6 +155,8 @@ public static final class Builder implements RegionStage, OpenAiKeyStage, OpenAi private String openAiEndpoint; + private Optional name = Optional.empty(); + private List models = new ArrayList<>(); @JsonAnySetter @@ -150,6 +170,7 @@ public Builder from(UpdateAzureOpenAiCredentialDto other) { models(other.getModels()); openAiKey(other.getOpenAiKey()); openAiEndpoint(other.getOpenAiEndpoint()); + name(other.getName()); return this; } @@ -178,6 +199,23 @@ public _FinalStage openAiEndpoint(@NotNull String openAiEndpoint) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public _FinalStage addAllModels(List models) { this.models.addAll(models); @@ -200,7 +238,8 @@ public _FinalStage models(List models) @java.lang.Override public UpdateAzureOpenAiCredentialDto build() { - return new UpdateAzureOpenAiCredentialDto(region, models, openAiKey, openAiEndpoint, additionalProperties); + return new UpdateAzureOpenAiCredentialDto( + region, models, openAiKey, openAiEndpoint, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoModelsItem.java b/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoModelsItem.java index 2247d8a..8f60d05 100644 --- a/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoModelsItem.java +++ b/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoModelsItem.java @@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum UpdateAzureOpenAiCredentialDtoModelsItem { + GPT_4_O_20240806("gpt-4o-2024-08-06"), + GPT_4_O_MINI_20240718("gpt-4o-mini-2024-07-18"), GPT_4_O_20240513("gpt-4o-2024-05-13"), diff --git a/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoRegion.java b/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoRegion.java index 39f5f11..7906c90 100644 --- a/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoRegion.java +++ b/src/main/java/com/vapi/api/types/UpdateAzureOpenAiCredentialDtoRegion.java @@ -20,6 +20,8 @@ public enum UpdateAzureOpenAiCredentialDtoRegion { JAPAN("japan"), + UAENORTH("uaenorth"), + NORTHCENTRALUS("northcentralus"), NORWAY("norway"), diff --git a/src/main/java/com/vapi/api/types/UpdateByoSipTrunkCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateByoSipTrunkCredentialDto.java index 6bce23c..31717a7 100644 --- a/src/main/java/com/vapi/api/types/UpdateByoSipTrunkCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateByoSipTrunkCredentialDto.java @@ -26,30 +26,38 @@ public final class UpdateByoSipTrunkCredentialDto { private final List gateways; - private final Optional name; - private final Optional outboundAuthenticationPlan; private final Optional outboundLeadingPlusEnabled; + private final Optional techPrefix; + + private final Optional sipDiversionHeader; + private final Optional sbcConfiguration; + private final Optional name; + private final Map additionalProperties; private UpdateByoSipTrunkCredentialDto( Optional provider, List gateways, - Optional name, Optional outboundAuthenticationPlan, Optional outboundLeadingPlusEnabled, + Optional techPrefix, + Optional sipDiversionHeader, Optional sbcConfiguration, + Optional name, Map additionalProperties) { this.provider = provider; this.gateways = gateways; - this.name = name; this.outboundAuthenticationPlan = outboundAuthenticationPlan; this.outboundLeadingPlusEnabled = outboundLeadingPlusEnabled; + this.techPrefix = techPrefix; + this.sipDiversionHeader = sipDiversionHeader; this.sbcConfiguration = sbcConfiguration; + this.name = name; this.additionalProperties = additionalProperties; } @@ -69,14 +77,6 @@ public List getGateways() { return gateways; } - /** - * @return This is the name of the SIP trunk. This is just for your reference. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - /** * @return This can be used to configure the outbound authentication if required by the SIP trunk. */ @@ -98,6 +98,22 @@ public Optional getOutboundLeadingPlusEnabled() { return outboundLeadingPlusEnabled; } + /** + * @return This can be used to configure the tech prefix on outbound calls. This is an advanced property. + */ + @JsonProperty("techPrefix") + public Optional getTechPrefix() { + return techPrefix; + } + + /** + * @return This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property. + */ + @JsonProperty("sipDiversionHeader") + public Optional getSipDiversionHeader() { + return sipDiversionHeader; + } + /** * @return This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's gateways, rather than the managed SBC provided by Vapi. */ @@ -106,6 +122,14 @@ public Optional getSbcConfiguration() { return sbcConfiguration; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -120,10 +144,12 @@ public Map getAdditionalProperties() { private boolean equalTo(UpdateByoSipTrunkCredentialDto other) { return provider.equals(other.provider) && gateways.equals(other.gateways) - && name.equals(other.name) && outboundAuthenticationPlan.equals(other.outboundAuthenticationPlan) && outboundLeadingPlusEnabled.equals(other.outboundLeadingPlusEnabled) - && sbcConfiguration.equals(other.sbcConfiguration); + && techPrefix.equals(other.techPrefix) + && sipDiversionHeader.equals(other.sipDiversionHeader) + && sbcConfiguration.equals(other.sbcConfiguration) + && name.equals(other.name); } @java.lang.Override @@ -131,10 +157,12 @@ public int hashCode() { return Objects.hash( this.provider, this.gateways, - this.name, this.outboundAuthenticationPlan, this.outboundLeadingPlusEnabled, - this.sbcConfiguration); + this.techPrefix, + this.sipDiversionHeader, + this.sbcConfiguration, + this.name); } @java.lang.Override @@ -152,14 +180,18 @@ public static final class Builder { private List gateways = new ArrayList<>(); - private Optional name = Optional.empty(); - private Optional outboundAuthenticationPlan = Optional.empty(); private Optional outboundLeadingPlusEnabled = Optional.empty(); + private Optional techPrefix = Optional.empty(); + + private Optional sipDiversionHeader = Optional.empty(); + private Optional sbcConfiguration = Optional.empty(); + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -168,10 +200,12 @@ private Builder() {} public Builder from(UpdateByoSipTrunkCredentialDto other) { provider(other.getProvider()); gateways(other.getGateways()); - name(other.getName()); outboundAuthenticationPlan(other.getOutboundAuthenticationPlan()); outboundLeadingPlusEnabled(other.getOutboundLeadingPlusEnabled()); + techPrefix(other.getTechPrefix()); + sipDiversionHeader(other.getSipDiversionHeader()); sbcConfiguration(other.getSbcConfiguration()); + name(other.getName()); return this; } @@ -203,17 +237,6 @@ public Builder addAllGateways(List gateways) { return this; } - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - @JsonSetter(value = "outboundAuthenticationPlan", nulls = Nulls.SKIP) public Builder outboundAuthenticationPlan( Optional outboundAuthenticationPlan) { @@ -237,6 +260,28 @@ public Builder outboundLeadingPlusEnabled(Boolean outboundLeadingPlusEnabled) { return this; } + @JsonSetter(value = "techPrefix", nulls = Nulls.SKIP) + public Builder techPrefix(Optional techPrefix) { + this.techPrefix = techPrefix; + return this; + } + + public Builder techPrefix(String techPrefix) { + this.techPrefix = Optional.ofNullable(techPrefix); + return this; + } + + @JsonSetter(value = "sipDiversionHeader", nulls = Nulls.SKIP) + public Builder sipDiversionHeader(Optional sipDiversionHeader) { + this.sipDiversionHeader = sipDiversionHeader; + return this; + } + + public Builder sipDiversionHeader(String sipDiversionHeader) { + this.sipDiversionHeader = Optional.ofNullable(sipDiversionHeader); + return this; + } + @JsonSetter(value = "sbcConfiguration", nulls = Nulls.SKIP) public Builder sbcConfiguration(Optional sbcConfiguration) { this.sbcConfiguration = sbcConfiguration; @@ -248,14 +293,27 @@ public Builder sbcConfiguration(SbcConfiguration sbcConfiguration) { return this; } + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + public UpdateByoSipTrunkCredentialDto build() { return new UpdateByoSipTrunkCredentialDto( provider, gateways, - name, outboundAuthenticationPlan, outboundLeadingPlusEnabled, + techPrefix, + sipDiversionHeader, sbcConfiguration, + name, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/UpdateCartesiaCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateCartesiaCredentialDto.java index ca037ba..138a22d 100644 --- a/src/main/java/com/vapi/api/types/UpdateCartesiaCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateCartesiaCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateCartesiaCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateCartesiaCredentialDto(String apiKey, Map additionalProperties) { + private UpdateCartesiaCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateCartesiaCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateCartesiaCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateCartesiaCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateCartesiaCredentialDto build() { - return new UpdateCartesiaCredentialDto(apiKey, additionalProperties); + return new UpdateCartesiaCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateCustomLlmCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateCustomLlmCredentialDto.java index 53f795b..7029326 100644 --- a/src/main/java/com/vapi/api/types/UpdateCustomLlmCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateCustomLlmCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,20 @@ public final class UpdateCustomLlmCredentialDto { private final String apiKey; + private final Optional authenticationPlan; + + private final Optional name; + private final Map additionalProperties; - private UpdateCustomLlmCredentialDto(String apiKey, Map additionalProperties) { + private UpdateCustomLlmCredentialDto( + String apiKey, + Optional authenticationPlan, + Optional name, + Map additionalProperties) { this.apiKey = apiKey; + this.authenticationPlan = authenticationPlan; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +53,22 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey + */ + @JsonProperty("authenticationPlan") + public Optional getAuthenticationPlan() { + return authenticationPlan; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +81,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateCustomLlmCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) + && authenticationPlan.equals(other.authenticationPlan) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.authenticationPlan, this.name); } @java.lang.Override @@ -78,12 +108,24 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateCustomLlmCredentialDto build(); + + _FinalStage authenticationPlan(Optional authenticationPlan); + + _FinalStage authenticationPlan(OAuth2AuthenticationPlan authenticationPlan); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + + private Optional authenticationPlan = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +134,8 @@ private Builder() {} @java.lang.Override public Builder from(UpdateCustomLlmCredentialDto other) { apiKey(other.getApiKey()); + authenticationPlan(other.getAuthenticationPlan()); + name(other.getName()); return this; } @@ -106,9 +150,43 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

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

        This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage authenticationPlan(OAuth2AuthenticationPlan authenticationPlan) { + this.authenticationPlan = Optional.ofNullable(authenticationPlan); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authenticationPlan", nulls = Nulls.SKIP) + public _FinalStage authenticationPlan(Optional authenticationPlan) { + this.authenticationPlan = authenticationPlan; + return this; + } + @java.lang.Override public UpdateCustomLlmCredentialDto build() { - return new UpdateCustomLlmCredentialDto(apiKey, additionalProperties); + return new UpdateCustomLlmCredentialDto(apiKey, authenticationPlan, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateDeepInfraCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateDeepInfraCredentialDto.java index e74c125..49c27da 100644 --- a/src/main/java/com/vapi/api/types/UpdateDeepInfraCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateDeepInfraCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateDeepInfraCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateDeepInfraCredentialDto(String apiKey, Map additionalProperties) { + private UpdateDeepInfraCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateDeepInfraCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateDeepInfraCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateDeepInfraCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateDeepInfraCredentialDto build() { - return new UpdateDeepInfraCredentialDto(apiKey, additionalProperties); + return new UpdateDeepInfraCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateDeepgramCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateDeepgramCredentialDto.java index e453302..52ff2cc 100644 --- a/src/main/java/com/vapi/api/types/UpdateDeepgramCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateDeepgramCredentialDto.java @@ -25,12 +25,15 @@ public final class UpdateDeepgramCredentialDto { private final Optional apiUrl; + private final Optional name; + private final Map additionalProperties; private UpdateDeepgramCredentialDto( - String apiKey, Optional apiUrl, Map additionalProperties) { + String apiKey, Optional apiUrl, Optional name, Map additionalProperties) { this.apiKey = apiKey; this.apiUrl = apiUrl; + this.name = name; this.additionalProperties = additionalProperties; } @@ -55,6 +58,14 @@ public Optional getApiUrl() { return apiUrl; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -67,12 +78,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateDeepgramCredentialDto other) { - return apiKey.equals(other.apiKey) && apiUrl.equals(other.apiUrl); + return apiKey.equals(other.apiKey) && apiUrl.equals(other.apiUrl) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.apiUrl); + return Objects.hash(this.apiKey, this.apiUrl, this.name); } @java.lang.Override @@ -96,12 +107,18 @@ public interface _FinalStage { _FinalStage apiUrl(Optional apiUrl); _FinalStage apiUrl(String apiUrl); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + private Optional apiUrl = Optional.empty(); @JsonAnySetter @@ -113,6 +130,7 @@ private Builder() {} public Builder from(UpdateDeepgramCredentialDto other) { apiKey(other.getApiKey()); apiUrl(other.getApiUrl()); + name(other.getName()); return this; } @@ -127,6 +145,23 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

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

        This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -146,7 +181,7 @@ public _FinalStage apiUrl(Optional apiUrl) { @java.lang.Override public UpdateDeepgramCredentialDto build() { - return new UpdateDeepgramCredentialDto(apiKey, apiUrl, additionalProperties); + return new UpdateDeepgramCredentialDto(apiKey, apiUrl, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateElevenLabsCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateElevenLabsCredentialDto.java index dc2d2f7..23e9b87 100644 --- a/src/main/java/com/vapi/api/types/UpdateElevenLabsCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateElevenLabsCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateElevenLabsCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateElevenLabsCredentialDto(String apiKey, Map additionalProperties) { + private UpdateElevenLabsCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateElevenLabsCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateElevenLabsCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateElevenLabsCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateElevenLabsCredentialDto build() { - return new UpdateElevenLabsCredentialDto(apiKey, additionalProperties); + return new UpdateElevenLabsCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateGcpCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateGcpCredentialDto.java index 9398505..e07fdaa 100644 --- a/src/main/java/com/vapi/api/types/UpdateGcpCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateGcpCredentialDto.java @@ -21,22 +21,22 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = UpdateGcpCredentialDto.Builder.class) public final class UpdateGcpCredentialDto { - private final Optional name; - private final GcpKey gcpKey; private final Optional bucketPlan; + private final Optional name; + private final Map additionalProperties; private UpdateGcpCredentialDto( - Optional name, GcpKey gcpKey, Optional bucketPlan, + Optional name, Map additionalProperties) { - this.name = name; this.gcpKey = gcpKey; this.bucketPlan = bucketPlan; + this.name = name; this.additionalProperties = additionalProperties; } @@ -45,14 +45,6 @@ public String getProvider() { return "gcp"; } - /** - * @return This is the name of the GCP credential. This is just for your reference. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - /** * @return This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details/<service-account-id>/keys. *

        The schema is identical to the JSON that GCP outputs.

        @@ -70,6 +62,14 @@ public Optional getBucketPlan() { return bucketPlan; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -82,12 +82,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateGcpCredentialDto other) { - return name.equals(other.name) && gcpKey.equals(other.gcpKey) && bucketPlan.equals(other.bucketPlan); + return gcpKey.equals(other.gcpKey) && bucketPlan.equals(other.bucketPlan) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.gcpKey, this.bucketPlan); + return Objects.hash(this.gcpKey, this.bucketPlan, this.name); } @java.lang.Override @@ -108,23 +108,23 @@ public interface GcpKeyStage { public interface _FinalStage { UpdateGcpCredentialDto build(); - _FinalStage name(Optional name); - - _FinalStage name(String name); - _FinalStage bucketPlan(Optional bucketPlan); _FinalStage bucketPlan(BucketPlan bucketPlan); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements GcpKeyStage, _FinalStage { private GcpKey gcpKey; - private Optional bucketPlan = Optional.empty(); - private Optional name = Optional.empty(); + private Optional bucketPlan = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -132,9 +132,9 @@ private Builder() {} @java.lang.Override public Builder from(UpdateGcpCredentialDto other) { - name(other.getName()); gcpKey(other.getGcpKey()); bucketPlan(other.getBucketPlan()); + name(other.getName()); return this; } @@ -151,42 +151,42 @@ public _FinalStage gcpKey(@NotNull GcpKey gcpKey) { } /** - *

        This is the bucket plan that can be provided to store call artifacts in GCP.

        + *

        This is the name of credential. This is just for your reference.

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

        This is the name of the GCP credential. This is just for your reference.

        + *

        This is the bucket plan that can be provided to store call artifacts in GCP.

        * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage name(String name) { - this.name = Optional.ofNullable(name); + public _FinalStage bucketPlan(BucketPlan bucketPlan) { + this.bucketPlan = Optional.ofNullable(bucketPlan); return this; } @java.lang.Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; + @JsonSetter(value = "bucketPlan", nulls = Nulls.SKIP) + public _FinalStage bucketPlan(Optional bucketPlan) { + this.bucketPlan = bucketPlan; return this; } @java.lang.Override public UpdateGcpCredentialDto build() { - return new UpdateGcpCredentialDto(name, gcpKey, bucketPlan, additionalProperties); + return new UpdateGcpCredentialDto(gcpKey, bucketPlan, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateGladiaCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateGladiaCredentialDto.java index dbc1c35..0aa318b 100644 --- a/src/main/java/com/vapi/api/types/UpdateGladiaCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateGladiaCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class UpdateGladiaCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateGladiaCredentialDto(String apiKey, Map additionalProperties) { + private UpdateGladiaCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateGladiaCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateGladiaCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateGladiaCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateGladiaCredentialDto build() { - return new UpdateGladiaCredentialDto(apiKey, additionalProperties); + return new UpdateGladiaCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateGoHighLevelCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateGoHighLevelCredentialDto.java index 0d9fa3e..7ad2e48 100644 --- a/src/main/java/com/vapi/api/types/UpdateGoHighLevelCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateGoHighLevelCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateGoHighLevelCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateGoHighLevelCredentialDto(String apiKey, Map additionalProperties) { + private UpdateGoHighLevelCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateGoHighLevelCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateGoHighLevelCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateGoHighLevelCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateGoHighLevelCredentialDto build() { - return new UpdateGoHighLevelCredentialDto(apiKey, additionalProperties); + return new UpdateGoHighLevelCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateGoogleCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateGoogleCredentialDto.java new file mode 100644 index 0000000..56cdc2c --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateGoogleCredentialDto.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGoogleCredentialDto.Builder.class) +public final class UpdateGoogleCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateGoogleCredentialDto(String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey + */ + @JsonProperty("provider") + public String getProvider() { + return "google"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGoogleCredentialDto && equalTo((UpdateGoogleCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGoogleCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(UpdateGoogleCredentialDto other); + } + + public interface _FinalStage { + UpdateGoogleCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateGoogleCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public UpdateGoogleCredentialDto build() { + return new UpdateGoogleCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateGroqCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateGroqCredentialDto.java index 172395b..a2f2e67 100644 --- a/src/main/java/com/vapi/api/types/UpdateGroqCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateGroqCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class UpdateGroqCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateGroqCredentialDto(String apiKey, Map additionalProperties) { + private UpdateGroqCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateGroqCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateGroqCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateGroqCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateGroqCredentialDto build() { - return new UpdateGroqCredentialDto(apiKey, additionalProperties); + return new UpdateGroqCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateInflectionAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateInflectionAiCredentialDto.java new file mode 100644 index 0000000..a6aca22 --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateInflectionAiCredentialDto.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateInflectionAiCredentialDto.Builder.class) +public final class UpdateInflectionAiCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateInflectionAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup + */ + @JsonProperty("provider") + public String getProvider() { + return "inflection-ai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateInflectionAiCredentialDto && equalTo((UpdateInflectionAiCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateInflectionAiCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(UpdateInflectionAiCredentialDto other); + } + + public interface _FinalStage { + UpdateInflectionAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateInflectionAiCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public UpdateInflectionAiCredentialDto build() { + return new UpdateInflectionAiCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateLangfuseCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateLangfuseCredentialDto.java new file mode 100644 index 0000000..8976ed8 --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateLangfuseCredentialDto.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateLangfuseCredentialDto.Builder.class) +public final class UpdateLangfuseCredentialDto { + private final String publicKey; + + private final String apiKey; + + private final String apiUrl; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateLangfuseCredentialDto( + String publicKey, + String apiKey, + String apiUrl, + Optional name, + Map additionalProperties) { + this.publicKey = publicKey; + this.apiKey = apiKey; + this.apiUrl = apiUrl; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "langfuse"; + } + + /** + * @return The public key for Langfuse project. Eg: pk-lf-... + */ + @JsonProperty("publicKey") + public String getPublicKey() { + return publicKey; + } + + /** + * @return The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return The host URL for Langfuse project. Eg: https://cloud.langfuse.com + */ + @JsonProperty("apiUrl") + public String getApiUrl() { + return apiUrl; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateLangfuseCredentialDto && equalTo((UpdateLangfuseCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateLangfuseCredentialDto other) { + return publicKey.equals(other.publicKey) + && apiKey.equals(other.apiKey) + && apiUrl.equals(other.apiUrl) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.publicKey, this.apiKey, this.apiUrl, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PublicKeyStage builder() { + return new Builder(); + } + + public interface PublicKeyStage { + ApiKeyStage publicKey(@NotNull String publicKey); + + Builder from(UpdateLangfuseCredentialDto other); + } + + public interface ApiKeyStage { + ApiUrlStage apiKey(@NotNull String apiKey); + } + + public interface ApiUrlStage { + _FinalStage apiUrl(@NotNull String apiUrl); + } + + public interface _FinalStage { + UpdateLangfuseCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PublicKeyStage, ApiKeyStage, ApiUrlStage, _FinalStage { + private String publicKey; + + private String apiKey; + + private String apiUrl; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateLangfuseCredentialDto other) { + publicKey(other.getPublicKey()); + apiKey(other.getApiKey()); + apiUrl(other.getApiUrl()); + name(other.getName()); + return this; + } + + /** + *

        The public key for Langfuse project. Eg: pk-lf-...

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

        The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API.

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

        The host URL for Langfuse project. Eg: https://cloud.langfuse.com

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public UpdateLangfuseCredentialDto build() { + return new UpdateLangfuseCredentialDto(publicKey, apiKey, apiUrl, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateLmntCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateLmntCredentialDto.java index 68d10ba..775592a 100644 --- a/src/main/java/com/vapi/api/types/UpdateLmntCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateLmntCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class UpdateLmntCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateLmntCredentialDto(String apiKey, Map additionalProperties) { + private UpdateLmntCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateLmntCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateLmntCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateLmntCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateLmntCredentialDto build() { - return new UpdateLmntCredentialDto(apiKey, additionalProperties); + return new UpdateLmntCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateMakeCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateMakeCredentialDto.java index 5d36251..801537d 100644 --- a/src/main/java/com/vapi/api/types/UpdateMakeCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateMakeCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -25,13 +27,20 @@ public final class UpdateMakeCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; private UpdateMakeCredentialDto( - String teamId, String region, String apiKey, Map additionalProperties) { + String teamId, + String region, + String apiKey, + Optional name, + Map additionalProperties) { this.teamId = teamId; this.region = region; this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -64,6 +73,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -76,12 +93,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateMakeCredentialDto other) { - return teamId.equals(other.teamId) && region.equals(other.region) && apiKey.equals(other.apiKey); + return teamId.equals(other.teamId) + && region.equals(other.region) + && apiKey.equals(other.apiKey) + && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.teamId, this.region, this.apiKey); + return Objects.hash(this.teamId, this.region, this.apiKey, this.name); } @java.lang.Override @@ -109,6 +129,10 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateMakeCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -119,6 +143,8 @@ public static final class Builder implements TeamIdStage, RegionStage, ApiKeySta private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -129,6 +155,7 @@ public Builder from(UpdateMakeCredentialDto other) { teamId(other.getTeamId()); region(other.getRegion()); apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -165,9 +192,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateMakeCredentialDto build() { - return new UpdateMakeCredentialDto(teamId, region, apiKey, additionalProperties); + return new UpdateMakeCredentialDto(teamId, region, apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateOpenAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateOpenAiCredentialDto.java index 373073a..8f6abb9 100644 --- a/src/main/java/com/vapi/api/types/UpdateOpenAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateOpenAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class UpdateOpenAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateOpenAiCredentialDto(String apiKey, Map additionalProperties) { + private UpdateOpenAiCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateOpenAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateOpenAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateOpenAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateOpenAiCredentialDto build() { - return new UpdateOpenAiCredentialDto(apiKey, additionalProperties); + return new UpdateOpenAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateOpenRouterCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateOpenRouterCredentialDto.java index 8df486f..a8471da 100644 --- a/src/main/java/com/vapi/api/types/UpdateOpenRouterCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateOpenRouterCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateOpenRouterCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateOpenRouterCredentialDto(String apiKey, Map additionalProperties) { + private UpdateOpenRouterCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateOpenRouterCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateOpenRouterCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateOpenRouterCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateOpenRouterCredentialDto build() { - return new UpdateOpenRouterCredentialDto(apiKey, additionalProperties); + return new UpdateOpenRouterCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateOrgDto.java b/src/main/java/com/vapi/api/types/UpdateOrgDto.java index 0e17d5f..e096a9f 100644 --- a/src/main/java/com/vapi/api/types/UpdateOrgDto.java +++ b/src/main/java/com/vapi/api/types/UpdateOrgDto.java @@ -22,8 +22,12 @@ public final class UpdateOrgDto { private final Optional hipaaEnabled; + private final Optional subscriptionId; + private final Optional name; + private final Optional channel; + private final Optional billingLimit; private final Optional serverUrl; @@ -36,14 +40,18 @@ public final class UpdateOrgDto { private UpdateOrgDto( Optional hipaaEnabled, + Optional subscriptionId, Optional name, + Optional channel, Optional billingLimit, Optional serverUrl, Optional serverUrlSecret, Optional concurrencyLimit, Map additionalProperties) { this.hipaaEnabled = hipaaEnabled; + this.subscriptionId = subscriptionId; this.name = name; + this.channel = channel; this.billingLimit = billingLimit; this.serverUrl = serverUrl; this.serverUrlSecret = serverUrlSecret; @@ -61,6 +69,14 @@ public Optional getHipaaEnabled() { return hipaaEnabled; } + /** + * @return This is the ID of the subscription the org belongs to. + */ + @JsonProperty("subscriptionId") + public Optional getSubscriptionId() { + return subscriptionId; + } + /** * @return This is the name of the org. This is just for your own reference. */ @@ -69,6 +85,14 @@ public Optional getName() { return name; } + /** + * @return This is the channel of the org. There is the cluster the API traffic for the org will be directed. + */ + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + /** * @return This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. */ @@ -115,7 +139,9 @@ public Map getAdditionalProperties() { private boolean equalTo(UpdateOrgDto other) { return hipaaEnabled.equals(other.hipaaEnabled) + && subscriptionId.equals(other.subscriptionId) && name.equals(other.name) + && channel.equals(other.channel) && billingLimit.equals(other.billingLimit) && serverUrl.equals(other.serverUrl) && serverUrlSecret.equals(other.serverUrlSecret) @@ -126,7 +152,9 @@ private boolean equalTo(UpdateOrgDto other) { public int hashCode() { return Objects.hash( this.hipaaEnabled, + this.subscriptionId, this.name, + this.channel, this.billingLimit, this.serverUrl, this.serverUrlSecret, @@ -146,8 +174,12 @@ public static Builder builder() { public static final class Builder { private Optional hipaaEnabled = Optional.empty(); + private Optional subscriptionId = Optional.empty(); + private Optional name = Optional.empty(); + private Optional channel = Optional.empty(); + private Optional billingLimit = Optional.empty(); private Optional serverUrl = Optional.empty(); @@ -163,7 +195,9 @@ private Builder() {} public Builder from(UpdateOrgDto other) { hipaaEnabled(other.getHipaaEnabled()); + subscriptionId(other.getSubscriptionId()); name(other.getName()); + channel(other.getChannel()); billingLimit(other.getBillingLimit()); serverUrl(other.getServerUrl()); serverUrlSecret(other.getServerUrlSecret()); @@ -182,6 +216,17 @@ public Builder hipaaEnabled(Boolean hipaaEnabled) { return this; } + @JsonSetter(value = "subscriptionId", nulls = Nulls.SKIP) + public Builder subscriptionId(Optional subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = Optional.ofNullable(subscriptionId); + return this; + } + @JsonSetter(value = "name", nulls = Nulls.SKIP) public Builder name(Optional name) { this.name = name; @@ -193,6 +238,17 @@ public Builder name(String name) { return this; } + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public Builder channel(Optional channel) { + this.channel = channel; + return this; + } + + public Builder channel(UpdateOrgDtoChannel channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + @JsonSetter(value = "billingLimit", nulls = Nulls.SKIP) public Builder billingLimit(Optional billingLimit) { this.billingLimit = billingLimit; @@ -240,7 +296,9 @@ public Builder concurrencyLimit(Double concurrencyLimit) { public UpdateOrgDto build() { return new UpdateOrgDto( hipaaEnabled, + subscriptionId, name, + channel, billingLimit, serverUrl, serverUrlSecret, diff --git a/src/main/java/com/vapi/api/types/UpdateOrgDtoChannel.java b/src/main/java/com/vapi/api/types/UpdateOrgDtoChannel.java new file mode 100644 index 0000000..796f7bb --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateOrgDtoChannel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UpdateOrgDtoChannel { + DEFAULT("default"), + + WEEKLY("weekly"); + + private final String value; + + UpdateOrgDtoChannel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/UpdatePerplexityAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdatePerplexityAiCredentialDto.java index af76d3a..bfe47ce 100644 --- a/src/main/java/com/vapi/api/types/UpdatePerplexityAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdatePerplexityAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdatePerplexityAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdatePerplexityAiCredentialDto(String apiKey, Map additionalProperties) { + private UpdatePerplexityAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdatePerplexityAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdatePerplexityAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdatePerplexityAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdatePerplexityAiCredentialDto build() { - return new UpdatePerplexityAiCredentialDto(apiKey, additionalProperties); + return new UpdatePerplexityAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdatePlayHtCredentialDto.java b/src/main/java/com/vapi/api/types/UpdatePlayHtCredentialDto.java index fb2d2fb..f9f90cb 100644 --- a/src/main/java/com/vapi/api/types/UpdatePlayHtCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdatePlayHtCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,15 @@ public final class UpdatePlayHtCredentialDto { private final String userId; + private final Optional name; + private final Map additionalProperties; - private UpdatePlayHtCredentialDto(String apiKey, String userId, Map additionalProperties) { + private UpdatePlayHtCredentialDto( + String apiKey, String userId, Optional name, Map additionalProperties) { this.apiKey = apiKey; this.userId = userId; + this.name = name; this.additionalProperties = additionalProperties; } @@ -49,6 +55,14 @@ public String getUserId() { return userId; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -61,12 +75,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdatePlayHtCredentialDto other) { - return apiKey.equals(other.apiKey) && userId.equals(other.userId); + return apiKey.equals(other.apiKey) && userId.equals(other.userId) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey, this.userId); + return Objects.hash(this.apiKey, this.userId, this.name); } @java.lang.Override @@ -90,6 +104,10 @@ public interface UserIdStage { public interface _FinalStage { UpdatePlayHtCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -98,6 +116,8 @@ public static final class Builder implements ApiKeyStage, UserIdStage, _FinalSta private String userId; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -107,6 +127,7 @@ private Builder() {} public Builder from(UpdatePlayHtCredentialDto other) { apiKey(other.getApiKey()); userId(other.getUserId()); + name(other.getName()); return this; } @@ -128,9 +149,26 @@ public _FinalStage userId(@NotNull String userId) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdatePlayHtCredentialDto build() { - return new UpdatePlayHtCredentialDto(apiKey, userId, additionalProperties); + return new UpdatePlayHtCredentialDto(apiKey, userId, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateRimeAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateRimeAiCredentialDto.java index cd4b698..36db3a6 100644 --- a/src/main/java/com/vapi/api/types/UpdateRimeAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateRimeAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class UpdateRimeAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateRimeAiCredentialDto(String apiKey, Map additionalProperties) { + private UpdateRimeAiCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateRimeAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateRimeAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateRimeAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateRimeAiCredentialDto build() { - return new UpdateRimeAiCredentialDto(apiKey, additionalProperties); + return new UpdateRimeAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateRunpodCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateRunpodCredentialDto.java index 2f0c2f7..44127c2 100644 --- a/src/main/java/com/vapi/api/types/UpdateRunpodCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateRunpodCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,13 @@ public final class UpdateRunpodCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateRunpodCredentialDto(String apiKey, Map additionalProperties) { + private UpdateRunpodCredentialDto(String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +46,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +66,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateRunpodCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +91,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateRunpodCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +111,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateRunpodCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +126,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateRunpodCredentialDto build() { - return new UpdateRunpodCredentialDto(apiKey, additionalProperties); + return new UpdateRunpodCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateS3CredentialDto.java b/src/main/java/com/vapi/api/types/UpdateS3CredentialDto.java index 1f94dc9..4d4e50b 100644 --- a/src/main/java/com/vapi/api/types/UpdateS3CredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateS3CredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -29,6 +31,8 @@ public final class UpdateS3CredentialDto { private final String s3PathPrefix; + private final Optional name; + private final Map additionalProperties; private UpdateS3CredentialDto( @@ -37,12 +41,14 @@ private UpdateS3CredentialDto( String region, String s3BucketName, String s3PathPrefix, + Optional name, Map additionalProperties) { this.awsAccessKeyId = awsAccessKeyId; this.awsSecretAccessKey = awsSecretAccessKey; this.region = region; this.s3BucketName = s3BucketName; this.s3PathPrefix = s3PathPrefix; + this.name = name; this.additionalProperties = additionalProperties; } @@ -94,6 +100,14 @@ public String getS3PathPrefix() { return s3PathPrefix; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -110,13 +124,19 @@ private boolean equalTo(UpdateS3CredentialDto other) { && awsSecretAccessKey.equals(other.awsSecretAccessKey) && region.equals(other.region) && s3BucketName.equals(other.s3BucketName) - && s3PathPrefix.equals(other.s3PathPrefix); + && s3PathPrefix.equals(other.s3PathPrefix) + && name.equals(other.name); } @java.lang.Override public int hashCode() { return Objects.hash( - this.awsAccessKeyId, this.awsSecretAccessKey, this.region, this.s3BucketName, this.s3PathPrefix); + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.region, + this.s3BucketName, + this.s3PathPrefix, + this.name); } @java.lang.Override @@ -152,6 +172,10 @@ public interface S3PathPrefixStage { public interface _FinalStage { UpdateS3CredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -172,6 +196,8 @@ public static final class Builder private String s3PathPrefix; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -184,6 +210,7 @@ public Builder from(UpdateS3CredentialDto other) { region(other.getRegion()); s3BucketName(other.getS3BucketName()); s3PathPrefix(other.getS3PathPrefix()); + name(other.getName()); return this; } @@ -242,10 +269,27 @@ public _FinalStage s3PathPrefix(@NotNull String s3PathPrefix) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateS3CredentialDto build() { return new UpdateS3CredentialDto( - awsAccessKeyId, awsSecretAccessKey, region, s3BucketName, s3PathPrefix, additionalProperties); + awsAccessKeyId, awsSecretAccessKey, region, s3BucketName, s3PathPrefix, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateTavusCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateTavusCredentialDto.java new file mode 100644 index 0000000..51da56b --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateTavusCredentialDto.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateTavusCredentialDto.Builder.class) +public final class UpdateTavusCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateTavusCredentialDto(String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "tavus"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateTavusCredentialDto && equalTo((UpdateTavusCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateTavusCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(UpdateTavusCredentialDto other); + } + + public interface _FinalStage { + UpdateTavusCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateTavusCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public UpdateTavusCredentialDto build() { + return new UpdateTavusCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/UpdateTogetherAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateTogetherAiCredentialDto.java index 42e0637..349c27a 100644 --- a/src/main/java/com/vapi/api/types/UpdateTogetherAiCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateTogetherAiCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -21,10 +23,14 @@ public final class UpdateTogetherAiCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateTogetherAiCredentialDto(String apiKey, Map additionalProperties) { + private UpdateTogetherAiCredentialDto( + String apiKey, Optional name, Map additionalProperties) { this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -41,6 +47,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -53,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateTogetherAiCredentialDto other) { - return apiKey.equals(other.apiKey); + return apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiKey); + return Objects.hash(this.apiKey, this.name); } @java.lang.Override @@ -78,12 +92,18 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateTogetherAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ApiKeyStage, _FinalStage { private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +112,7 @@ private Builder() {} @java.lang.Override public Builder from(UpdateTogetherAiCredentialDto other) { apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -106,9 +127,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateTogetherAiCredentialDto build() { - return new UpdateTogetherAiCredentialDto(apiKey, additionalProperties); + return new UpdateTogetherAiCredentialDto(apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateTwilioCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateTwilioCredentialDto.java index e6bbf02..5b5f88a 100644 --- a/src/main/java/com/vapi/api/types/UpdateTwilioCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateTwilioCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,15 @@ public final class UpdateTwilioCredentialDto { private final String accountSid; + private final Optional name; + private final Map additionalProperties; - private UpdateTwilioCredentialDto(String authToken, String accountSid, Map additionalProperties) { + private UpdateTwilioCredentialDto( + String authToken, String accountSid, Optional name, Map additionalProperties) { this.authToken = authToken; this.accountSid = accountSid; + this.name = name; this.additionalProperties = additionalProperties; } @@ -49,6 +55,14 @@ public String getAccountSid() { return accountSid; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -61,12 +75,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateTwilioCredentialDto other) { - return authToken.equals(other.authToken) && accountSid.equals(other.accountSid); + return authToken.equals(other.authToken) && accountSid.equals(other.accountSid) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.authToken, this.accountSid); + return Objects.hash(this.authToken, this.accountSid, this.name); } @java.lang.Override @@ -90,6 +104,10 @@ public interface AccountSidStage { public interface _FinalStage { UpdateTwilioCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -98,6 +116,8 @@ public static final class Builder implements AuthTokenStage, AccountSidStage, _F private String accountSid; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -107,6 +127,7 @@ private Builder() {} public Builder from(UpdateTwilioCredentialDto other) { authToken(other.getAuthToken()); accountSid(other.getAccountSid()); + name(other.getName()); return this; } @@ -128,9 +149,26 @@ public _FinalStage accountSid(@NotNull String accountSid) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateTwilioCredentialDto build() { - return new UpdateTwilioCredentialDto(authToken, accountSid, additionalProperties); + return new UpdateTwilioCredentialDto(authToken, accountSid, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateVonageCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateVonageCredentialDto.java index cdd191b..245945f 100644 --- a/src/main/java/com/vapi/api/types/UpdateVonageCredentialDto.java +++ b/src/main/java/com/vapi/api/types/UpdateVonageCredentialDto.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,15 @@ public final class UpdateVonageCredentialDto { private final String apiKey; + private final Optional name; + private final Map additionalProperties; - private UpdateVonageCredentialDto(String apiSecret, String apiKey, Map additionalProperties) { + private UpdateVonageCredentialDto( + String apiSecret, String apiKey, Optional name, Map additionalProperties) { this.apiSecret = apiSecret; this.apiKey = apiKey; + this.name = name; this.additionalProperties = additionalProperties; } @@ -49,6 +55,14 @@ public String getApiKey() { return apiKey; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -61,12 +75,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateVonageCredentialDto other) { - return apiSecret.equals(other.apiSecret) && apiKey.equals(other.apiKey); + return apiSecret.equals(other.apiSecret) && apiKey.equals(other.apiKey) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.apiSecret, this.apiKey); + return Objects.hash(this.apiSecret, this.apiKey, this.name); } @java.lang.Override @@ -90,6 +104,10 @@ public interface ApiKeyStage { public interface _FinalStage { UpdateVonageCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -98,6 +116,8 @@ public static final class Builder implements ApiSecretStage, ApiKeyStage, _Final private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -107,6 +127,7 @@ private Builder() {} public Builder from(UpdateVonageCredentialDto other) { apiSecret(other.getApiSecret()); apiKey(other.getApiKey()); + name(other.getName()); return this; } @@ -128,9 +149,26 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public UpdateVonageCredentialDto build() { - return new UpdateVonageCredentialDto(apiSecret, apiKey, additionalProperties); + return new UpdateVonageCredentialDto(apiSecret, apiKey, name, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/UpdateXAiCredentialDto.java b/src/main/java/com/vapi/api/types/UpdateXAiCredentialDto.java new file mode 100644 index 0000000..3ce6193 --- /dev/null +++ b/src/main/java/com/vapi/api/types/UpdateXAiCredentialDto.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateXAiCredentialDto.Builder.class) +public final class UpdateXAiCredentialDto { + private final String apiKey; + + private final Optional name; + + private final Map additionalProperties; + + private UpdateXAiCredentialDto(String apiKey, Optional name, Map additionalProperties) { + this.apiKey = apiKey; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai + */ + @JsonProperty("provider") + public String getProvider() { + return "xai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateXAiCredentialDto && equalTo((UpdateXAiCredentialDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateXAiCredentialDto other) { + return apiKey.equals(other.apiKey) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(UpdateXAiCredentialDto other); + } + + public interface _FinalStage { + UpdateXAiCredentialDto build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateXAiCredentialDto other) { + apiKey(other.getApiKey()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public UpdateXAiCredentialDto build() { + return new UpdateXAiCredentialDto(apiKey, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/VapiCost.java b/src/main/java/com/vapi/api/types/VapiCost.java index 365a8e0..6f90112 100644 --- a/src/main/java/com/vapi/api/types/VapiCost.java +++ b/src/main/java/com/vapi/api/types/VapiCost.java @@ -14,22 +14,34 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = VapiCost.Builder.class) public final class VapiCost { + private final VapiCostSubType subType; + private final double minutes; private final double cost; private final Map additionalProperties; - private VapiCost(double minutes, double cost, Map additionalProperties) { + private VapiCost(VapiCostSubType subType, double minutes, double cost, Map additionalProperties) { + this.subType = subType; this.minutes = minutes; this.cost = cost; this.additionalProperties = additionalProperties; } + /** + * @return This is the sub type of the cost. + */ + @JsonProperty("subType") + public VapiCostSubType getSubType() { + return subType; + } + /** * @return This is the minutes of Vapi usage. This should match call.endedAt - call.startedAt. */ @@ -58,12 +70,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(VapiCost other) { - return minutes == other.minutes && cost == other.cost; + return subType.equals(other.subType) && minutes == other.minutes && cost == other.cost; } @java.lang.Override public int hashCode() { - return Objects.hash(this.minutes, this.cost); + return Objects.hash(this.subType, this.minutes, this.cost); } @java.lang.Override @@ -71,16 +83,20 @@ public String toString() { return ObjectMappers.stringify(this); } - public static MinutesStage builder() { + public static SubTypeStage builder() { return new Builder(); } - public interface MinutesStage { - CostStage minutes(double minutes); + public interface SubTypeStage { + MinutesStage subType(@NotNull VapiCostSubType subType); Builder from(VapiCost other); } + public interface MinutesStage { + CostStage minutes(double minutes); + } + public interface CostStage { _FinalStage cost(double cost); } @@ -90,7 +106,9 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MinutesStage, CostStage, _FinalStage { + public static final class Builder implements SubTypeStage, MinutesStage, CostStage, _FinalStage { + private VapiCostSubType subType; + private double minutes; private double cost; @@ -102,11 +120,23 @@ private Builder() {} @java.lang.Override public Builder from(VapiCost other) { + subType(other.getSubType()); minutes(other.getMinutes()); cost(other.getCost()); return this; } + /** + *

        This is the sub type of the cost.

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

        This is the minutes of Vapi usage. This should match call.endedAt - call.startedAt.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -131,7 +161,7 @@ public _FinalStage cost(double cost) { @java.lang.Override public VapiCost build() { - return new VapiCost(minutes, cost, additionalProperties); + return new VapiCost(subType, minutes, cost, additionalProperties); } } } diff --git a/src/main/java/com/vapi/api/types/VapiCostSubType.java b/src/main/java/com/vapi/api/types/VapiCostSubType.java new file mode 100644 index 0000000..a2780f6 --- /dev/null +++ b/src/main/java/com/vapi/api/types/VapiCostSubType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum VapiCostSubType { + NORMAL("normal"), + + OVERAGE("overage"); + + private final String value; + + VapiCostSubType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vapi/api/types/VapiModel.java b/src/main/java/com/vapi/api/types/VapiModel.java index 3b62644..b90feca 100644 --- a/src/main/java/com/vapi/api/types/VapiModel.java +++ b/src/main/java/com/vapi/api/types/VapiModel.java @@ -28,14 +28,16 @@ public final class VapiModel { private final Optional> toolIds; + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + private final Optional> steps; private final String model; private final Optional temperature; - private final Optional knowledgeBase; - private final Optional maxTokens; private final Optional emotionRecognitionEnabled; @@ -48,10 +50,11 @@ private VapiModel( Optional> messages, Optional> tools, Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, Optional> steps, String model, Optional temperature, - Optional knowledgeBase, Optional maxTokens, Optional emotionRecognitionEnabled, Optional numFastTurns, @@ -59,10 +62,11 @@ private VapiModel( this.messages = messages; this.tools = tools; this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; this.steps = steps; this.model = model; this.temperature = temperature; - this.knowledgeBase = knowledgeBase; this.maxTokens = maxTokens; this.emotionRecognitionEnabled = emotionRecognitionEnabled; this.numFastTurns = numFastTurns; @@ -95,6 +99,22 @@ public Optional> getToolIds() { return toolIds; } + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + @JsonProperty("steps") public Optional> getSteps() { return steps; @@ -116,14 +136,6 @@ public Optional getTemperature() { return temperature; } - /** - * @return These are the options for the knowledge base. - */ - @JsonProperty("knowledgeBase") - public Optional getKnowledgeBase() { - return knowledgeBase; - } - /** * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. */ @@ -167,10 +179,11 @@ private boolean equalTo(VapiModel other) { return messages.equals(other.messages) && tools.equals(other.tools) && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) && steps.equals(other.steps) && model.equals(other.model) && temperature.equals(other.temperature) - && knowledgeBase.equals(other.knowledgeBase) && maxTokens.equals(other.maxTokens) && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) && numFastTurns.equals(other.numFastTurns); @@ -182,10 +195,11 @@ public int hashCode() { this.messages, this.tools, this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, this.steps, this.model, this.temperature, - this.knowledgeBase, this.maxTokens, this.emotionRecognitionEnabled, this.numFastTurns); @@ -221,6 +235,14 @@ public interface _FinalStage { _FinalStage toolIds(List toolIds); + _FinalStage knowledgeBase(Optional knowledgeBase); + + _FinalStage knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase); + + _FinalStage knowledgeBaseId(Optional knowledgeBaseId); + + _FinalStage knowledgeBaseId(String knowledgeBaseId); + _FinalStage steps(Optional> steps); _FinalStage steps(List steps); @@ -229,10 +251,6 @@ public interface _FinalStage { _FinalStage temperature(Double temperature); - _FinalStage knowledgeBase(Optional knowledgeBase); - - _FinalStage knowledgeBase(KnowledgeBase knowledgeBase); - _FinalStage maxTokens(Optional maxTokens); _FinalStage maxTokens(Double maxTokens); @@ -256,12 +274,14 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional maxTokens = Optional.empty(); - private Optional knowledgeBase = Optional.empty(); - private Optional temperature = Optional.empty(); private Optional> steps = Optional.empty(); + private Optional knowledgeBaseId = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + private Optional> toolIds = Optional.empty(); private Optional> tools = Optional.empty(); @@ -278,10 +298,11 @@ public Builder from(VapiModel other) { messages(other.getMessages()); tools(other.getTools()); toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); steps(other.getSteps()); model(other.getModel()); temperature(other.getTemperature()); - knowledgeBase(other.getKnowledgeBase()); maxTokens(other.getMaxTokens()); emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); numFastTurns(other.getNumFastTurns()); @@ -354,23 +375,6 @@ public _FinalStage maxTokens(Optional maxTokens) { return this; } - /** - *

        These are the options for the knowledge base.

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

        This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -401,6 +405,40 @@ public _FinalStage steps(Optional> steps) { return this; } + /** + *

        This is the ID of the knowledge base the model will use.

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

        These are the options for the knowledge base.

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

        These are the tools that the assistant can use during the call. To use transient tools, use tools.

        *

        Both tools and toolIds can be used together.

        @@ -460,10 +498,11 @@ public VapiModel build() { messages, tools, toolIds, + knowledgeBase, + knowledgeBaseId, steps, model, temperature, - knowledgeBase, maxTokens, emotionRecognitionEnabled, numFastTurns, diff --git a/src/main/java/com/vapi/api/types/VapiPhoneNumber.java b/src/main/java/com/vapi/api/types/VapiPhoneNumber.java index 096ccdf..fc0f510 100644 --- a/src/main/java/com/vapi/api/types/VapiPhoneNumber.java +++ b/src/main/java/com/vapi/api/types/VapiPhoneNumber.java @@ -44,6 +44,8 @@ public final class VapiPhoneNumber { private final String sipUri; + private final Optional authentication; + private final Map additionalProperties; private VapiPhoneNumber( @@ -58,6 +60,7 @@ private VapiPhoneNumber( Optional serverUrl, Optional serverUrlSecret, String sipUri, + Optional authentication, Map additionalProperties) { this.fallbackDestination = fallbackDestination; this.id = id; @@ -70,6 +73,7 @@ private VapiPhoneNumber( this.serverUrl = serverUrl; this.serverUrlSecret = serverUrlSecret; this.sipUri = sipUri; + this.authentication = authentication; this.additionalProperties = additionalProperties; } @@ -173,6 +177,15 @@ public String getSipUri() { return sipUri; } + /** + * @return This enables authentication for incoming SIP INVITE requests to the sipUri. + *

        If not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.

        + */ + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -195,7 +208,8 @@ private boolean equalTo(VapiPhoneNumber other) { && squadId.equals(other.squadId) && serverUrl.equals(other.serverUrl) && serverUrlSecret.equals(other.serverUrlSecret) - && sipUri.equals(other.sipUri); + && sipUri.equals(other.sipUri) + && authentication.equals(other.authentication); } @java.lang.Override @@ -211,7 +225,8 @@ public int hashCode() { this.squadId, this.serverUrl, this.serverUrlSecret, - this.sipUri); + this.sipUri, + this.authentication); } @java.lang.Override @@ -271,6 +286,10 @@ public interface _FinalStage { _FinalStage serverUrlSecret(Optional serverUrlSecret); _FinalStage serverUrlSecret(String serverUrlSecret); + + _FinalStage authentication(Optional authentication); + + _FinalStage authentication(SipAuthentication authentication); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -286,6 +305,8 @@ public static final class Builder private String sipUri; + private Optional authentication = Optional.empty(); + private Optional serverUrlSecret = Optional.empty(); private Optional serverUrl = Optional.empty(); @@ -316,6 +337,7 @@ public Builder from(VapiPhoneNumber other) { serverUrl(other.getServerUrl()); serverUrlSecret(other.getServerUrlSecret()); sipUri(other.getSipUri()); + authentication(other.getAuthentication()); return this; } @@ -375,6 +397,24 @@ public _FinalStage sipUri(@NotNull String sipUri) { return this; } + /** + *

        This enables authentication for incoming SIP INVITE requests to the sipUri.

        + *

        If not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.

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

        This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret.

        *

        Same precedence logic as serverUrl.

        @@ -502,6 +542,7 @@ public VapiPhoneNumber build() { serverUrl, serverUrlSecret, sipUri, + authentication, additionalProperties); } } diff --git a/src/main/java/com/vapi/api/types/VonageCredential.java b/src/main/java/com/vapi/api/types/VonageCredential.java index 7e487c8..6bbdd4c 100644 --- a/src/main/java/com/vapi/api/types/VonageCredential.java +++ b/src/main/java/com/vapi/api/types/VonageCredential.java @@ -9,12 +9,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.vapi.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -34,6 +36,8 @@ public final class VonageCredential { private final String vonageApplicationId; + private final Optional name; + private final String apiKey; private final Map additionalProperties; @@ -46,6 +50,7 @@ private VonageCredential( OffsetDateTime createdAt, OffsetDateTime updatedAt, String vonageApplicationId, + Optional name, String apiKey, Map additionalProperties) { this.vonageApplicationPrivateKey = vonageApplicationPrivateKey; @@ -55,6 +60,7 @@ private VonageCredential( this.createdAt = createdAt; this.updatedAt = updatedAt; this.vonageApplicationId = vonageApplicationId; + this.name = name; this.apiKey = apiKey; this.additionalProperties = additionalProperties; } @@ -121,6 +127,14 @@ public String getVonageApplicationId() { return vonageApplicationId; } + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + @JsonProperty("apiKey") public String getApiKey() { return apiKey; @@ -145,6 +159,7 @@ private boolean equalTo(VonageCredential other) { && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) && vonageApplicationId.equals(other.vonageApplicationId) + && name.equals(other.name) && apiKey.equals(other.apiKey); } @@ -158,6 +173,7 @@ public int hashCode() { this.createdAt, this.updatedAt, this.vonageApplicationId, + this.name, this.apiKey); } @@ -206,6 +222,10 @@ public interface ApiKeyStage { public interface _FinalStage { VonageCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -235,6 +255,8 @@ public static final class Builder private String apiKey; + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -249,6 +271,7 @@ public Builder from(VonageCredential other) { createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); vonageApplicationId(other.getVonageApplicationId()); + name(other.getName()); apiKey(other.getApiKey()); return this; } @@ -340,6 +363,23 @@ public _FinalStage apiKey(@NotNull String apiKey) { return this; } + /** + *

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public VonageCredential build() { return new VonageCredential( @@ -350,6 +390,7 @@ public VonageCredential build() { createdAt, updatedAt, vonageApplicationId, + name, apiKey, additionalProperties); } diff --git a/src/main/java/com/vapi/api/types/WebhookCredential.java b/src/main/java/com/vapi/api/types/WebhookCredential.java new file mode 100644 index 0000000..e4f5d10 --- /dev/null +++ b/src/main/java/com/vapi/api/types/WebhookCredential.java @@ -0,0 +1,334 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookCredential.Builder.class) +public final class WebhookCredential { + private final OAuth2AuthenticationPlan authenticationPlan; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Oauth2AuthenticationSession authenticationSession; + + private final Optional name; + + private final Map additionalProperties; + + private WebhookCredential( + OAuth2AuthenticationPlan authenticationPlan, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Oauth2AuthenticationSession authenticationSession, + Optional name, + Map additionalProperties) { + this.authenticationPlan = authenticationPlan; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.authenticationSession = authenticationSession; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public String getProvider() { + return "webhook"; + } + + /** + * @return This is the authentication plan. Currently supports OAuth2 RFC 6749. + */ + @JsonProperty("authenticationPlan") + public OAuth2AuthenticationPlan getAuthenticationPlan() { + return authenticationPlan; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the authentication session for the credential. Available for credentials that have an authentication plan. + */ + @JsonProperty("authenticationSession") + public Oauth2AuthenticationSession getAuthenticationSession() { + return authenticationSession; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookCredential && equalTo((WebhookCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookCredential other) { + return authenticationPlan.equals(other.authenticationPlan) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && authenticationSession.equals(other.authenticationSession) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.authenticationPlan, + this.id, + this.orgId, + this.createdAt, + this.updatedAt, + this.authenticationSession, + this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AuthenticationPlanStage builder() { + return new Builder(); + } + + public interface AuthenticationPlanStage { + IdStage authenticationPlan(@NotNull OAuth2AuthenticationPlan authenticationPlan); + + Builder from(WebhookCredential other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + AuthenticationSessionStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface AuthenticationSessionStage { + _FinalStage authenticationSession(@NotNull Oauth2AuthenticationSession authenticationSession); + } + + public interface _FinalStage { + WebhookCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AuthenticationPlanStage, + IdStage, + OrgIdStage, + CreatedAtStage, + UpdatedAtStage, + AuthenticationSessionStage, + _FinalStage { + private OAuth2AuthenticationPlan authenticationPlan; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Oauth2AuthenticationSession authenticationSession; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookCredential other) { + authenticationPlan(other.getAuthenticationPlan()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + authenticationSession(other.getAuthenticationSession()); + name(other.getName()); + return this; + } + + /** + *

        This is the authentication plan. Currently supports OAuth2 RFC 6749.

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

        This is the unique identifier for the credential.

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

        This is the unique identifier for the org that this credential belongs to.

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

        This is the ISO 8601 date-time string of when the credential was created.

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

        This is the ISO 8601 date-time string of when the assistant was last updated.

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

        This is the authentication session for the credential. Available for credentials that have an authentication plan.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public WebhookCredential build() { + return new WebhookCredential( + authenticationPlan, + id, + orgId, + createdAt, + updatedAt, + authenticationSession, + name, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/XAiCredential.java b/src/main/java/com/vapi/api/types/XAiCredential.java new file mode 100644 index 0000000..95021cb --- /dev/null +++ b/src/main/java/com/vapi/api/types/XAiCredential.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = XAiCredential.Builder.class) +public final class XAiCredential { + private final String apiKey; + + private final String id; + + private final String orgId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional name; + + private final Map additionalProperties; + + private XAiCredential( + String apiKey, + String id, + String orgId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional name, + Map additionalProperties) { + this.apiKey = apiKey; + this.id = id; + this.orgId = orgId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai + */ + @JsonProperty("provider") + public String getProvider() { + return "xai"; + } + + /** + * @return This is not returned in the API. + */ + @JsonProperty("apiKey") + public String getApiKey() { + return apiKey; + } + + /** + * @return This is the unique identifier for the credential. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return This is the unique identifier for the org that this credential belongs to. + */ + @JsonProperty("orgId") + public String getOrgId() { + return orgId; + } + + /** + * @return This is the ISO 8601 date-time string of when the credential was created. + */ + @JsonProperty("createdAt") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return This is the ISO 8601 date-time string of when the assistant was last updated. + */ + @JsonProperty("updatedAt") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return This is the name of credential. This is just for your reference. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof XAiCredential && equalTo((XAiCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(XAiCredential other) { + return apiKey.equals(other.apiKey) + && id.equals(other.id) + && orgId.equals(other.orgId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.id, this.orgId, this.createdAt, this.updatedAt, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + IdStage apiKey(@NotNull String apiKey); + + Builder from(XAiCredential other); + } + + public interface IdStage { + OrgIdStage id(@NotNull String id); + } + + public interface OrgIdStage { + CreatedAtStage orgId(@NotNull String orgId); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + XAiCredential build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ApiKeyStage, IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String apiKey; + + private String id; + + private String orgId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(XAiCredential other) { + apiKey(other.getApiKey()); + id(other.getId()); + orgId(other.getOrgId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + name(other.getName()); + return this; + } + + /** + *

        This is not returned in the API.

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

        This is the unique identifier for the credential.

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

        This is the unique identifier for the org that this credential belongs to.

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

        This is the ISO 8601 date-time string of when the credential was created.

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

        This is the ISO 8601 date-time string of when the assistant was last updated.

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

        This is the name of credential. This is just for your reference.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public XAiCredential build() { + return new XAiCredential(apiKey, id, orgId, createdAt, updatedAt, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/XaiModel.java b/src/main/java/com/vapi/api/types/XaiModel.java new file mode 100644 index 0000000..24df3c8 --- /dev/null +++ b/src/main/java/com/vapi/api/types/XaiModel.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vapi.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = XaiModel.Builder.class) +public final class XaiModel { + private final Optional> messages; + + private final Optional> tools; + + private final Optional> toolIds; + + private final Optional knowledgeBase; + + private final Optional knowledgeBaseId; + + private final Optional temperature; + + private final Optional maxTokens; + + private final Optional emotionRecognitionEnabled; + + private final Optional numFastTurns; + + private final Map additionalProperties; + + private XaiModel( + Optional> messages, + Optional> tools, + Optional> toolIds, + Optional knowledgeBase, + Optional knowledgeBaseId, + Optional temperature, + Optional maxTokens, + Optional emotionRecognitionEnabled, + Optional numFastTurns, + Map additionalProperties) { + this.messages = messages; + this.tools = tools; + this.toolIds = toolIds; + this.knowledgeBase = knowledgeBase; + this.knowledgeBaseId = knowledgeBaseId; + this.temperature = temperature; + this.maxTokens = maxTokens; + this.emotionRecognitionEnabled = emotionRecognitionEnabled; + this.numFastTurns = numFastTurns; + this.additionalProperties = additionalProperties; + } + + /** + * @return This is the starting state for the conversation. + */ + @JsonProperty("messages") + public Optional> getMessages() { + return messages; + } + + /** + * @return These are the tools that the assistant can use during the call. To use existing tools, use toolIds. + *

        Both tools and toolIds can be used together.

        + */ + @JsonProperty("tools") + public Optional> getTools() { + return tools; + } + + /** + * @return These are the tools that the assistant can use during the call. To use transient tools, use tools. + *

        Both tools and toolIds can be used together.

        + */ + @JsonProperty("toolIds") + public Optional> getToolIds() { + return toolIds; + } + + /** + * @return These are the options for the knowledge base. + */ + @JsonProperty("knowledgeBase") + public Optional getKnowledgeBase() { + return knowledgeBase; + } + + /** + * @return This is the ID of the knowledge base the model will use. + */ + @JsonProperty("knowledgeBaseId") + public Optional getKnowledgeBaseId() { + return knowledgeBaseId; + } + + /** + * @return This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + */ + @JsonProperty("model") + public String getModel() { + return "grok-beta"; + } + + /** + * @return This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + /** + * @return This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + */ + @JsonProperty("maxTokens") + public Optional getMaxTokens() { + return maxTokens; + } + + /** + * @return This determines whether we detect user's emotion while they speak and send it as an additional info to model. + *

        Default false because the model is usually are good at understanding the user's emotion from text.

        + *

        @default false

        + */ + @JsonProperty("emotionRecognitionEnabled") + public Optional getEmotionRecognitionEnabled() { + return emotionRecognitionEnabled; + } + + /** + * @return This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + *

        Default is 0.

        + *

        @default 0

        + */ + @JsonProperty("numFastTurns") + public Optional getNumFastTurns() { + return numFastTurns; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof XaiModel && equalTo((XaiModel) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(XaiModel other) { + return messages.equals(other.messages) + && tools.equals(other.tools) + && toolIds.equals(other.toolIds) + && knowledgeBase.equals(other.knowledgeBase) + && knowledgeBaseId.equals(other.knowledgeBaseId) + && temperature.equals(other.temperature) + && maxTokens.equals(other.maxTokens) + && emotionRecognitionEnabled.equals(other.emotionRecognitionEnabled) + && numFastTurns.equals(other.numFastTurns); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.messages, + this.tools, + this.toolIds, + this.knowledgeBase, + this.knowledgeBaseId, + this.temperature, + this.maxTokens, + this.emotionRecognitionEnabled, + this.numFastTurns); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> messages = Optional.empty(); + + private Optional> tools = Optional.empty(); + + private Optional> toolIds = Optional.empty(); + + private Optional knowledgeBase = Optional.empty(); + + private Optional knowledgeBaseId = Optional.empty(); + + private Optional temperature = Optional.empty(); + + private Optional maxTokens = Optional.empty(); + + private Optional emotionRecognitionEnabled = Optional.empty(); + + private Optional numFastTurns = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(XaiModel other) { + messages(other.getMessages()); + tools(other.getTools()); + toolIds(other.getToolIds()); + knowledgeBase(other.getKnowledgeBase()); + knowledgeBaseId(other.getKnowledgeBaseId()); + temperature(other.getTemperature()); + maxTokens(other.getMaxTokens()); + emotionRecognitionEnabled(other.getEmotionRecognitionEnabled()); + numFastTurns(other.getNumFastTurns()); + return this; + } + + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public Builder messages(Optional> messages) { + this.messages = messages; + return this; + } + + public Builder messages(List messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @JsonSetter(value = "tools", nulls = Nulls.SKIP) + public Builder tools(Optional> tools) { + this.tools = tools; + return this; + } + + public Builder tools(List tools) { + this.tools = Optional.ofNullable(tools); + return this; + } + + @JsonSetter(value = "toolIds", nulls = Nulls.SKIP) + public Builder toolIds(Optional> toolIds) { + this.toolIds = toolIds; + return this; + } + + public Builder toolIds(List toolIds) { + this.toolIds = Optional.ofNullable(toolIds); + return this; + } + + @JsonSetter(value = "knowledgeBase", nulls = Nulls.SKIP) + public Builder knowledgeBase(Optional knowledgeBase) { + this.knowledgeBase = knowledgeBase; + return this; + } + + public Builder knowledgeBase(CreateCustomKnowledgeBaseDto knowledgeBase) { + this.knowledgeBase = Optional.ofNullable(knowledgeBase); + return this; + } + + @JsonSetter(value = "knowledgeBaseId", nulls = Nulls.SKIP) + public Builder knowledgeBaseId(Optional knowledgeBaseId) { + this.knowledgeBaseId = knowledgeBaseId; + return this; + } + + public Builder knowledgeBaseId(String knowledgeBaseId) { + this.knowledgeBaseId = Optional.ofNullable(knowledgeBaseId); + return this; + } + + @JsonSetter(value = "temperature", nulls = Nulls.SKIP) + public Builder temperature(Optional temperature) { + this.temperature = temperature; + return this; + } + + public Builder temperature(Double temperature) { + this.temperature = Optional.ofNullable(temperature); + return this; + } + + @JsonSetter(value = "maxTokens", nulls = Nulls.SKIP) + public Builder maxTokens(Optional maxTokens) { + this.maxTokens = maxTokens; + return this; + } + + public Builder maxTokens(Double maxTokens) { + this.maxTokens = Optional.ofNullable(maxTokens); + return this; + } + + @JsonSetter(value = "emotionRecognitionEnabled", nulls = Nulls.SKIP) + public Builder emotionRecognitionEnabled(Optional emotionRecognitionEnabled) { + this.emotionRecognitionEnabled = emotionRecognitionEnabled; + return this; + } + + public Builder emotionRecognitionEnabled(Boolean emotionRecognitionEnabled) { + this.emotionRecognitionEnabled = Optional.ofNullable(emotionRecognitionEnabled); + return this; + } + + @JsonSetter(value = "numFastTurns", nulls = Nulls.SKIP) + public Builder numFastTurns(Optional numFastTurns) { + this.numFastTurns = numFastTurns; + return this; + } + + public Builder numFastTurns(Double numFastTurns) { + this.numFastTurns = Optional.ofNullable(numFastTurns); + return this; + } + + public XaiModel build() { + return new XaiModel( + messages, + tools, + toolIds, + knowledgeBase, + knowledgeBaseId, + temperature, + maxTokens, + emotionRecognitionEnabled, + numFastTurns, + additionalProperties); + } + } +} diff --git a/src/main/java/com/vapi/api/types/XaiModelToolsItem.java b/src/main/java/com/vapi/api/types/XaiModelToolsItem.java new file mode 100644 index 0000000..78d5cc4 --- /dev/null +++ b/src/main/java/com/vapi/api/types/XaiModelToolsItem.java @@ -0,0 +1,483 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vapi.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class XaiModelToolsItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private XaiModelToolsItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static XaiModelToolsItem dtmf(CreateDtmfToolDto value) { + return new XaiModelToolsItem(new DtmfValue(value)); + } + + public static XaiModelToolsItem endCall(CreateEndCallToolDto value) { + return new XaiModelToolsItem(new EndCallValue(value)); + } + + public static XaiModelToolsItem voicemail(CreateVoicemailToolDto value) { + return new XaiModelToolsItem(new VoicemailValue(value)); + } + + public static XaiModelToolsItem function(CreateFunctionToolDto value) { + return new XaiModelToolsItem(new FunctionValue(value)); + } + + public static XaiModelToolsItem ghl(CreateGhlToolDto value) { + return new XaiModelToolsItem(new GhlValue(value)); + } + + public static XaiModelToolsItem make(CreateMakeToolDto value) { + return new XaiModelToolsItem(new MakeValue(value)); + } + + public static XaiModelToolsItem transferCall(CreateTransferCallToolDto value) { + return new XaiModelToolsItem(new TransferCallValue(value)); + } + + public boolean isDtmf() { + return value instanceof DtmfValue; + } + + public boolean isEndCall() { + return value instanceof EndCallValue; + } + + public boolean isVoicemail() { + return value instanceof VoicemailValue; + } + + public boolean isFunction() { + return value instanceof FunctionValue; + } + + public boolean isGhl() { + return value instanceof GhlValue; + } + + public boolean isMake() { + return value instanceof MakeValue; + } + + public boolean isTransferCall() { + return value instanceof TransferCallValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getDtmf() { + if (isDtmf()) { + return Optional.of(((DtmfValue) value).value); + } + return Optional.empty(); + } + + public Optional getEndCall() { + if (isEndCall()) { + return Optional.of(((EndCallValue) value).value); + } + return Optional.empty(); + } + + public Optional getVoicemail() { + if (isVoicemail()) { + return Optional.of(((VoicemailValue) value).value); + } + return Optional.empty(); + } + + public Optional getFunction() { + if (isFunction()) { + return Optional.of(((FunctionValue) value).value); + } + return Optional.empty(); + } + + public Optional getGhl() { + if (isGhl()) { + return Optional.of(((GhlValue) value).value); + } + return Optional.empty(); + } + + public Optional getMake() { + if (isMake()) { + return Optional.of(((MakeValue) value).value); + } + return Optional.empty(); + } + + public Optional getTransferCall() { + if (isTransferCall()) { + return Optional.of(((TransferCallValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitDtmf(CreateDtmfToolDto dtmf); + + T visitEndCall(CreateEndCallToolDto endCall); + + T visitVoicemail(CreateVoicemailToolDto voicemail); + + T visitFunction(CreateFunctionToolDto function); + + T visitGhl(CreateGhlToolDto ghl); + + T visitMake(CreateMakeToolDto make); + + T visitTransferCall(CreateTransferCallToolDto transferCall); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(DtmfValue.class), + @JsonSubTypes.Type(EndCallValue.class), + @JsonSubTypes.Type(VoicemailValue.class), + @JsonSubTypes.Type(FunctionValue.class), + @JsonSubTypes.Type(GhlValue.class), + @JsonSubTypes.Type(MakeValue.class), + @JsonSubTypes.Type(TransferCallValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("dtmf") + private static final class DtmfValue implements Value { + @JsonUnwrapped + private CreateDtmfToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private DtmfValue() {} + + private DtmfValue(CreateDtmfToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitDtmf(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DtmfValue && equalTo((DtmfValue) other); + } + + private boolean equalTo(DtmfValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("endCall") + private static final class EndCallValue implements Value { + @JsonUnwrapped + private CreateEndCallToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private EndCallValue() {} + + private EndCallValue(CreateEndCallToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitEndCall(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndCallValue && equalTo((EndCallValue) other); + } + + private boolean equalTo(EndCallValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("voicemail") + private static final class VoicemailValue implements Value { + @JsonUnwrapped + private CreateVoicemailToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VoicemailValue() {} + + private VoicemailValue(CreateVoicemailToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVoicemail(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VoicemailValue && equalTo((VoicemailValue) other); + } + + private boolean equalTo(VoicemailValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("function") + private static final class FunctionValue implements Value { + @JsonUnwrapped + private CreateFunctionToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private FunctionValue() {} + + private FunctionValue(CreateFunctionToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitFunction(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FunctionValue && equalTo((FunctionValue) other); + } + + private boolean equalTo(FunctionValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("ghl") + private static final class GhlValue implements Value { + @JsonUnwrapped + private CreateGhlToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GhlValue() {} + + private GhlValue(CreateGhlToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGhl(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GhlValue && equalTo((GhlValue) other); + } + + private boolean equalTo(GhlValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("make") + private static final class MakeValue implements Value { + @JsonUnwrapped + private CreateMakeToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private MakeValue() {} + + private MakeValue(CreateMakeToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitMake(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MakeValue && equalTo((MakeValue) other); + } + + private boolean equalTo(MakeValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("transferCall") + private static final class TransferCallValue implements Value { + @JsonUnwrapped + private CreateTransferCallToolDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private TransferCallValue() {} + + private TransferCallValue(CreateTransferCallToolDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitTransferCall(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransferCallValue && equalTo((TransferCallValue) other); + } + + private boolean equalTo(TransferCallValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "XaiModelToolsItem{" + "type: " + type + ", value: " + value + "}"; + } + } +}