diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
new file mode 100644
index 0000000..dce5b21
--- /dev/null
+++ b/.github/workflows/publish-sonatype.yml
@@ -0,0 +1,41 @@
+# This workflow is triggered when a GitHub release is created.
+# It can also be run manually to re-publish to Sonatype in case it failed for some reason.
+# You can run this workflow by navigating to https://www.github.com/zavudev/sdk-java/actions/workflows/publish-sonatype.yml
+name: Publish Sonatype
+on:
+ workflow_dispatch:
+
+ release:
+ types: [published]
+
+jobs:
+ publish:
+ name: publish
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Set up Java
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
+ with:
+ distribution: temurin
+ java-version: |
+ 8
+ 21
+ cache: gradle
+
+ - name: Set up Gradle
+ uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
+
+ - name: Publish to Sonatype
+ run: |-
+ export -- GPG_SIGNING_KEY_ID
+ printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
+ GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
+ ./gradlew publish --no-configuration-cache
+ env:
+ SONATYPE_USERNAME: ${{ secrets.ZAVUDEV_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
+ SONATYPE_PASSWORD: ${{ secrets.ZAVUDEV_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
+ GPG_SIGNING_KEY: ${{ secrets.ZAVUDEV_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
+ GPG_SIGNING_PASSWORD: ${{ secrets.ZAVUDEV_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
\ No newline at end of file
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
new file mode 100644
index 0000000..61375ab
--- /dev/null
+++ b/.github/workflows/release-doctor.yml
@@ -0,0 +1,24 @@
+name: Release Doctor
+on:
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ release_doctor:
+ name: release doctor
+ runs-on: ubuntu-latest
+ if: github.repository == 'zavudev/sdk-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
+
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Check release environment
+ run: |
+ bash ./bin/check-release-environment
+ env:
+ SONATYPE_USERNAME: ${{ secrets.ZAVUDEV_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
+ SONATYPE_PASSWORD: ${{ secrets.ZAVUDEV_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
+ GPG_SIGNING_KEY: ${{ secrets.ZAVUDEV_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
+ GPG_SIGNING_PASSWORD: ${{ secrets.ZAVUDEV_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
new file mode 100644
index 0000000..3d2ac0b
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1,3 @@
+{
+ ".": "0.1.0"
+}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 8413cc3..d9f73e8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 138
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-fa2ec1f359f9ed18ba4e00d8d1edb2a10a50c02b4efd9f20736cedbefb39cc47.yml
-openapi_spec_hash: 6b119a3213e324f3826453deca57f10b
-config_hash: d5d02dfde2ea057fdcf5b26e3a921f7a
+configured_endpoints: 183
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-fc96dae99e9649b4cfb99002b7dfee6480114b8dda4ff136541533c9c9069118.yml
+openapi_spec_hash: 3c2c8da8c73cdd7e656b7f2c06cc01b4
+config_hash: 261e1b852ca7f8364e4a283a3edd350a
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..745f5cf
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,30 @@
+# Changelog
+
+## 0.1.0 (2026-08-31)
+
+Full Changelog: [v0.0.1...v0.1.0](https://github.com/zavudev/sdk-java/compare/v0.0.1...v0.1.0)
+
+### Features
+
+* **api:** api update ([b71003b](https://github.com/zavudev/sdk-java/commit/b71003be390baf70bb60e2c5692d0c7a2789acab))
+* **api:** api update ([331171f](https://github.com/zavudev/sdk-java/commit/331171f3c7fb8fba3c39663fadc8381283aa9de0))
+* **api:** api update ([f2f6b70](https://github.com/zavudev/sdk-java/commit/f2f6b7012c693ffbea5e1050451393279033ba98))
+* **api:** api update ([cc0ce4d](https://github.com/zavudev/sdk-java/commit/cc0ce4dadf0b72694a509e03591a5663aa2190e9))
+* **api:** api update ([88a8d12](https://github.com/zavudev/sdk-java/commit/88a8d12250ab108356b560b5e529b3c43da5e451))
+* **api:** api update ([5e3cf0f](https://github.com/zavudev/sdk-java/commit/5e3cf0f493d13c979c52a426e845d6713401601d))
+* **api:** api update ([097cfec](https://github.com/zavudev/sdk-java/commit/097cfec6842059736cb8e46fa21cfcfb85485867))
+* **api:** api update ([cf7c412](https://github.com/zavudev/sdk-java/commit/cf7c41255bc4ad349e9111c1abbde0b72a60539f))
+* **api:** api update ([e8dd549](https://github.com/zavudev/sdk-java/commit/e8dd549d4143f5b52c9382e556e13df063a596cc))
+* **api:** manual updates ([2299c46](https://github.com/zavudev/sdk-java/commit/2299c467566b3c253997cfdf40486c7215e24d02))
+
+
+### Bug Fixes
+
+* **docs:** link the javadoc badge so the version stays current after release ([565c2f3](https://github.com/zavudev/sdk-java/commit/565c2f36ad9cb5b2b66e0681938781d45c2f9cda))
+
+
+### Chores
+
+* configure new SDK language ([ddad6b8](https://github.com/zavudev/sdk-java/commit/ddad6b81b9625c9e4afa635d3768ac15095e2dd7))
+* **internal:** codegen related update ([a9d330b](https://github.com/zavudev/sdk-java/commit/a9d330b32f9f8fafb135ea832219f65f119c69ec))
+* update SDK settings ([97e8950](https://github.com/zavudev/sdk-java/commit/97e8950d08e11209793497c6b202276c53f0f763))
diff --git a/README.md b/README.md
index 506deb7..d80a923 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,11 @@
# Zavudev Java API Library
-[](https://central.sonatype.com/artifact/com.zavudev.api/zavudev-java/0.0.1)
-[](https://javadoc.io/doc/com.zavudev.api/zavudev-java/0.0.1)
+
+
+[](https://central.sonatype.com/artifact/com.zavudev.api/zavudev-java/0.1.0)
+[](https://javadoc.io/doc/com.zavudev.api/zavudev-java/0.1.0)
+
+
The Zavudev Java SDK provides convenient access to the [Zavudev REST API](https://docs.zavu.dev) from applications written in Java.
@@ -16,14 +20,20 @@ Use the Zavudev MCP Server to enable AI assistants to interact with this API, al
> Note: You may need to set environment variables in your MCP client.
-The REST API documentation can be found on [docs.zavu.dev](https://docs.zavu.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.zavudev.api/zavudev-java/0.0.1).
+
+
+The REST API documentation can be found on [docs.zavu.dev](https://docs.zavu.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.zavudev.api/zavudev-java/0.1.0).
+
+
## Installation
+
+
### Gradle
```kotlin
-implementation("com.zavudev.api:zavudev-java:0.0.1")
+implementation("com.zavudev.api:zavudev-java:0.1.0")
```
### Maven
@@ -32,10 +42,12 @@ implementation("com.zavudev.api:zavudev-java:0.0.1")
com.zavudev.api
zavudev-java
- 0.0.1
+ 0.1.0
```
+
+
## Requirements
This library requires Java 8 or later.
@@ -781,4 +793,4 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
-We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/zavudev-java/issues) with questions, bugs, or suggestions.
+We are keen for your feedback; please open an [issue](https://www.github.com/zavudev/sdk-java/issues) with questions, bugs, or suggestions.
diff --git a/bin/check-release-environment b/bin/check-release-environment
new file mode 100644
index 0000000..3a6a7b4
--- /dev/null
+++ b/bin/check-release-environment
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+errors=()
+
+if [ -z "${SONATYPE_USERNAME}" ]; then
+ errors+=("The SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+fi
+
+if [ -z "${SONATYPE_PASSWORD}" ]; then
+ errors+=("The SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+fi
+
+if [ -z "${GPG_SIGNING_KEY}" ]; then
+ errors+=("The GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+fi
+
+if [ -z "${GPG_SIGNING_PASSWORD}" ]; then
+ errors+=("The GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+fi
+
+lenErrors=${#errors[@]}
+
+if [[ lenErrors -gt 0 ]]; then
+ echo -e "Found the following errors in the release environment:\n"
+
+ for error in "${errors[@]}"; do
+ echo -e "- $error\n"
+ done
+
+ exit 1
+fi
+
+echo "The environment is ready to push releases!"
diff --git a/build.gradle.kts b/build.gradle.kts
index 0621193..eeed2ad 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ repositories {
allprojects {
group = "com.zavudev.api"
- version = "0.0.1"
+ version = "0.1.0" // x-release-please-version
}
subprojects {
diff --git a/buildSrc/src/main/kotlin/zavudev.publish.gradle.kts b/buildSrc/src/main/kotlin/zavudev.publish.gradle.kts
index 0931234..ad77e8e 100644
--- a/buildSrc/src/main/kotlin/zavudev.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/zavudev.publish.gradle.kts
@@ -27,9 +27,9 @@ configure {
}
scm {
- connection.set("scm:git:git://github.com/stainless-sdks/zavudev-java.git")
- developerConnection.set("scm:git:git://github.com/stainless-sdks/zavudev-java.git")
- url.set("https://github.com/stainless-sdks/zavudev-java")
+ connection.set("scm:git:git://github.com/zavudev/sdk-java.git")
+ developerConnection.set("scm:git:git://github.com/zavudev/sdk-java.git")
+ url.set("https://github.com/zavudev/sdk-java")
}
versionMapping {
diff --git a/release-please-config.json b/release-please-config.json
new file mode 100644
index 0000000..8f98719
--- /dev/null
+++ b/release-please-config.json
@@ -0,0 +1,67 @@
+{
+ "packages": {
+ ".": {}
+ },
+ "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
+ "include-v-in-tag": true,
+ "include-component-in-tag": false,
+ "versioning": "prerelease",
+ "prerelease": true,
+ "bump-minor-pre-major": true,
+ "bump-patch-for-minor-pre-major": false,
+ "pull-request-header": "Automated Release PR",
+ "pull-request-title-pattern": "release: ${version}",
+ "changelog-sections": [
+ {
+ "type": "feat",
+ "section": "Features"
+ },
+ {
+ "type": "fix",
+ "section": "Bug Fixes"
+ },
+ {
+ "type": "perf",
+ "section": "Performance Improvements"
+ },
+ {
+ "type": "revert",
+ "section": "Reverts"
+ },
+ {
+ "type": "chore",
+ "section": "Chores"
+ },
+ {
+ "type": "docs",
+ "section": "Documentation"
+ },
+ {
+ "type": "style",
+ "section": "Styles"
+ },
+ {
+ "type": "refactor",
+ "section": "Refactors"
+ },
+ {
+ "type": "test",
+ "section": "Tests",
+ "hidden": true
+ },
+ {
+ "type": "build",
+ "section": "Build System"
+ },
+ {
+ "type": "ci",
+ "section": "Continuous Integration",
+ "hidden": true
+ }
+ ],
+ "release-type": "simple",
+ "extra-files": [
+ "README.md",
+ "build.gradle.kts"
+ ]
+}
\ No newline at end of file
diff --git a/zavudev-java-core/build.gradle.kts b/zavudev-java-core/build.gradle.kts
index 689e701..1df2b92 100644
--- a/zavudev-java-core/build.gradle.kts
+++ b/zavudev-java-core/build.gradle.kts
@@ -38,4 +38,5 @@ dependencies {
testImplementation("org.mockito:mockito-core:5.14.2")
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
+ testImplementation("org.slf4j:slf4j-nop:1.7.36")
}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClient.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClient.kt
index b11d1dc..bc7666c 100644
--- a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClient.kt
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClient.kt
@@ -4,9 +4,14 @@ package com.zavudev.api.client
import com.zavudev.api.core.ClientOptions
import com.zavudev.api.services.blocking.AddressService
+import com.zavudev.api.services.blocking.AgentService
+import com.zavudev.api.services.blocking.AgentTemplateService
import com.zavudev.api.services.blocking.BalanceService
import com.zavudev.api.services.blocking.BroadcastService
+import com.zavudev.api.services.blocking.CallService
import com.zavudev.api.services.blocking.ContactService
+import com.zavudev.api.services.blocking.ConversationService
+import com.zavudev.api.services.blocking.EmailDomainService
import com.zavudev.api.services.blocking.FunctionService
import com.zavudev.api.services.blocking.IntrospectService
import com.zavudev.api.services.blocking.InvitationService
@@ -89,6 +94,16 @@ interface ZavudevClient {
fun functions(): FunctionService
+ fun conversations(): ConversationService
+
+ fun calls(): CallService
+
+ fun agentTemplates(): AgentTemplateService
+
+ fun emailDomains(): EmailDomainService
+
+ fun agents(): AgentService
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -143,5 +158,15 @@ interface ZavudevClient {
fun me(): MeService.WithRawResponse
fun functions(): FunctionService.WithRawResponse
+
+ fun conversations(): ConversationService.WithRawResponse
+
+ fun calls(): CallService.WithRawResponse
+
+ fun agentTemplates(): AgentTemplateService.WithRawResponse
+
+ fun emailDomains(): EmailDomainService.WithRawResponse
+
+ fun agents(): AgentService.WithRawResponse
}
}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsync.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsync.kt
index da62da0..7a2db54 100644
--- a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsync.kt
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsync.kt
@@ -4,9 +4,14 @@ package com.zavudev.api.client
import com.zavudev.api.core.ClientOptions
import com.zavudev.api.services.async.AddressServiceAsync
+import com.zavudev.api.services.async.AgentServiceAsync
+import com.zavudev.api.services.async.AgentTemplateServiceAsync
import com.zavudev.api.services.async.BalanceServiceAsync
import com.zavudev.api.services.async.BroadcastServiceAsync
+import com.zavudev.api.services.async.CallServiceAsync
import com.zavudev.api.services.async.ContactServiceAsync
+import com.zavudev.api.services.async.ConversationServiceAsync
+import com.zavudev.api.services.async.EmailDomainServiceAsync
import com.zavudev.api.services.async.FunctionServiceAsync
import com.zavudev.api.services.async.IntrospectServiceAsync
import com.zavudev.api.services.async.InvitationServiceAsync
@@ -89,6 +94,16 @@ interface ZavudevClientAsync {
fun functions(): FunctionServiceAsync
+ fun conversations(): ConversationServiceAsync
+
+ fun calls(): CallServiceAsync
+
+ fun agentTemplates(): AgentTemplateServiceAsync
+
+ fun emailDomains(): EmailDomainServiceAsync
+
+ fun agents(): AgentServiceAsync
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -147,5 +162,15 @@ interface ZavudevClientAsync {
fun me(): MeServiceAsync.WithRawResponse
fun functions(): FunctionServiceAsync.WithRawResponse
+
+ fun conversations(): ConversationServiceAsync.WithRawResponse
+
+ fun calls(): CallServiceAsync.WithRawResponse
+
+ fun agentTemplates(): AgentTemplateServiceAsync.WithRawResponse
+
+ fun emailDomains(): EmailDomainServiceAsync.WithRawResponse
+
+ fun agents(): AgentServiceAsync.WithRawResponse
}
}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsyncImpl.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsyncImpl.kt
index d63c125..f3e4715 100644
--- a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsyncImpl.kt
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientAsyncImpl.kt
@@ -6,12 +6,22 @@ import com.zavudev.api.core.ClientOptions
import com.zavudev.api.core.getPackageVersion
import com.zavudev.api.services.async.AddressServiceAsync
import com.zavudev.api.services.async.AddressServiceAsyncImpl
+import com.zavudev.api.services.async.AgentServiceAsync
+import com.zavudev.api.services.async.AgentServiceAsyncImpl
+import com.zavudev.api.services.async.AgentTemplateServiceAsync
+import com.zavudev.api.services.async.AgentTemplateServiceAsyncImpl
import com.zavudev.api.services.async.BalanceServiceAsync
import com.zavudev.api.services.async.BalanceServiceAsyncImpl
import com.zavudev.api.services.async.BroadcastServiceAsync
import com.zavudev.api.services.async.BroadcastServiceAsyncImpl
+import com.zavudev.api.services.async.CallServiceAsync
+import com.zavudev.api.services.async.CallServiceAsyncImpl
import com.zavudev.api.services.async.ContactServiceAsync
import com.zavudev.api.services.async.ContactServiceAsyncImpl
+import com.zavudev.api.services.async.ConversationServiceAsync
+import com.zavudev.api.services.async.ConversationServiceAsyncImpl
+import com.zavudev.api.services.async.EmailDomainServiceAsync
+import com.zavudev.api.services.async.EmailDomainServiceAsyncImpl
import com.zavudev.api.services.async.FunctionServiceAsync
import com.zavudev.api.services.async.FunctionServiceAsyncImpl
import com.zavudev.api.services.async.IntrospectServiceAsync
@@ -115,6 +125,24 @@ class ZavudevClientAsyncImpl(private val clientOptions: ClientOptions) : Zavudev
FunctionServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val conversations: ConversationServiceAsync by lazy {
+ ConversationServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val calls: CallServiceAsync by lazy { CallServiceAsyncImpl(clientOptionsWithUserAgent) }
+
+ private val agentTemplates: AgentTemplateServiceAsync by lazy {
+ AgentTemplateServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val emailDomains: EmailDomainServiceAsync by lazy {
+ EmailDomainServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val agents: AgentServiceAsync by lazy {
+ AgentServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
override fun sync(): ZavudevClient = sync
override fun withRawResponse(): ZavudevClientAsync.WithRawResponse = withRawResponse
@@ -154,6 +182,16 @@ class ZavudevClientAsyncImpl(private val clientOptions: ClientOptions) : Zavudev
override fun functions(): FunctionServiceAsync = functions
+ override fun conversations(): ConversationServiceAsync = conversations
+
+ override fun calls(): CallServiceAsync = calls
+
+ override fun agentTemplates(): AgentTemplateServiceAsync = agentTemplates
+
+ override fun emailDomains(): EmailDomainServiceAsync = emailDomains
+
+ override fun agents(): AgentServiceAsync = agents
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -223,6 +261,26 @@ class ZavudevClientAsyncImpl(private val clientOptions: ClientOptions) : Zavudev
FunctionServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val conversations: ConversationServiceAsync.WithRawResponse by lazy {
+ ConversationServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val calls: CallServiceAsync.WithRawResponse by lazy {
+ CallServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val agentTemplates: AgentTemplateServiceAsync.WithRawResponse by lazy {
+ AgentTemplateServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val emailDomains: EmailDomainServiceAsync.WithRawResponse by lazy {
+ EmailDomainServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val agents: AgentServiceAsync.WithRawResponse by lazy {
+ AgentServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): ZavudevClientAsync.WithRawResponse =
@@ -262,5 +320,15 @@ class ZavudevClientAsyncImpl(private val clientOptions: ClientOptions) : Zavudev
override fun me(): MeServiceAsync.WithRawResponse = me
override fun functions(): FunctionServiceAsync.WithRawResponse = functions
+
+ override fun conversations(): ConversationServiceAsync.WithRawResponse = conversations
+
+ override fun calls(): CallServiceAsync.WithRawResponse = calls
+
+ override fun agentTemplates(): AgentTemplateServiceAsync.WithRawResponse = agentTemplates
+
+ override fun emailDomains(): EmailDomainServiceAsync.WithRawResponse = emailDomains
+
+ override fun agents(): AgentServiceAsync.WithRawResponse = agents
}
}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientImpl.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientImpl.kt
index bd9983c..81d8a02 100644
--- a/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientImpl.kt
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/client/ZavudevClientImpl.kt
@@ -6,12 +6,22 @@ import com.zavudev.api.core.ClientOptions
import com.zavudev.api.core.getPackageVersion
import com.zavudev.api.services.blocking.AddressService
import com.zavudev.api.services.blocking.AddressServiceImpl
+import com.zavudev.api.services.blocking.AgentService
+import com.zavudev.api.services.blocking.AgentServiceImpl
+import com.zavudev.api.services.blocking.AgentTemplateService
+import com.zavudev.api.services.blocking.AgentTemplateServiceImpl
import com.zavudev.api.services.blocking.BalanceService
import com.zavudev.api.services.blocking.BalanceServiceImpl
import com.zavudev.api.services.blocking.BroadcastService
import com.zavudev.api.services.blocking.BroadcastServiceImpl
+import com.zavudev.api.services.blocking.CallService
+import com.zavudev.api.services.blocking.CallServiceImpl
import com.zavudev.api.services.blocking.ContactService
import com.zavudev.api.services.blocking.ContactServiceImpl
+import com.zavudev.api.services.blocking.ConversationService
+import com.zavudev.api.services.blocking.ConversationServiceImpl
+import com.zavudev.api.services.blocking.EmailDomainService
+import com.zavudev.api.services.blocking.EmailDomainServiceImpl
import com.zavudev.api.services.blocking.FunctionService
import com.zavudev.api.services.blocking.FunctionServiceImpl
import com.zavudev.api.services.blocking.IntrospectService
@@ -105,6 +115,22 @@ class ZavudevClientImpl(private val clientOptions: ClientOptions) : ZavudevClien
FunctionServiceImpl(clientOptionsWithUserAgent)
}
+ private val conversations: ConversationService by lazy {
+ ConversationServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val calls: CallService by lazy { CallServiceImpl(clientOptionsWithUserAgent) }
+
+ private val agentTemplates: AgentTemplateService by lazy {
+ AgentTemplateServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val emailDomains: EmailDomainService by lazy {
+ EmailDomainServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val agents: AgentService by lazy { AgentServiceImpl(clientOptionsWithUserAgent) }
+
override fun async(): ZavudevClientAsync = async
override fun withRawResponse(): ZavudevClient.WithRawResponse = withRawResponse
@@ -144,6 +170,16 @@ class ZavudevClientImpl(private val clientOptions: ClientOptions) : ZavudevClien
override fun functions(): FunctionService = functions
+ override fun conversations(): ConversationService = conversations
+
+ override fun calls(): CallService = calls
+
+ override fun agentTemplates(): AgentTemplateService = agentTemplates
+
+ override fun emailDomains(): EmailDomainService = emailDomains
+
+ override fun agents(): AgentService = agents
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -213,6 +249,26 @@ class ZavudevClientImpl(private val clientOptions: ClientOptions) : ZavudevClien
FunctionServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val conversations: ConversationService.WithRawResponse by lazy {
+ ConversationServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val calls: CallService.WithRawResponse by lazy {
+ CallServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val agentTemplates: AgentTemplateService.WithRawResponse by lazy {
+ AgentTemplateServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val emailDomains: EmailDomainService.WithRawResponse by lazy {
+ EmailDomainServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val agents: AgentService.WithRawResponse by lazy {
+ AgentServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): ZavudevClient.WithRawResponse =
@@ -252,5 +308,15 @@ class ZavudevClientImpl(private val clientOptions: ClientOptions) : ZavudevClien
override fun me(): MeService.WithRawResponse = me
override fun functions(): FunctionService.WithRawResponse = functions
+
+ override fun conversations(): ConversationService.WithRawResponse = conversations
+
+ override fun calls(): CallService.WithRawResponse = calls
+
+ override fun agentTemplates(): AgentTemplateService.WithRawResponse = agentTemplates
+
+ override fun emailDomains(): EmailDomainService.WithRawResponse = emailDomains
+
+ override fun agents(): AgentService.WithRawResponse = agents
}
}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/core/Check.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/core/Check.kt
index d9530a7..587d1b6 100644
--- a/zavudev-java-core/src/main/kotlin/com/zavudev/api/core/Check.kt
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/core/Check.kt
@@ -77,7 +77,7 @@ This can happen if you are either:
Double-check that you are depending on compatible Jackson versions.
-See https://www.github.com/stainless-sdks/zavudev-java#jackson for more information.
+See https://www.github.com/zavudev/sdk-java#jackson for more information.
"""
.trimIndent()
}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentCreateParams.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentCreateParams.kt
new file mode 100644
index 0000000..4b16bea
--- /dev/null
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentCreateParams.kt
@@ -0,0 +1,2366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.zavudev.api.models.agents
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.zavudev.api.core.Enum
+import com.zavudev.api.core.ExcludeMissing
+import com.zavudev.api.core.JsonField
+import com.zavudev.api.core.JsonMissing
+import com.zavudev.api.core.JsonValue
+import com.zavudev.api.core.Params
+import com.zavudev.api.core.checkKnown
+import com.zavudev.api.core.checkRequired
+import com.zavudev.api.core.http.Headers
+import com.zavudev.api.core.http.QueryParams
+import com.zavudev.api.core.toImmutable
+import com.zavudev.api.errors.ZavudevInvalidDataException
+import com.zavudev.api.models.senders.agent.AgentProvider
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Create an agent without a sender. It is created disabled; connect a sender and enable it when you
+ * are ready for it to answer.
+ *
+ * **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at
+ * `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and
+ * `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes documented under
+ * `/v1/senders/{senderId}/agent/...` exactly. Use the agent-scoped form while the agent has no
+ * sender: the sender-scoped one cannot address it.
+ */
+class AgentCreateParams
+private constructor(
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun model(): String = body.model()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun name(): String = body.name()
+
+ /**
+ * LLM provider for the AI agent.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun provider(): AgentProvider = body.provider()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun systemPrompt(): String = body.systemPrompt()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun contextWindowMessages(): Optional = body.contextWindowMessages()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun includeContactMetadata(): Optional = body.includeContactMetadata()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun maxTokens(): Optional = body.maxTokens()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun temperature(): Optional = body.temperature()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun triggerOnChannels(): Optional> = body.triggerOnChannels()
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun triggerOnMessageTypes(): Optional> = body.triggerOnMessageTypes()
+
+ /**
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on inbound
+ * and outbound phone calls through Zavu's managed voice pipeline (speech recognition, the
+ * agent's LLM, and speech synthesis, with real-time interruption handling). Requires the Voice
+ * Agents feature to be enabled for your team.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun voice(): Optional = body.voice()
+
+ /**
+ * Returns the raw JSON value of [model].
+ *
+ * Unlike [model], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _model(): JsonField = body._model()
+
+ /**
+ * Returns the raw JSON value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _name(): JsonField = body._name()
+
+ /**
+ * Returns the raw JSON value of [provider].
+ *
+ * Unlike [provider], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _provider(): JsonField = body._provider()
+
+ /**
+ * Returns the raw JSON value of [systemPrompt].
+ *
+ * Unlike [systemPrompt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _systemPrompt(): JsonField = body._systemPrompt()
+
+ /**
+ * Returns the raw JSON value of [contextWindowMessages].
+ *
+ * Unlike [contextWindowMessages], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _contextWindowMessages(): JsonField = body._contextWindowMessages()
+
+ /**
+ * Returns the raw JSON value of [includeContactMetadata].
+ *
+ * Unlike [includeContactMetadata], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ fun _includeContactMetadata(): JsonField = body._includeContactMetadata()
+
+ /**
+ * Returns the raw JSON value of [maxTokens].
+ *
+ * Unlike [maxTokens], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _maxTokens(): JsonField = body._maxTokens()
+
+ /**
+ * Returns the raw JSON value of [temperature].
+ *
+ * Unlike [temperature], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _temperature(): JsonField = body._temperature()
+
+ /**
+ * Returns the raw JSON value of [triggerOnChannels].
+ *
+ * Unlike [triggerOnChannels], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _triggerOnChannels(): JsonField> = body._triggerOnChannels()
+
+ /**
+ * Returns the raw JSON value of [triggerOnMessageTypes].
+ *
+ * Unlike [triggerOnMessageTypes], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _triggerOnMessageTypes(): JsonField> = body._triggerOnMessageTypes()
+
+ /**
+ * Returns the raw JSON value of [voice].
+ *
+ * Unlike [voice], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _voice(): JsonField = body._voice()
+
+ fun _additionalBodyProperties(): Map = body._additionalProperties()
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AgentCreateParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .model()
+ * .name()
+ * .provider()
+ * .systemPrompt()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AgentCreateParams]. */
+ class Builder internal constructor() {
+
+ private var body: Body.Builder = Body.builder()
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(agentCreateParams: AgentCreateParams) = apply {
+ body = agentCreateParams.body.toBuilder()
+ additionalHeaders = agentCreateParams.additionalHeaders.toBuilder()
+ additionalQueryParams = agentCreateParams.additionalQueryParams.toBuilder()
+ }
+
+ /**
+ * Sets the entire request body.
+ *
+ * This is generally only useful if you are already constructing the body separately.
+ * Otherwise, it's more convenient to use the top-level setters instead:
+ * - [model]
+ * - [name]
+ * - [provider]
+ * - [systemPrompt]
+ * - [contextWindowMessages]
+ * - etc.
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ fun model(model: String) = apply { body.model(model) }
+
+ /**
+ * Sets [Builder.model] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.model] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun model(model: JsonField) = apply { body.model(model) }
+
+ fun name(name: String) = apply { body.name(name) }
+
+ /**
+ * Sets [Builder.name] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.name] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun name(name: JsonField) = apply { body.name(name) }
+
+ /** LLM provider for the AI agent. */
+ fun provider(provider: AgentProvider) = apply { body.provider(provider) }
+
+ /**
+ * Sets [Builder.provider] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.provider] with a well-typed [AgentProvider] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun provider(provider: JsonField) = apply { body.provider(provider) }
+
+ fun systemPrompt(systemPrompt: String) = apply { body.systemPrompt(systemPrompt) }
+
+ /**
+ * Sets [Builder.systemPrompt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.systemPrompt] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun systemPrompt(systemPrompt: JsonField) = apply {
+ body.systemPrompt(systemPrompt)
+ }
+
+ fun contextWindowMessages(contextWindowMessages: Long) = apply {
+ body.contextWindowMessages(contextWindowMessages)
+ }
+
+ /**
+ * Sets [Builder.contextWindowMessages] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.contextWindowMessages] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun contextWindowMessages(contextWindowMessages: JsonField) = apply {
+ body.contextWindowMessages(contextWindowMessages)
+ }
+
+ fun includeContactMetadata(includeContactMetadata: Boolean) = apply {
+ body.includeContactMetadata(includeContactMetadata)
+ }
+
+ /**
+ * Sets [Builder.includeContactMetadata] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.includeContactMetadata] with a well-typed [Boolean]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun includeContactMetadata(includeContactMetadata: JsonField) = apply {
+ body.includeContactMetadata(includeContactMetadata)
+ }
+
+ fun maxTokens(maxTokens: Long) = apply { body.maxTokens(maxTokens) }
+
+ /**
+ * Sets [Builder.maxTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.maxTokens] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun maxTokens(maxTokens: JsonField) = apply { body.maxTokens(maxTokens) }
+
+ fun temperature(temperature: Double) = apply { body.temperature(temperature) }
+
+ /**
+ * Sets [Builder.temperature] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.temperature] with a well-typed [Double] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun temperature(temperature: JsonField) = apply { body.temperature(temperature) }
+
+ fun triggerOnChannels(triggerOnChannels: List) = apply {
+ body.triggerOnChannels(triggerOnChannels)
+ }
+
+ /**
+ * Sets [Builder.triggerOnChannels] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.triggerOnChannels] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun triggerOnChannels(triggerOnChannels: JsonField>) = apply {
+ body.triggerOnChannels(triggerOnChannels)
+ }
+
+ /**
+ * Adds a single [String] to [triggerOnChannels].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTriggerOnChannel(triggerOnChannel: String) = apply {
+ body.addTriggerOnChannel(triggerOnChannel)
+ }
+
+ fun triggerOnMessageTypes(triggerOnMessageTypes: List) = apply {
+ body.triggerOnMessageTypes(triggerOnMessageTypes)
+ }
+
+ /**
+ * Sets [Builder.triggerOnMessageTypes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.triggerOnMessageTypes] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun triggerOnMessageTypes(triggerOnMessageTypes: JsonField>) = apply {
+ body.triggerOnMessageTypes(triggerOnMessageTypes)
+ }
+
+ /**
+ * Adds a single [String] to [triggerOnMessageTypes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTriggerOnMessageType(triggerOnMessageType: String) = apply {
+ body.addTriggerOnMessageType(triggerOnMessageType)
+ }
+
+ /**
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on
+ * inbound and outbound phone calls through Zavu's managed voice pipeline (speech
+ * recognition, the agent's LLM, and speech synthesis, with real-time interruption
+ * handling). Requires the Voice Agents feature to be enabled for your team.
+ */
+ fun voice(voice: Voice) = apply { body.voice(voice) }
+
+ /**
+ * Sets [Builder.voice] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voice] with a well-typed [Voice] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun voice(voice: JsonField) = apply { body.voice(voice) }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ body.additionalProperties(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ body.putAdditionalProperty(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ body.putAllAdditionalProperties(additionalBodyProperties)
+ }
+
+ fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
+
+ fun removeAllAdditionalBodyProperties(keys: Set) = apply {
+ body.removeAllAdditionalProperties(keys)
+ }
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [AgentCreateParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .model()
+ * .name()
+ * .provider()
+ * .systemPrompt()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AgentCreateParams =
+ AgentCreateParams(
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): Body = body
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ /**
+ * Create an agent that exists on its own. Connect senders afterwards; an agent answers on any
+ * number of them.
+ *
+ * **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at
+ * `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and
+ * `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes documented under
+ * `/v1/senders/{senderId}/agent/...` exactly. Use the agent-scoped form while the agent has no
+ * sender: the sender-scoped one cannot address it.
+ */
+ class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val model: JsonField,
+ private val name: JsonField,
+ private val provider: JsonField,
+ private val systemPrompt: JsonField,
+ private val contextWindowMessages: JsonField,
+ private val includeContactMetadata: JsonField,
+ private val maxTokens: JsonField,
+ private val temperature: JsonField,
+ private val triggerOnChannels: JsonField>,
+ private val triggerOnMessageTypes: JsonField>,
+ private val voice: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ @JsonProperty("provider")
+ @ExcludeMissing
+ provider: JsonField = JsonMissing.of(),
+ @JsonProperty("systemPrompt")
+ @ExcludeMissing
+ systemPrompt: JsonField = JsonMissing.of(),
+ @JsonProperty("contextWindowMessages")
+ @ExcludeMissing
+ contextWindowMessages: JsonField = JsonMissing.of(),
+ @JsonProperty("includeContactMetadata")
+ @ExcludeMissing
+ includeContactMetadata: JsonField = JsonMissing.of(),
+ @JsonProperty("maxTokens")
+ @ExcludeMissing
+ maxTokens: JsonField = JsonMissing.of(),
+ @JsonProperty("temperature")
+ @ExcludeMissing
+ temperature: JsonField = JsonMissing.of(),
+ @JsonProperty("triggerOnChannels")
+ @ExcludeMissing
+ triggerOnChannels: JsonField> = JsonMissing.of(),
+ @JsonProperty("triggerOnMessageTypes")
+ @ExcludeMissing
+ triggerOnMessageTypes: JsonField> = JsonMissing.of(),
+ @JsonProperty("voice") @ExcludeMissing voice: JsonField = JsonMissing.of(),
+ ) : this(
+ model,
+ name,
+ provider,
+ systemPrompt,
+ contextWindowMessages,
+ includeContactMetadata,
+ maxTokens,
+ temperature,
+ triggerOnChannels,
+ triggerOnMessageTypes,
+ voice,
+ mutableMapOf(),
+ )
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun model(): String = model.getRequired("model")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun name(): String = name.getRequired("name")
+
+ /**
+ * LLM provider for the AI agent.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun provider(): AgentProvider = provider.getRequired("provider")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun systemPrompt(): String = systemPrompt.getRequired("systemPrompt")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun contextWindowMessages(): Optional =
+ contextWindowMessages.getOptional("contextWindowMessages")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun includeContactMetadata(): Optional =
+ includeContactMetadata.getOptional("includeContactMetadata")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun maxTokens(): Optional = maxTokens.getOptional("maxTokens")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun temperature(): Optional = temperature.getOptional("temperature")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun triggerOnChannels(): Optional> =
+ triggerOnChannels.getOptional("triggerOnChannels")
+
+ /**
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun triggerOnMessageTypes(): Optional> =
+ triggerOnMessageTypes.getOptional("triggerOnMessageTypes")
+
+ /**
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on
+ * inbound and outbound phone calls through Zavu's managed voice pipeline (speech
+ * recognition, the agent's LLM, and speech synthesis, with real-time interruption
+ * handling). Requires the Voice Agents feature to be enabled for your team.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun voice(): Optional = voice.getOptional("voice")
+
+ /**
+ * Returns the raw JSON value of [model].
+ *
+ * Unlike [model], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("model") @ExcludeMissing fun _model(): JsonField = model
+
+ /**
+ * Returns the raw JSON value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
+
+ /**
+ * Returns the raw JSON value of [provider].
+ *
+ * Unlike [provider], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("provider")
+ @ExcludeMissing
+ fun _provider(): JsonField = provider
+
+ /**
+ * Returns the raw JSON value of [systemPrompt].
+ *
+ * Unlike [systemPrompt], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("systemPrompt")
+ @ExcludeMissing
+ fun _systemPrompt(): JsonField = systemPrompt
+
+ /**
+ * Returns the raw JSON value of [contextWindowMessages].
+ *
+ * Unlike [contextWindowMessages], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("contextWindowMessages")
+ @ExcludeMissing
+ fun _contextWindowMessages(): JsonField = contextWindowMessages
+
+ /**
+ * Returns the raw JSON value of [includeContactMetadata].
+ *
+ * Unlike [includeContactMetadata], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("includeContactMetadata")
+ @ExcludeMissing
+ fun _includeContactMetadata(): JsonField = includeContactMetadata
+
+ /**
+ * Returns the raw JSON value of [maxTokens].
+ *
+ * Unlike [maxTokens], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("maxTokens") @ExcludeMissing fun _maxTokens(): JsonField = maxTokens
+
+ /**
+ * Returns the raw JSON value of [temperature].
+ *
+ * Unlike [temperature], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("temperature")
+ @ExcludeMissing
+ fun _temperature(): JsonField = temperature
+
+ /**
+ * Returns the raw JSON value of [triggerOnChannels].
+ *
+ * Unlike [triggerOnChannels], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("triggerOnChannels")
+ @ExcludeMissing
+ fun _triggerOnChannels(): JsonField> = triggerOnChannels
+
+ /**
+ * Returns the raw JSON value of [triggerOnMessageTypes].
+ *
+ * Unlike [triggerOnMessageTypes], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("triggerOnMessageTypes")
+ @ExcludeMissing
+ fun _triggerOnMessageTypes(): JsonField> = triggerOnMessageTypes
+
+ /**
+ * Returns the raw JSON value of [voice].
+ *
+ * Unlike [voice], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("voice") @ExcludeMissing fun _voice(): JsonField = voice
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Body].
+ *
+ * The following fields are required:
+ * ```java
+ * .model()
+ * .name()
+ * .provider()
+ * .systemPrompt()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var model: JsonField? = null
+ private var name: JsonField? = null
+ private var provider: JsonField? = null
+ private var systemPrompt: JsonField? = null
+ private var contextWindowMessages: JsonField = JsonMissing.of()
+ private var includeContactMetadata: JsonField = JsonMissing.of()
+ private var maxTokens: JsonField = JsonMissing.of()
+ private var temperature: JsonField = JsonMissing.of()
+ private var triggerOnChannels: JsonField>? = null
+ private var triggerOnMessageTypes: JsonField>? = null
+ private var voice: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ model = body.model
+ name = body.name
+ provider = body.provider
+ systemPrompt = body.systemPrompt
+ contextWindowMessages = body.contextWindowMessages
+ includeContactMetadata = body.includeContactMetadata
+ maxTokens = body.maxTokens
+ temperature = body.temperature
+ triggerOnChannels = body.triggerOnChannels.map { it.toMutableList() }
+ triggerOnMessageTypes = body.triggerOnMessageTypes.map { it.toMutableList() }
+ voice = body.voice
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ fun model(model: String) = model(JsonField.of(model))
+
+ /**
+ * Sets [Builder.model] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.model] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun model(model: JsonField) = apply { this.model = model }
+
+ fun name(name: String) = name(JsonField.of(name))
+
+ /**
+ * Sets [Builder.name] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.name] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun name(name: JsonField) = apply { this.name = name }
+
+ /** LLM provider for the AI agent. */
+ fun provider(provider: AgentProvider) = provider(JsonField.of(provider))
+
+ /**
+ * Sets [Builder.provider] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.provider] with a well-typed [AgentProvider] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun provider(provider: JsonField) = apply { this.provider = provider }
+
+ fun systemPrompt(systemPrompt: String) = systemPrompt(JsonField.of(systemPrompt))
+
+ /**
+ * Sets [Builder.systemPrompt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.systemPrompt] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun systemPrompt(systemPrompt: JsonField) = apply {
+ this.systemPrompt = systemPrompt
+ }
+
+ fun contextWindowMessages(contextWindowMessages: Long) =
+ contextWindowMessages(JsonField.of(contextWindowMessages))
+
+ /**
+ * Sets [Builder.contextWindowMessages] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.contextWindowMessages] with a well-typed [Long]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun contextWindowMessages(contextWindowMessages: JsonField) = apply {
+ this.contextWindowMessages = contextWindowMessages
+ }
+
+ fun includeContactMetadata(includeContactMetadata: Boolean) =
+ includeContactMetadata(JsonField.of(includeContactMetadata))
+
+ /**
+ * Sets [Builder.includeContactMetadata] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.includeContactMetadata] with a well-typed [Boolean]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun includeContactMetadata(includeContactMetadata: JsonField) = apply {
+ this.includeContactMetadata = includeContactMetadata
+ }
+
+ fun maxTokens(maxTokens: Long) = maxTokens(JsonField.of(maxTokens))
+
+ /**
+ * Sets [Builder.maxTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.maxTokens] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun maxTokens(maxTokens: JsonField) = apply { this.maxTokens = maxTokens }
+
+ fun temperature(temperature: Double) = temperature(JsonField.of(temperature))
+
+ /**
+ * Sets [Builder.temperature] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.temperature] with a well-typed [Double] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun temperature(temperature: JsonField) = apply {
+ this.temperature = temperature
+ }
+
+ fun triggerOnChannels(triggerOnChannels: List) =
+ triggerOnChannels(JsonField.of(triggerOnChannels))
+
+ /**
+ * Sets [Builder.triggerOnChannels] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.triggerOnChannels] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun triggerOnChannels(triggerOnChannels: JsonField>) = apply {
+ this.triggerOnChannels = triggerOnChannels.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [triggerOnChannels].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTriggerOnChannel(triggerOnChannel: String) = apply {
+ triggerOnChannels =
+ (triggerOnChannels ?: JsonField.of(mutableListOf())).also {
+ checkKnown("triggerOnChannels", it).add(triggerOnChannel)
+ }
+ }
+
+ fun triggerOnMessageTypes(triggerOnMessageTypes: List) =
+ triggerOnMessageTypes(JsonField.of(triggerOnMessageTypes))
+
+ /**
+ * Sets [Builder.triggerOnMessageTypes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.triggerOnMessageTypes] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun triggerOnMessageTypes(triggerOnMessageTypes: JsonField>) = apply {
+ this.triggerOnMessageTypes = triggerOnMessageTypes.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [triggerOnMessageTypes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTriggerOnMessageType(triggerOnMessageType: String) = apply {
+ triggerOnMessageTypes =
+ (triggerOnMessageTypes ?: JsonField.of(mutableListOf())).also {
+ checkKnown("triggerOnMessageTypes", it).add(triggerOnMessageType)
+ }
+ }
+
+ /**
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on
+ * inbound and outbound phone calls through Zavu's managed voice pipeline (speech
+ * recognition, the agent's LLM, and speech synthesis, with real-time interruption
+ * handling). Requires the Voice Agents feature to be enabled for your team.
+ */
+ fun voice(voice: Voice) = voice(JsonField.of(voice))
+
+ /**
+ * Sets [Builder.voice] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voice] with a well-typed [Voice] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun voice(voice: JsonField) = apply { this.voice = voice }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Body].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .model()
+ * .name()
+ * .provider()
+ * .systemPrompt()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Body =
+ Body(
+ checkRequired("model", model),
+ checkRequired("name", name),
+ checkRequired("provider", provider),
+ checkRequired("systemPrompt", systemPrompt),
+ contextWindowMessages,
+ includeContactMetadata,
+ maxTokens,
+ temperature,
+ (triggerOnChannels ?: JsonMissing.of()).map { it.toImmutable() },
+ (triggerOnMessageTypes ?: JsonMissing.of()).map { it.toImmutable() },
+ voice,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws ZavudevInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ model()
+ name()
+ provider().validate()
+ systemPrompt()
+ contextWindowMessages()
+ includeContactMetadata()
+ maxTokens()
+ temperature()
+ triggerOnChannels()
+ triggerOnMessageTypes()
+ voice().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: ZavudevInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (model.asKnown().isPresent) 1 else 0) +
+ (if (name.asKnown().isPresent) 1 else 0) +
+ (provider.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (systemPrompt.asKnown().isPresent) 1 else 0) +
+ (if (contextWindowMessages.asKnown().isPresent) 1 else 0) +
+ (if (includeContactMetadata.asKnown().isPresent) 1 else 0) +
+ (if (maxTokens.asKnown().isPresent) 1 else 0) +
+ (if (temperature.asKnown().isPresent) 1 else 0) +
+ (triggerOnChannels.asKnown().getOrNull()?.size ?: 0) +
+ (triggerOnMessageTypes.asKnown().getOrNull()?.size ?: 0) +
+ (voice.asKnown().getOrNull()?.validity() ?: 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Body &&
+ model == other.model &&
+ name == other.name &&
+ provider == other.provider &&
+ systemPrompt == other.systemPrompt &&
+ contextWindowMessages == other.contextWindowMessages &&
+ includeContactMetadata == other.includeContactMetadata &&
+ maxTokens == other.maxTokens &&
+ temperature == other.temperature &&
+ triggerOnChannels == other.triggerOnChannels &&
+ triggerOnMessageTypes == other.triggerOnMessageTypes &&
+ voice == other.voice &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ model,
+ name,
+ provider,
+ systemPrompt,
+ contextWindowMessages,
+ includeContactMetadata,
+ maxTokens,
+ temperature,
+ triggerOnChannels,
+ triggerOnMessageTypes,
+ voice,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Body{model=$model, name=$name, provider=$provider, systemPrompt=$systemPrompt, contextWindowMessages=$contextWindowMessages, includeContactMetadata=$includeContactMetadata, maxTokens=$maxTokens, temperature=$temperature, triggerOnChannels=$triggerOnChannels, triggerOnMessageTypes=$triggerOnMessageTypes, voice=$voice, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on inbound
+ * and outbound phone calls through Zavu's managed voice pipeline (speech recognition, the
+ * agent's LLM, and speech synthesis, with real-time interruption handling). Requires the Voice
+ * Agents feature to be enabled for your team.
+ */
+ class Voice
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val enabled: JsonField,
+ private val greeting: JsonField,
+ private val greetings: JsonField,
+ private val interruptible: JsonField,
+ private val language: JsonField,
+ private val maxCallDurationMinutes: JsonField,
+ private val maxIdleSeconds: JsonField,
+ private val model: JsonField,
+ private val recordCalls: JsonField,
+ private val sttModel: JsonField,
+ private val sttProvider: JsonField,
+ private val transferPhoneNumber: JsonField,
+ private val ttsProvider: JsonField,
+ private val ttsVoiceId: JsonField,
+ private val voicemailAction: JsonField,
+ private val voicemailMessage: JsonField,
+ private val voiceSpeed: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("enabled") @ExcludeMissing enabled: JsonField = JsonMissing.of(),
+ @JsonProperty("greeting")
+ @ExcludeMissing
+ greeting: JsonField = JsonMissing.of(),
+ @JsonProperty("greetings")
+ @ExcludeMissing
+ greetings: JsonField = JsonMissing.of(),
+ @JsonProperty("interruptible")
+ @ExcludeMissing
+ interruptible: JsonField = JsonMissing.of(),
+ @JsonProperty("language")
+ @ExcludeMissing
+ language: JsonField = JsonMissing.of(),
+ @JsonProperty("maxCallDurationMinutes")
+ @ExcludeMissing
+ maxCallDurationMinutes: JsonField = JsonMissing.of(),
+ @JsonProperty("maxIdleSeconds")
+ @ExcludeMissing
+ maxIdleSeconds: JsonField = JsonMissing.of(),
+ @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(),
+ @JsonProperty("recordCalls")
+ @ExcludeMissing
+ recordCalls: JsonField = JsonMissing.of(),
+ @JsonProperty("sttModel")
+ @ExcludeMissing
+ sttModel: JsonField = JsonMissing.of(),
+ @JsonProperty("sttProvider")
+ @ExcludeMissing
+ sttProvider: JsonField = JsonMissing.of(),
+ @JsonProperty("transferPhoneNumber")
+ @ExcludeMissing
+ transferPhoneNumber: JsonField = JsonMissing.of(),
+ @JsonProperty("ttsProvider")
+ @ExcludeMissing
+ ttsProvider: JsonField = JsonMissing.of(),
+ @JsonProperty("ttsVoiceId")
+ @ExcludeMissing
+ ttsVoiceId: JsonField = JsonMissing.of(),
+ @JsonProperty("voicemailAction")
+ @ExcludeMissing
+ voicemailAction: JsonField = JsonMissing.of(),
+ @JsonProperty("voicemailMessage")
+ @ExcludeMissing
+ voicemailMessage: JsonField = JsonMissing.of(),
+ @JsonProperty("voiceSpeed")
+ @ExcludeMissing
+ voiceSpeed: JsonField = JsonMissing.of(),
+ ) : this(
+ enabled,
+ greeting,
+ greetings,
+ interruptible,
+ language,
+ maxCallDurationMinutes,
+ maxIdleSeconds,
+ model,
+ recordCalls,
+ sttModel,
+ sttProvider,
+ transferPhoneNumber,
+ ttsProvider,
+ ttsVoiceId,
+ voicemailAction,
+ voicemailMessage,
+ voiceSpeed,
+ mutableMapOf(),
+ )
+
+ /**
+ * Whether the agent handles voice calls. When false, the sender's number is not answered by
+ * the voice agent and outbound calls are rejected.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun enabled(): Boolean = enabled.getRequired("enabled")
+
+ /**
+ * Opening line the agent speaks when the call connects. If omitted, the agent waits for the
+ * caller to speak first.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun greeting(): Optional = greeting.getOptional("greeting")
+
+ /**
+ * Greeting per language, keyed by language code. Used when the caller's language differs
+ * from the one `greeting` is written in.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun greetings(): Optional = greetings.getOptional("greetings")
+
+ /**
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When true,
+ * the agent stops talking as soon as the caller starts.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun interruptible(): Optional = interruptible.getOptional("interruptible")
+
+ /**
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g. `en`,
+ * `es`, `pt-BR`). Auto-detected from the recipient when omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun language(): Optional = language.getOptional("language")
+
+ /**
+ * Hard limit on call length in minutes. The call ends automatically when reached.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun maxCallDurationMinutes(): Optional =
+ maxCallDurationMinutes.getOptional("maxCallDurationMinutes")
+
+ /**
+ * How long the agent waits during silence before ending the call.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun maxIdleSeconds(): Optional = maxIdleSeconds.getOptional("maxIdleSeconds")
+
+ /**
+ * Model that runs the conversation, co-located in the voice network for lowest latency.
+ * Independent of the model used for text messaging. Derived from the agent's text model
+ * when omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun model(): Optional = model.getOptional("model")
+
+ /**
+ * Whether the call audio is recorded.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun recordCalls(): Optional = recordCalls.getOptional("recordCalls")
+
+ /**
+ * Speech-recognition model. Uses the default when omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun sttModel(): Optional = sttModel.getOptional("sttModel")
+
+ /**
+ * Speech-recognition provider. Uses the default when omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun sttProvider(): Optional = sttProvider.getOptional("sttProvider")
+
+ /**
+ * E.164 phone number the agent can transfer the call to. When set, the agent is given a
+ * transfer tool it can use to hand the call to a human.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun transferPhoneNumber(): Optional =
+ transferPhoneNumber.getOptional("transferPhoneNumber")
+
+ /**
+ * Speech-synthesis provider. Uses the default when omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun ttsProvider(): Optional = ttsProvider.getOptional("ttsProvider")
+
+ /**
+ * Identifier of the synthesized voice that speaks. Choose from the voices available in the
+ * dashboard. Uses a neutral default when omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun ttsVoiceId(): Optional = ttsVoiceId.getOptional("ttsVoiceId")
+
+ /**
+ * What the agent does when an answering machine or voicemail is detected on an outbound
+ * call.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun voicemailAction(): Optional =
+ voicemailAction.getOptional("voicemailAction")
+
+ /**
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to `greeting` when
+ * omitted.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun voicemailMessage(): Optional = voicemailMessage.getOptional("voicemailMessage")
+
+ /**
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control; ignored
+ * by the others.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun voiceSpeed(): Optional = voiceSpeed.getOptional("voiceSpeed")
+
+ /**
+ * Returns the raw JSON value of [enabled].
+ *
+ * Unlike [enabled], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("enabled") @ExcludeMissing fun _enabled(): JsonField = enabled
+
+ /**
+ * Returns the raw JSON value of [greeting].
+ *
+ * Unlike [greeting], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("greeting") @ExcludeMissing fun _greeting(): JsonField = greeting
+
+ /**
+ * Returns the raw JSON value of [greetings].
+ *
+ * Unlike [greetings], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("greetings")
+ @ExcludeMissing
+ fun _greetings(): JsonField = greetings
+
+ /**
+ * Returns the raw JSON value of [interruptible].
+ *
+ * Unlike [interruptible], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("interruptible")
+ @ExcludeMissing
+ fun _interruptible(): JsonField = interruptible
+
+ /**
+ * Returns the raw JSON value of [language].
+ *
+ * Unlike [language], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("language") @ExcludeMissing fun _language(): JsonField = language
+
+ /**
+ * Returns the raw JSON value of [maxCallDurationMinutes].
+ *
+ * Unlike [maxCallDurationMinutes], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("maxCallDurationMinutes")
+ @ExcludeMissing
+ fun _maxCallDurationMinutes(): JsonField = maxCallDurationMinutes
+
+ /**
+ * Returns the raw JSON value of [maxIdleSeconds].
+ *
+ * Unlike [maxIdleSeconds], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("maxIdleSeconds")
+ @ExcludeMissing
+ fun _maxIdleSeconds(): JsonField = maxIdleSeconds
+
+ /**
+ * Returns the raw JSON value of [model].
+ *
+ * Unlike [model], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("model") @ExcludeMissing fun _model(): JsonField = model
+
+ /**
+ * Returns the raw JSON value of [recordCalls].
+ *
+ * Unlike [recordCalls], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("recordCalls")
+ @ExcludeMissing
+ fun _recordCalls(): JsonField = recordCalls
+
+ /**
+ * Returns the raw JSON value of [sttModel].
+ *
+ * Unlike [sttModel], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("sttModel") @ExcludeMissing fun _sttModel(): JsonField = sttModel
+
+ /**
+ * Returns the raw JSON value of [sttProvider].
+ *
+ * Unlike [sttProvider], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("sttProvider")
+ @ExcludeMissing
+ fun _sttProvider(): JsonField = sttProvider
+
+ /**
+ * Returns the raw JSON value of [transferPhoneNumber].
+ *
+ * Unlike [transferPhoneNumber], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("transferPhoneNumber")
+ @ExcludeMissing
+ fun _transferPhoneNumber(): JsonField = transferPhoneNumber
+
+ /**
+ * Returns the raw JSON value of [ttsProvider].
+ *
+ * Unlike [ttsProvider], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("ttsProvider")
+ @ExcludeMissing
+ fun _ttsProvider(): JsonField = ttsProvider
+
+ /**
+ * Returns the raw JSON value of [ttsVoiceId].
+ *
+ * Unlike [ttsVoiceId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("ttsVoiceId")
+ @ExcludeMissing
+ fun _ttsVoiceId(): JsonField = ttsVoiceId
+
+ /**
+ * Returns the raw JSON value of [voicemailAction].
+ *
+ * Unlike [voicemailAction], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("voicemailAction")
+ @ExcludeMissing
+ fun _voicemailAction(): JsonField = voicemailAction
+
+ /**
+ * Returns the raw JSON value of [voicemailMessage].
+ *
+ * Unlike [voicemailMessage], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("voicemailMessage")
+ @ExcludeMissing
+ fun _voicemailMessage(): JsonField = voicemailMessage
+
+ /**
+ * Returns the raw JSON value of [voiceSpeed].
+ *
+ * Unlike [voiceSpeed], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("voiceSpeed")
+ @ExcludeMissing
+ fun _voiceSpeed(): JsonField = voiceSpeed
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Voice].
+ *
+ * The following fields are required:
+ * ```java
+ * .enabled()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Voice]. */
+ class Builder internal constructor() {
+
+ private var enabled: JsonField? = null
+ private var greeting: JsonField = JsonMissing.of()
+ private var greetings: JsonField = JsonMissing.of()
+ private var interruptible: JsonField = JsonMissing.of()
+ private var language: JsonField = JsonMissing.of()
+ private var maxCallDurationMinutes: JsonField = JsonMissing.of()
+ private var maxIdleSeconds: JsonField = JsonMissing.of()
+ private var model: JsonField = JsonMissing.of()
+ private var recordCalls: JsonField = JsonMissing.of()
+ private var sttModel: JsonField = JsonMissing.of()
+ private var sttProvider: JsonField = JsonMissing.of()
+ private var transferPhoneNumber: JsonField = JsonMissing.of()
+ private var ttsProvider: JsonField = JsonMissing.of()
+ private var ttsVoiceId: JsonField = JsonMissing.of()
+ private var voicemailAction: JsonField = JsonMissing.of()
+ private var voicemailMessage: JsonField = JsonMissing.of()
+ private var voiceSpeed: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(voice: Voice) = apply {
+ enabled = voice.enabled
+ greeting = voice.greeting
+ greetings = voice.greetings
+ interruptible = voice.interruptible
+ language = voice.language
+ maxCallDurationMinutes = voice.maxCallDurationMinutes
+ maxIdleSeconds = voice.maxIdleSeconds
+ model = voice.model
+ recordCalls = voice.recordCalls
+ sttModel = voice.sttModel
+ sttProvider = voice.sttProvider
+ transferPhoneNumber = voice.transferPhoneNumber
+ ttsProvider = voice.ttsProvider
+ ttsVoiceId = voice.ttsVoiceId
+ voicemailAction = voice.voicemailAction
+ voicemailMessage = voice.voicemailMessage
+ voiceSpeed = voice.voiceSpeed
+ additionalProperties = voice.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * Whether the agent handles voice calls. When false, the sender's number is not
+ * answered by the voice agent and outbound calls are rejected.
+ */
+ fun enabled(enabled: Boolean) = enabled(JsonField.of(enabled))
+
+ /**
+ * Sets [Builder.enabled] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.enabled] with a well-typed [Boolean] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun enabled(enabled: JsonField) = apply { this.enabled = enabled }
+
+ /**
+ * Opening line the agent speaks when the call connects. If omitted, the agent waits for
+ * the caller to speak first.
+ */
+ fun greeting(greeting: String) = greeting(JsonField.of(greeting))
+
+ /**
+ * Sets [Builder.greeting] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.greeting] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun greeting(greeting: JsonField) = apply { this.greeting = greeting }
+
+ /**
+ * Greeting per language, keyed by language code. Used when the caller's language
+ * differs from the one `greeting` is written in.
+ */
+ fun greetings(greetings: Greetings) = greetings(JsonField.of(greetings))
+
+ /**
+ * Sets [Builder.greetings] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.greetings] with a well-typed [Greetings] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun greetings(greetings: JsonField) = apply { this.greetings = greetings }
+
+ /**
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When
+ * true, the agent stops talking as soon as the caller starts.
+ */
+ fun interruptible(interruptible: Boolean) = interruptible(JsonField.of(interruptible))
+
+ /**
+ * Sets [Builder.interruptible] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.interruptible] with a well-typed [Boolean] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun interruptible(interruptible: JsonField) = apply {
+ this.interruptible = interruptible
+ }
+
+ /**
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g.
+ * `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
+ */
+ fun language(language: String) = language(JsonField.of(language))
+
+ /**
+ * Sets [Builder.language] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.language] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun language(language: JsonField) = apply { this.language = language }
+
+ /** Hard limit on call length in minutes. The call ends automatically when reached. */
+ fun maxCallDurationMinutes(maxCallDurationMinutes: Long) =
+ maxCallDurationMinutes(JsonField.of(maxCallDurationMinutes))
+
+ /**
+ * Sets [Builder.maxCallDurationMinutes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.maxCallDurationMinutes] with a well-typed [Long]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun maxCallDurationMinutes(maxCallDurationMinutes: JsonField) = apply {
+ this.maxCallDurationMinutes = maxCallDurationMinutes
+ }
+
+ /** How long the agent waits during silence before ending the call. */
+ fun maxIdleSeconds(maxIdleSeconds: Long) = maxIdleSeconds(JsonField.of(maxIdleSeconds))
+
+ /**
+ * Sets [Builder.maxIdleSeconds] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.maxIdleSeconds] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun maxIdleSeconds(maxIdleSeconds: JsonField) = apply {
+ this.maxIdleSeconds = maxIdleSeconds
+ }
+
+ /**
+ * Model that runs the conversation, co-located in the voice network for lowest latency.
+ * Independent of the model used for text messaging. Derived from the agent's text model
+ * when omitted.
+ */
+ fun model(model: String) = model(JsonField.of(model))
+
+ /**
+ * Sets [Builder.model] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.model] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun model(model: JsonField) = apply { this.model = model }
+
+ /** Whether the call audio is recorded. */
+ fun recordCalls(recordCalls: Boolean) = recordCalls(JsonField.of(recordCalls))
+
+ /**
+ * Sets [Builder.recordCalls] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.recordCalls] with a well-typed [Boolean] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun recordCalls(recordCalls: JsonField) = apply {
+ this.recordCalls = recordCalls
+ }
+
+ /** Speech-recognition model. Uses the default when omitted. */
+ fun sttModel(sttModel: String) = sttModel(JsonField.of(sttModel))
+
+ /**
+ * Sets [Builder.sttModel] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.sttModel] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun sttModel(sttModel: JsonField) = apply { this.sttModel = sttModel }
+
+ /** Speech-recognition provider. Uses the default when omitted. */
+ fun sttProvider(sttProvider: String) = sttProvider(JsonField.of(sttProvider))
+
+ /**
+ * Sets [Builder.sttProvider] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.sttProvider] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun sttProvider(sttProvider: JsonField) = apply {
+ this.sttProvider = sttProvider
+ }
+
+ /**
+ * E.164 phone number the agent can transfer the call to. When set, the agent is given a
+ * transfer tool it can use to hand the call to a human.
+ */
+ fun transferPhoneNumber(transferPhoneNumber: String) =
+ transferPhoneNumber(JsonField.of(transferPhoneNumber))
+
+ /**
+ * Sets [Builder.transferPhoneNumber] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.transferPhoneNumber] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun transferPhoneNumber(transferPhoneNumber: JsonField) = apply {
+ this.transferPhoneNumber = transferPhoneNumber
+ }
+
+ /** Speech-synthesis provider. Uses the default when omitted. */
+ fun ttsProvider(ttsProvider: String) = ttsProvider(JsonField.of(ttsProvider))
+
+ /**
+ * Sets [Builder.ttsProvider] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.ttsProvider] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun ttsProvider(ttsProvider: JsonField) = apply {
+ this.ttsProvider = ttsProvider
+ }
+
+ /**
+ * Identifier of the synthesized voice that speaks. Choose from the voices available in
+ * the dashboard. Uses a neutral default when omitted.
+ */
+ fun ttsVoiceId(ttsVoiceId: String) = ttsVoiceId(JsonField.of(ttsVoiceId))
+
+ /**
+ * Sets [Builder.ttsVoiceId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.ttsVoiceId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun ttsVoiceId(ttsVoiceId: JsonField) = apply { this.ttsVoiceId = ttsVoiceId }
+
+ /**
+ * What the agent does when an answering machine or voicemail is detected on an outbound
+ * call.
+ */
+ fun voicemailAction(voicemailAction: VoicemailAction) =
+ voicemailAction(JsonField.of(voicemailAction))
+
+ /**
+ * Sets [Builder.voicemailAction] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voicemailAction] with a well-typed [VoicemailAction]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun voicemailAction(voicemailAction: JsonField) = apply {
+ this.voicemailAction = voicemailAction
+ }
+
+ /**
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to `greeting`
+ * when omitted.
+ */
+ fun voicemailMessage(voicemailMessage: String) =
+ voicemailMessage(JsonField.of(voicemailMessage))
+
+ /**
+ * Sets [Builder.voicemailMessage] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voicemailMessage] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun voicemailMessage(voicemailMessage: JsonField) = apply {
+ this.voicemailMessage = voicemailMessage
+ }
+
+ /**
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
+ * ignored by the others.
+ */
+ fun voiceSpeed(voiceSpeed: Double) = voiceSpeed(JsonField.of(voiceSpeed))
+
+ /**
+ * Sets [Builder.voiceSpeed] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voiceSpeed] with a well-typed [Double] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun voiceSpeed(voiceSpeed: JsonField) = apply { this.voiceSpeed = voiceSpeed }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Voice].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .enabled()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Voice =
+ Voice(
+ checkRequired("enabled", enabled),
+ greeting,
+ greetings,
+ interruptible,
+ language,
+ maxCallDurationMinutes,
+ maxIdleSeconds,
+ model,
+ recordCalls,
+ sttModel,
+ sttProvider,
+ transferPhoneNumber,
+ ttsProvider,
+ ttsVoiceId,
+ voicemailAction,
+ voicemailMessage,
+ voiceSpeed,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws ZavudevInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Voice = apply {
+ if (validated) {
+ return@apply
+ }
+
+ enabled()
+ greeting()
+ greetings().ifPresent { it.validate() }
+ interruptible()
+ language()
+ maxCallDurationMinutes()
+ maxIdleSeconds()
+ model()
+ recordCalls()
+ sttModel()
+ sttProvider()
+ transferPhoneNumber()
+ ttsProvider()
+ ttsVoiceId()
+ voicemailAction().ifPresent { it.validate() }
+ voicemailMessage()
+ voiceSpeed()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: ZavudevInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (enabled.asKnown().isPresent) 1 else 0) +
+ (if (greeting.asKnown().isPresent) 1 else 0) +
+ (greetings.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (interruptible.asKnown().isPresent) 1 else 0) +
+ (if (language.asKnown().isPresent) 1 else 0) +
+ (if (maxCallDurationMinutes.asKnown().isPresent) 1 else 0) +
+ (if (maxIdleSeconds.asKnown().isPresent) 1 else 0) +
+ (if (model.asKnown().isPresent) 1 else 0) +
+ (if (recordCalls.asKnown().isPresent) 1 else 0) +
+ (if (sttModel.asKnown().isPresent) 1 else 0) +
+ (if (sttProvider.asKnown().isPresent) 1 else 0) +
+ (if (transferPhoneNumber.asKnown().isPresent) 1 else 0) +
+ (if (ttsProvider.asKnown().isPresent) 1 else 0) +
+ (if (ttsVoiceId.asKnown().isPresent) 1 else 0) +
+ (voicemailAction.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (voicemailMessage.asKnown().isPresent) 1 else 0) +
+ (if (voiceSpeed.asKnown().isPresent) 1 else 0)
+
+ /**
+ * Greeting per language, keyed by language code. Used when the caller's language differs
+ * from the one `greeting` is written in.
+ */
+ class Greetings
+ @JsonCreator
+ private constructor(
+ @com.fasterxml.jackson.annotation.JsonValue
+ private val additionalProperties: Map
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [Greetings]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Greetings]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(greetings: Greetings) = apply {
+ additionalProperties = greetings.additionalProperties.toMutableMap()
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Greetings].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Greetings = Greetings(additionalProperties.toImmutable())
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws ZavudevInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
+ fun validate(): Greetings = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: ZavudevInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Greetings && additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "Greetings{additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * What the agent does when an answering machine or voicemail is detected on an outbound
+ * call.
+ */
+ class VoicemailAction
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is
+ * on an older version than the API, then the API may respond with new members that the
+ * SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val HANGUP = of("hangup")
+
+ @JvmField val LEAVE_MESSAGE = of("leave_message")
+
+ @JvmStatic fun of(value: String) = VoicemailAction(JsonField.of(value))
+ }
+
+ /** An enum containing [VoicemailAction]'s known values. */
+ enum class Known {
+ HANGUP,
+ LEAVE_MESSAGE,
+ }
+
+ /**
+ * An enum containing [VoicemailAction]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [VoicemailAction] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if
+ * the SDK is on an older version than the API, then the API may respond with new
+ * members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ HANGUP,
+ LEAVE_MESSAGE,
+ /**
+ * An enum member indicating that [VoicemailAction] was instantiated with an unknown
+ * value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you
+ * want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ HANGUP -> Value.HANGUP
+ LEAVE_MESSAGE -> Value.LEAVE_MESSAGE
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and
+ * don't want to throw for the unknown case.
+ *
+ * @throws ZavudevInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ HANGUP -> Known.HANGUP
+ LEAVE_MESSAGE -> Known.LEAVE_MESSAGE
+ else -> throw ZavudevInvalidDataException("Unknown VoicemailAction: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for
+ * debugging and generally doesn't throw.
+ *
+ * @throws ZavudevInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ ZavudevInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws ZavudevInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
+ fun validate(): VoicemailAction = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: ZavudevInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is VoicemailAction && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Voice &&
+ enabled == other.enabled &&
+ greeting == other.greeting &&
+ greetings == other.greetings &&
+ interruptible == other.interruptible &&
+ language == other.language &&
+ maxCallDurationMinutes == other.maxCallDurationMinutes &&
+ maxIdleSeconds == other.maxIdleSeconds &&
+ model == other.model &&
+ recordCalls == other.recordCalls &&
+ sttModel == other.sttModel &&
+ sttProvider == other.sttProvider &&
+ transferPhoneNumber == other.transferPhoneNumber &&
+ ttsProvider == other.ttsProvider &&
+ ttsVoiceId == other.ttsVoiceId &&
+ voicemailAction == other.voicemailAction &&
+ voicemailMessage == other.voicemailMessage &&
+ voiceSpeed == other.voiceSpeed &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ enabled,
+ greeting,
+ greetings,
+ interruptible,
+ language,
+ maxCallDurationMinutes,
+ maxIdleSeconds,
+ model,
+ recordCalls,
+ sttModel,
+ sttProvider,
+ transferPhoneNumber,
+ ttsProvider,
+ ttsVoiceId,
+ voicemailAction,
+ voicemailMessage,
+ voiceSpeed,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Voice{enabled=$enabled, greeting=$greeting, greetings=$greetings, interruptible=$interruptible, language=$language, maxCallDurationMinutes=$maxCallDurationMinutes, maxIdleSeconds=$maxIdleSeconds, model=$model, recordCalls=$recordCalls, sttModel=$sttModel, sttProvider=$sttProvider, transferPhoneNumber=$transferPhoneNumber, ttsProvider=$ttsProvider, ttsVoiceId=$ttsVoiceId, voicemailAction=$voicemailAction, voicemailMessage=$voicemailMessage, voiceSpeed=$voiceSpeed, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AgentCreateParams &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "AgentCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentCreateResponse.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentCreateResponse.kt
new file mode 100644
index 0000000..da8ff91
--- /dev/null
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentCreateResponse.kt
@@ -0,0 +1,180 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.zavudev.api.models.agents
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.zavudev.api.core.ExcludeMissing
+import com.zavudev.api.core.JsonField
+import com.zavudev.api.core.JsonMissing
+import com.zavudev.api.core.JsonValue
+import com.zavudev.api.core.checkRequired
+import com.zavudev.api.errors.ZavudevInvalidDataException
+import com.zavudev.api.models.senders.agent.Agent
+import java.util.Collections
+import java.util.Objects
+import kotlin.jvm.optionals.getOrNull
+
+class AgentCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val agent: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("agent") @ExcludeMissing agent: JsonField = JsonMissing.of()
+ ) : this(agent, mutableMapOf())
+
+ /**
+ * AI Agent configuration for a sender.
+ *
+ * @throws ZavudevInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun agent(): Agent = agent.getRequired("agent")
+
+ /**
+ * Returns the raw JSON value of [agent].
+ *
+ * Unlike [agent], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("agent") @ExcludeMissing fun _agent(): JsonField = agent
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AgentCreateResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .agent()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AgentCreateResponse]. */
+ class Builder internal constructor() {
+
+ private var agent: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(agentCreateResponse: AgentCreateResponse) = apply {
+ agent = agentCreateResponse.agent
+ additionalProperties = agentCreateResponse.additionalProperties.toMutableMap()
+ }
+
+ /** AI Agent configuration for a sender. */
+ fun agent(agent: Agent) = agent(JsonField.of(agent))
+
+ /**
+ * Sets [Builder.agent] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.agent] with a well-typed [Agent] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun agent(agent: JsonField) = apply { this.agent = agent }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [AgentCreateResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .agent()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AgentCreateResponse =
+ AgentCreateResponse(checkRequired("agent", agent), additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws ZavudevInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): AgentCreateResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ agent().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: ZavudevInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = (agent.asKnown().getOrNull()?.validity() ?: 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AgentCreateResponse &&
+ agent == other.agent &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(agent, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AgentCreateResponse{agent=$agent, additionalProperties=$additionalProperties}"
+}
diff --git a/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentDeleteParams.kt b/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentDeleteParams.kt
new file mode 100644
index 0000000..955d72e
--- /dev/null
+++ b/zavudev-java-core/src/main/kotlin/com/zavudev/api/models/agents/AgentDeleteParams.kt
@@ -0,0 +1,229 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.zavudev.api.models.agents
+
+import com.zavudev.api.core.JsonValue
+import com.zavudev.api.core.Params
+import com.zavudev.api.core.http.Headers
+import com.zavudev.api.core.http.QueryParams
+import com.zavudev.api.core.toImmutable
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Delete an agent */
+class AgentDeleteParams
+private constructor(
+ private val agentId: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+ private val additionalBodyProperties: Map,
+) : Params {
+
+ fun agentId(): Optional = Optional.ofNullable(agentId)
+
+ /** Additional body properties to send with the request. */
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): AgentDeleteParams = builder().build()
+
+ /** Returns a mutable builder for constructing an instance of [AgentDeleteParams]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AgentDeleteParams]. */
+ class Builder internal constructor() {
+
+ private var agentId: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+ private var additionalBodyProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(agentDeleteParams: AgentDeleteParams) = apply {
+ agentId = agentDeleteParams.agentId
+ additionalHeaders = agentDeleteParams.additionalHeaders.toBuilder()
+ additionalQueryParams = agentDeleteParams.additionalQueryParams.toBuilder()
+ additionalBodyProperties = agentDeleteParams.additionalBodyProperties.toMutableMap()
+ }
+
+ fun agentId(agentId: String?) = apply { this.agentId = agentId }
+
+ /** Alias for calling [Builder.agentId] with `agentId.orElse(null)`. */
+ fun agentId(agentId: Optional