diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index dd4fc525c..4d6b09da1 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "6.29.0"
+ ".": "6.30.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 5be268d0c..bc43a0f0e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 975
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx%2Ftelnyx-dd7ad9ab732796305a9df0e8d9a179ade1da3fc61481e97b5cb32fc8b994ec3e.yml
-openapi_spec_hash: 181b2e53e84c5fc20c94655071723527
-config_hash: 5d71cbaf27f63f9d363f3007d99d52e9
+configured_endpoints: 990
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx%2Ftelnyx-c39f4809dcbdc6578bcbac6dee9201bf644b3ea726a177bad109dc1741bb1af7.yml
+openapi_spec_hash: 83778fa2320ecccb46e85201c47c6a26
+config_hash: b314a1db2a665ac943d39160db40c05d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6d3fd65f..4c759ed06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## 6.30.0 (2026-03-13)
+
+Full Changelog: [v6.29.0...v6.30.0](https://github.com/team-telnyx/telnyx-java/compare/v6.29.0...v6.30.0)
+
+### Features
+
+* add public x402 payment endpoints to external specs ([b7fd2ea](https://github.com/team-telnyx/telnyx-java/commit/b7fd2ea5a9b2a0db79343811989ff18a4b3bc045))
+* Add Voice Designs and Voice Clones API specification ([aa3b836](https://github.com/team-telnyx/telnyx-java/commit/aa3b83691821a2b4f6ee8b545e02790fc272d92b))
+* AI-2131: Add expressive_mode boolean to VoiceSettings ([7394919](https://github.com/team-telnyx/telnyx-java/commit/7394919715a13fdb079cf5c514cbae747a0faca6))
+* **api:** manual updates ([8ec5265](https://github.com/team-telnyx/telnyx-java/commit/8ec526546a542d94fdfbae12fc5a8013b37d90f4))
+* **api:** Merge pull request [#29](https://github.com/team-telnyx/telnyx-java/issues/29) from stainless-sdks/fix-add-voice-model ([d23bcc4](https://github.com/team-telnyx/telnyx-java/commit/d23bcc4e2a6a8f17b0b51d622e8bd0f96676cf56))
+* **api:** update OpenAPI spec or Stainless config ([d23bcc4](https://github.com/team-telnyx/telnyx-java/commit/d23bcc4e2a6a8f17b0b51d622e8bd0f96676cf56))
+
+
+### Bug Fixes
+
+* **call-recordings:** align OpenAPI spec with implementation ([57e7cae](https://github.com/team-telnyx/telnyx-java/commit/57e7cae9781f30c09498d7023b4993dfc9b0f422))
+
## 6.29.0 (2026-03-11)
Full Changelog: [v6.28.0...v6.29.0](https://github.com/team-telnyx/telnyx-java/compare/v6.28.0...v6.29.0)
diff --git a/README.md b/README.md
index 7f474ceea..2ba241ace 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.telnyx.sdk/telnyx/6.29.0)
+[](https://central.sonatype.com/artifact/com.telnyx.sdk/telnyx/6.30.0)
@@ -26,7 +26,7 @@ Use the Telnyx MCP Server to enable AI assistants to interact with this API, all
### Gradle
```kotlin
-implementation("com.telnyx.sdk:telnyx:6.29.0")
+implementation("com.telnyx.sdk:telnyx:6.30.0")
```
### Maven
@@ -35,7 +35,7 @@ implementation("com.telnyx.sdk:telnyx:6.29.0")
com.telnyx.sdk
telnyx
- 6.29.0
+ 6.30.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index a1f4c6bc3..1b9c9895b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,6 @@
allprojects {
group = "com.telnyx.sdk"
- version = "6.29.0" // x-release-please-version
+ version = "6.30.0" // x-release-please-version
}
subprojects {
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClient.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClient.kt
index f6d316302..46bd10599 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClient.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClient.kt
@@ -148,6 +148,8 @@ import com.telnyx.sdk.services.blocking.VerifiedNumberService
import com.telnyx.sdk.services.blocking.VerifyProfileService
import com.telnyx.sdk.services.blocking.VirtualCrossConnectService
import com.telnyx.sdk.services.blocking.VirtualCrossConnectsCoverageService
+import com.telnyx.sdk.services.blocking.VoiceCloneService
+import com.telnyx.sdk.services.blocking.VoiceDesignService
import com.telnyx.sdk.services.blocking.WebhookDeliveryService
import com.telnyx.sdk.services.blocking.WebhookService
import com.telnyx.sdk.services.blocking.WellKnownService
@@ -158,6 +160,7 @@ import com.telnyx.sdk.services.blocking.WireguardPeerService
import com.telnyx.sdk.services.blocking.WirelessBlocklistService
import com.telnyx.sdk.services.blocking.WirelessBlocklistValueService
import com.telnyx.sdk.services.blocking.WirelessService
+import com.telnyx.sdk.services.blocking.X402Service
import java.util.function.Consumer
/**
@@ -642,6 +645,14 @@ interface TelnyxClient {
/** Manage Whatsapp message templates */
fun whatsappMessageTemplates(): WhatsappMessageTemplateService
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ fun voiceClones(): VoiceCloneService
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ fun voiceDesigns(): VoiceDesignService
+
+ fun x402(): X402Service
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -1111,5 +1122,13 @@ interface TelnyxClient {
/** Manage Whatsapp message templates */
fun whatsappMessageTemplates(): WhatsappMessageTemplateService.WithRawResponse
+
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ fun voiceClones(): VoiceCloneService.WithRawResponse
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ fun voiceDesigns(): VoiceDesignService.WithRawResponse
+
+ fun x402(): X402Service.WithRawResponse
}
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsync.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsync.kt
index d40aca647..48e0f2f22 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsync.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsync.kt
@@ -148,6 +148,8 @@ import com.telnyx.sdk.services.async.VerifiedNumberServiceAsync
import com.telnyx.sdk.services.async.VerifyProfileServiceAsync
import com.telnyx.sdk.services.async.VirtualCrossConnectServiceAsync
import com.telnyx.sdk.services.async.VirtualCrossConnectsCoverageServiceAsync
+import com.telnyx.sdk.services.async.VoiceCloneServiceAsync
+import com.telnyx.sdk.services.async.VoiceDesignServiceAsync
import com.telnyx.sdk.services.async.WebhookDeliveryServiceAsync
import com.telnyx.sdk.services.async.WebhookServiceAsync
import com.telnyx.sdk.services.async.WellKnownServiceAsync
@@ -158,6 +160,7 @@ import com.telnyx.sdk.services.async.WireguardPeerServiceAsync
import com.telnyx.sdk.services.async.WirelessBlocklistServiceAsync
import com.telnyx.sdk.services.async.WirelessBlocklistValueServiceAsync
import com.telnyx.sdk.services.async.WirelessServiceAsync
+import com.telnyx.sdk.services.async.X402ServiceAsync
import java.util.function.Consumer
/**
@@ -642,6 +645,14 @@ interface TelnyxClientAsync {
/** Manage Whatsapp message templates */
fun whatsappMessageTemplates(): WhatsappMessageTemplateServiceAsync
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ fun voiceClones(): VoiceCloneServiceAsync
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ fun voiceDesigns(): VoiceDesignServiceAsync
+
+ fun x402(): X402ServiceAsync
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -1114,5 +1125,13 @@ interface TelnyxClientAsync {
/** Manage Whatsapp message templates */
fun whatsappMessageTemplates(): WhatsappMessageTemplateServiceAsync.WithRawResponse
+
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ fun voiceClones(): VoiceCloneServiceAsync.WithRawResponse
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ fun voiceDesigns(): VoiceDesignServiceAsync.WithRawResponse
+
+ fun x402(): X402ServiceAsync.WithRawResponse
}
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsyncImpl.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsyncImpl.kt
index b3aed03d1..4c27f1dd2 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsyncImpl.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientAsyncImpl.kt
@@ -294,6 +294,10 @@ import com.telnyx.sdk.services.async.VirtualCrossConnectServiceAsync
import com.telnyx.sdk.services.async.VirtualCrossConnectServiceAsyncImpl
import com.telnyx.sdk.services.async.VirtualCrossConnectsCoverageServiceAsync
import com.telnyx.sdk.services.async.VirtualCrossConnectsCoverageServiceAsyncImpl
+import com.telnyx.sdk.services.async.VoiceCloneServiceAsync
+import com.telnyx.sdk.services.async.VoiceCloneServiceAsyncImpl
+import com.telnyx.sdk.services.async.VoiceDesignServiceAsync
+import com.telnyx.sdk.services.async.VoiceDesignServiceAsyncImpl
import com.telnyx.sdk.services.async.WebhookDeliveryServiceAsync
import com.telnyx.sdk.services.async.WebhookDeliveryServiceAsyncImpl
import com.telnyx.sdk.services.async.WebhookServiceAsync
@@ -314,6 +318,8 @@ import com.telnyx.sdk.services.async.WirelessBlocklistValueServiceAsync
import com.telnyx.sdk.services.async.WirelessBlocklistValueServiceAsyncImpl
import com.telnyx.sdk.services.async.WirelessServiceAsync
import com.telnyx.sdk.services.async.WirelessServiceAsyncImpl
+import com.telnyx.sdk.services.async.X402ServiceAsync
+import com.telnyx.sdk.services.async.X402ServiceAsyncImpl
import java.util.function.Consumer
class TelnyxClientAsyncImpl(private val clientOptions: ClientOptions) : TelnyxClientAsync {
@@ -938,6 +944,16 @@ class TelnyxClientAsyncImpl(private val clientOptions: ClientOptions) : TelnyxCl
WhatsappMessageTemplateServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val voiceClones: VoiceCloneServiceAsync by lazy {
+ VoiceCloneServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val voiceDesigns: VoiceDesignServiceAsync by lazy {
+ VoiceDesignServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val x402: X402ServiceAsync by lazy { X402ServiceAsyncImpl(clientOptionsWithUserAgent) }
+
override fun sync(): TelnyxClient = sync
override fun withRawResponse(): TelnyxClientAsync.WithRawResponse = withRawResponse
@@ -1420,6 +1436,14 @@ class TelnyxClientAsyncImpl(private val clientOptions: ClientOptions) : TelnyxCl
override fun whatsappMessageTemplates(): WhatsappMessageTemplateServiceAsync =
whatsappMessageTemplates
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ override fun voiceClones(): VoiceCloneServiceAsync = voiceClones
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ override fun voiceDesigns(): VoiceDesignServiceAsync = voiceDesigns
+
+ override fun x402(): X402ServiceAsync = x402
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -2081,6 +2105,18 @@ class TelnyxClientAsyncImpl(private val clientOptions: ClientOptions) : TelnyxCl
WhatsappMessageTemplateServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val voiceClones: VoiceCloneServiceAsync.WithRawResponse by lazy {
+ VoiceCloneServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val voiceDesigns: VoiceDesignServiceAsync.WithRawResponse by lazy {
+ VoiceDesignServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val x402: X402ServiceAsync.WithRawResponse by lazy {
+ X402ServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): TelnyxClientAsync.WithRawResponse =
@@ -2611,5 +2647,13 @@ class TelnyxClientAsyncImpl(private val clientOptions: ClientOptions) : TelnyxCl
/** Manage Whatsapp message templates */
override fun whatsappMessageTemplates():
WhatsappMessageTemplateServiceAsync.WithRawResponse = whatsappMessageTemplates
+
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ override fun voiceClones(): VoiceCloneServiceAsync.WithRawResponse = voiceClones
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ override fun voiceDesigns(): VoiceDesignServiceAsync.WithRawResponse = voiceDesigns
+
+ override fun x402(): X402ServiceAsync.WithRawResponse = x402
}
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientImpl.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientImpl.kt
index 5fe595600..452ca3bae 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientImpl.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/client/TelnyxClientImpl.kt
@@ -294,6 +294,10 @@ import com.telnyx.sdk.services.blocking.VirtualCrossConnectService
import com.telnyx.sdk.services.blocking.VirtualCrossConnectServiceImpl
import com.telnyx.sdk.services.blocking.VirtualCrossConnectsCoverageService
import com.telnyx.sdk.services.blocking.VirtualCrossConnectsCoverageServiceImpl
+import com.telnyx.sdk.services.blocking.VoiceCloneService
+import com.telnyx.sdk.services.blocking.VoiceCloneServiceImpl
+import com.telnyx.sdk.services.blocking.VoiceDesignService
+import com.telnyx.sdk.services.blocking.VoiceDesignServiceImpl
import com.telnyx.sdk.services.blocking.WebhookDeliveryService
import com.telnyx.sdk.services.blocking.WebhookDeliveryServiceImpl
import com.telnyx.sdk.services.blocking.WebhookService
@@ -314,6 +318,8 @@ import com.telnyx.sdk.services.blocking.WirelessBlocklistValueService
import com.telnyx.sdk.services.blocking.WirelessBlocklistValueServiceImpl
import com.telnyx.sdk.services.blocking.WirelessService
import com.telnyx.sdk.services.blocking.WirelessServiceImpl
+import com.telnyx.sdk.services.blocking.X402Service
+import com.telnyx.sdk.services.blocking.X402ServiceImpl
import java.util.function.Consumer
class TelnyxClientImpl(private val clientOptions: ClientOptions) : TelnyxClient {
@@ -896,6 +902,16 @@ class TelnyxClientImpl(private val clientOptions: ClientOptions) : TelnyxClient
WhatsappMessageTemplateServiceImpl(clientOptionsWithUserAgent)
}
+ private val voiceClones: VoiceCloneService by lazy {
+ VoiceCloneServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val voiceDesigns: VoiceDesignService by lazy {
+ VoiceDesignServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val x402: X402Service by lazy { X402ServiceImpl(clientOptionsWithUserAgent) }
+
override fun async(): TelnyxClientAsync = async
override fun withRawResponse(): TelnyxClient.WithRawResponse = withRawResponse
@@ -1364,6 +1380,14 @@ class TelnyxClientImpl(private val clientOptions: ClientOptions) : TelnyxClient
override fun whatsappMessageTemplates(): WhatsappMessageTemplateService =
whatsappMessageTemplates
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ override fun voiceClones(): VoiceCloneService = voiceClones
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ override fun voiceDesigns(): VoiceDesignService = voiceDesigns
+
+ override fun x402(): X402Service = x402
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -2004,6 +2028,18 @@ class TelnyxClientImpl(private val clientOptions: ClientOptions) : TelnyxClient
WhatsappMessageTemplateServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val voiceClones: VoiceCloneService.WithRawResponse by lazy {
+ VoiceCloneServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val voiceDesigns: VoiceDesignService.WithRawResponse by lazy {
+ VoiceDesignServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val x402: X402Service.WithRawResponse by lazy {
+ X402ServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): TelnyxClient.WithRawResponse =
@@ -2521,5 +2557,13 @@ class TelnyxClientImpl(private val clientOptions: ClientOptions) : TelnyxClient
/** Manage Whatsapp message templates */
override fun whatsappMessageTemplates(): WhatsappMessageTemplateService.WithRawResponse =
whatsappMessageTemplates
+
+ /** Capture and manage voice identities as clones for use in text-to-speech synthesis. */
+ override fun voiceClones(): VoiceCloneService.WithRawResponse = voiceClones
+
+ /** Create and manage AI-generated voice designs using natural language prompts. */
+ override fun voiceDesigns(): VoiceDesignService.WithRawResponse = voiceDesigns
+
+ override fun x402(): X402Service.WithRawResponse = x402
}
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/ai/assistants/VoiceSettings.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/ai/assistants/VoiceSettings.kt
index 1430f6b74..195e634a8 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/ai/assistants/VoiceSettings.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/ai/assistants/VoiceSettings.kt
@@ -34,6 +34,7 @@ private constructor(
private val voice: JsonField,
private val apiKeyRef: JsonField,
private val backgroundAudio: JsonField,
+ private val expressiveMode: JsonField,
private val languageBoost: JsonField,
private val similarityBoost: JsonField,
private val speed: JsonField,
@@ -53,6 +54,9 @@ private constructor(
@JsonProperty("background_audio")
@ExcludeMissing
backgroundAudio: JsonField = JsonMissing.of(),
+ @JsonProperty("expressive_mode")
+ @ExcludeMissing
+ expressiveMode: JsonField = JsonMissing.of(),
@JsonProperty("language_boost")
@ExcludeMissing
languageBoost: JsonField = JsonMissing.of(),
@@ -74,6 +78,7 @@ private constructor(
voice,
apiKeyRef,
backgroundAudio,
+ expressiveMode,
languageBoost,
similarityBoost,
speed,
@@ -119,6 +124,16 @@ private constructor(
fun backgroundAudio(): Optional =
backgroundAudio.getOptional("background_audio")
+ /**
+ * Enables emotionally expressive speech using SSML emotion tags. When enabled, the assistant
+ * uses audio tags like angry, excited, content, and sad to add emotional nuance. Only supported
+ * for Telnyx Ultra voices.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun expressiveMode(): Optional = expressiveMode.getOptional("expressive_mode")
+
/**
* Enhances recognition for specific languages and dialects during MiniMax TTS synthesis.
* Default is null (no boost). Set to 'auto' for automatic language detection. Only applicable
@@ -208,6 +223,15 @@ private constructor(
@ExcludeMissing
fun _backgroundAudio(): JsonField = backgroundAudio
+ /**
+ * Returns the raw JSON value of [expressiveMode].
+ *
+ * Unlike [expressiveMode], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("expressive_mode")
+ @ExcludeMissing
+ fun _expressiveMode(): JsonField = expressiveMode
+
/**
* Returns the raw JSON value of [languageBoost].
*
@@ -294,6 +318,7 @@ private constructor(
private var voice: JsonField? = null
private var apiKeyRef: JsonField = JsonMissing.of()
private var backgroundAudio: JsonField = JsonMissing.of()
+ private var expressiveMode: JsonField = JsonMissing.of()
private var languageBoost: JsonField = JsonMissing.of()
private var similarityBoost: JsonField = JsonMissing.of()
private var speed: JsonField = JsonMissing.of()
@@ -308,6 +333,7 @@ private constructor(
voice = voiceSettings.voice
apiKeyRef = voiceSettings.apiKeyRef
backgroundAudio = voiceSettings.backgroundAudio
+ expressiveMode = voiceSettings.expressiveMode
languageBoost = voiceSettings.languageBoost
similarityBoost = voiceSettings.similarityBoost
speed = voiceSettings.speed
@@ -422,6 +448,24 @@ private constructor(
fun mediaNameBackgroundAudio(value: String) =
backgroundAudio(BackgroundAudio.MediaName.builder().value(value).build())
+ /**
+ * Enables emotionally expressive speech using SSML emotion tags. When enabled, the
+ * assistant uses audio tags like angry, excited, content, and sad to add emotional nuance.
+ * Only supported for Telnyx Ultra voices.
+ */
+ fun expressiveMode(expressiveMode: Boolean) = expressiveMode(JsonField.of(expressiveMode))
+
+ /**
+ * Sets [Builder.expressiveMode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expressiveMode] with a well-typed [Boolean] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun expressiveMode(expressiveMode: JsonField) = apply {
+ this.expressiveMode = expressiveMode
+ }
+
/**
* Enhances recognition for specific languages and dialects during MiniMax TTS synthesis.
* Default is null (no boost). Set to 'auto' for automatic language detection. Only
@@ -577,6 +621,7 @@ private constructor(
checkRequired("voice", voice),
apiKeyRef,
backgroundAudio,
+ expressiveMode,
languageBoost,
similarityBoost,
speed,
@@ -598,6 +643,7 @@ private constructor(
voice()
apiKeyRef()
backgroundAudio().ifPresent { it.validate() }
+ expressiveMode()
languageBoost().ifPresent { it.validate() }
similarityBoost()
speed()
@@ -626,6 +672,7 @@ private constructor(
(if (voice.asKnown().isPresent) 1 else 0) +
(if (apiKeyRef.asKnown().isPresent) 1 else 0) +
(backgroundAudio.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (expressiveMode.asKnown().isPresent) 1 else 0) +
(languageBoost.asKnown().getOrNull()?.validity() ?: 0) +
(if (similarityBoost.asKnown().isPresent) 1 else 0) +
(if (speed.asKnown().isPresent) 1 else 0) +
@@ -1972,6 +2019,7 @@ private constructor(
voice == other.voice &&
apiKeyRef == other.apiKeyRef &&
backgroundAudio == other.backgroundAudio &&
+ expressiveMode == other.expressiveMode &&
languageBoost == other.languageBoost &&
similarityBoost == other.similarityBoost &&
speed == other.speed &&
@@ -1987,6 +2035,7 @@ private constructor(
voice,
apiKeyRef,
backgroundAudio,
+ expressiveMode,
languageBoost,
similarityBoost,
speed,
@@ -2001,5 +2050,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "VoiceSettings{voice=$voice, apiKeyRef=$apiKeyRef, backgroundAudio=$backgroundAudio, languageBoost=$languageBoost, similarityBoost=$similarityBoost, speed=$speed, style=$style, temperature=$temperature, useSpeakerBoost=$useSpeakerBoost, voiceSpeed=$voiceSpeed, additionalProperties=$additionalProperties}"
+ "VoiceSettings{voice=$voice, apiKeyRef=$apiKeyRef, backgroundAudio=$backgroundAudio, expressiveMode=$expressiveMode, languageBoost=$languageBoost, similarityBoost=$similarityBoost, speed=$speed, style=$style, temperature=$temperature, useSpeakerBoost=$useSpeakerBoost, voiceSpeed=$voiceSpeed, additionalProperties=$additionalProperties}"
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingListParams.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingListParams.kt
index 35fd4a76d..6ba134cae 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingListParams.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingListParams.kt
@@ -19,11 +19,7 @@ private constructor(
private val additionalQueryParams: QueryParams,
) : Params {
- /**
- * Consolidated filter parameter (deepObject style). Originally: filter[conference_id],
- * filter[created_at][gte], filter[created_at][lte], filter[call_leg_id],
- * filter[call_session_id], filter[from], filter[to], filter[connection_id], filter[sip_call_id]
- */
+ /** Filter recordings by various attributes. */
fun filter(): Optional = Optional.ofNullable(filter)
fun pageNumber(): Optional = Optional.ofNullable(pageNumber)
@@ -64,12 +60,7 @@ private constructor(
additionalQueryParams = recordingListParams.additionalQueryParams.toBuilder()
}
- /**
- * Consolidated filter parameter (deepObject style). Originally: filter[conference_id],
- * filter[created_at][gte], filter[created_at][lte], filter[call_leg_id],
- * filter[call_session_id], filter[from], filter[to], filter[connection_id],
- * filter[sip_call_id]
- */
+ /** Filter recordings by various attributes. */
fun filter(filter: Filter?) = apply { this.filter = filter }
/** Alias for calling [Builder.filter] with `filter.orElse(null)`. */
@@ -218,9 +209,11 @@ private constructor(
QueryParams.builder()
.apply {
filter?.let {
+ it.callControlId().ifPresent { put("filter[call_control_id]", it) }
it.callLegId().ifPresent { put("filter[call_leg_id]", it) }
it.callSessionId().ifPresent { put("filter[call_session_id]", it) }
it.conferenceId().ifPresent { put("filter[conference_id]", it) }
+ it.conferenceRegion().ifPresent { put("filter[conference_region]", it) }
it.connectionId().ifPresent { put("filter[connection_id]", it) }
it.createdAt().ifPresent {
it.gte().ifPresent { put("filter[created_at][gte]", it) }
@@ -231,8 +224,26 @@ private constructor(
}
}
}
+ it.endTime().ifPresent {
+ it.gte().ifPresent { put("filter[end_time][gte]", it) }
+ it.lte().ifPresent { put("filter[end_time][lte]", it) }
+ it._additionalProperties().keys().forEach { key ->
+ it._additionalProperties().values(key).forEach { value ->
+ put("filter[end_time][$key]", value)
+ }
+ }
+ }
it.from().ifPresent { put("filter[from]", it) }
it.sipCallId().ifPresent { put("filter[sip_call_id]", it) }
+ it.startTime().ifPresent {
+ it.gte().ifPresent { put("filter[start_time][gte]", it) }
+ it.lte().ifPresent { put("filter[start_time][lte]", it) }
+ it._additionalProperties().keys().forEach { key ->
+ it._additionalProperties().values(key).forEach { value ->
+ put("filter[start_time][$key]", value)
+ }
+ }
+ }
it.to().ifPresent { put("filter[to]", it) }
it._additionalProperties().keys().forEach { key ->
it._additionalProperties().values(key).forEach { value ->
@@ -246,24 +257,27 @@ private constructor(
}
.build()
- /**
- * Consolidated filter parameter (deepObject style). Originally: filter[conference_id],
- * filter[created_at][gte], filter[created_at][lte], filter[call_leg_id],
- * filter[call_session_id], filter[from], filter[to], filter[connection_id], filter[sip_call_id]
- */
+ /** Filter recordings by various attributes. */
class Filter
private constructor(
+ private val callControlId: String?,
private val callLegId: String?,
private val callSessionId: String?,
private val conferenceId: String?,
+ private val conferenceRegion: String?,
private val connectionId: String?,
private val createdAt: CreatedAt?,
+ private val endTime: EndTime?,
private val from: String?,
private val sipCallId: String?,
+ private val startTime: StartTime?,
private val to: String?,
private val additionalProperties: QueryParams,
) {
+ /** If present, recordings will be filtered to those with a matching `call_control_id`. */
+ fun callControlId(): Optional = Optional.ofNullable(callControlId)
+
/** If present, recordings will be filtered to those with a matching call_leg_id. */
fun callLegId(): Optional = Optional.ofNullable(callLegId)
@@ -273,6 +287,9 @@ private constructor(
/** Returns only recordings associated with a given conference. */
fun conferenceId(): Optional = Optional.ofNullable(conferenceId)
+ /** If present, recordings will be filtered to those with a matching `conference_region`. */
+ fun conferenceRegion(): Optional = Optional.ofNullable(conferenceRegion)
+
/**
* If present, recordings will be filtered to those with a matching `connection_id`
* attribute (case-sensitive).
@@ -281,6 +298,8 @@ private constructor(
fun createdAt(): Optional = Optional.ofNullable(createdAt)
+ fun endTime(): Optional = Optional.ofNullable(endTime)
+
/**
* If present, recordings will be filtered to those with a matching `from` attribute
* (case-sensitive).
@@ -289,10 +308,12 @@ private constructor(
/**
* If present, recordings will be filtered to those with a matching `sip_call_id` attribute.
- * Matching is case-sensitive
+ * Matching is case-sensitive.
*/
fun sipCallId(): Optional = Optional.ofNullable(sipCallId)
+ fun startTime(): Optional = Optional.ofNullable(startTime)
+
/**
* If present, recordings will be filtered to those with a matching `to` attribute
* (case-sensitive).
@@ -313,29 +334,46 @@ private constructor(
/** A builder for [Filter]. */
class Builder internal constructor() {
+ private var callControlId: String? = null
private var callLegId: String? = null
private var callSessionId: String? = null
private var conferenceId: String? = null
+ private var conferenceRegion: String? = null
private var connectionId: String? = null
private var createdAt: CreatedAt? = null
+ private var endTime: EndTime? = null
private var from: String? = null
private var sipCallId: String? = null
+ private var startTime: StartTime? = null
private var to: String? = null
private var additionalProperties: QueryParams.Builder = QueryParams.builder()
@JvmSynthetic
internal fun from(filter: Filter) = apply {
+ callControlId = filter.callControlId
callLegId = filter.callLegId
callSessionId = filter.callSessionId
conferenceId = filter.conferenceId
+ conferenceRegion = filter.conferenceRegion
connectionId = filter.connectionId
createdAt = filter.createdAt
+ endTime = filter.endTime
from = filter.from
sipCallId = filter.sipCallId
+ startTime = filter.startTime
to = filter.to
additionalProperties = filter.additionalProperties.toBuilder()
}
+ /**
+ * If present, recordings will be filtered to those with a matching `call_control_id`.
+ */
+ fun callControlId(callControlId: String?) = apply { this.callControlId = callControlId }
+
+ /** Alias for calling [Builder.callControlId] with `callControlId.orElse(null)`. */
+ fun callControlId(callControlId: Optional) =
+ callControlId(callControlId.getOrNull())
+
/** If present, recordings will be filtered to those with a matching call_leg_id. */
fun callLegId(callLegId: String?) = apply { this.callLegId = callLegId }
@@ -356,6 +394,19 @@ private constructor(
fun conferenceId(conferenceId: Optional) =
conferenceId(conferenceId.getOrNull())
+ /**
+ * If present, recordings will be filtered to those with a matching `conference_region`.
+ */
+ fun conferenceRegion(conferenceRegion: String?) = apply {
+ this.conferenceRegion = conferenceRegion
+ }
+
+ /**
+ * Alias for calling [Builder.conferenceRegion] with `conferenceRegion.orElse(null)`.
+ */
+ fun conferenceRegion(conferenceRegion: Optional) =
+ conferenceRegion(conferenceRegion.getOrNull())
+
/**
* If present, recordings will be filtered to those with a matching `connection_id`
* attribute (case-sensitive).
@@ -371,6 +422,11 @@ private constructor(
/** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */
fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull())
+ fun endTime(endTime: EndTime?) = apply { this.endTime = endTime }
+
+ /** Alias for calling [Builder.endTime] with `endTime.orElse(null)`. */
+ fun endTime(endTime: Optional) = endTime(endTime.getOrNull())
+
/**
* If present, recordings will be filtered to those with a matching `from` attribute
* (case-sensitive).
@@ -382,13 +438,18 @@ private constructor(
/**
* If present, recordings will be filtered to those with a matching `sip_call_id`
- * attribute. Matching is case-sensitive
+ * attribute. Matching is case-sensitive.
*/
fun sipCallId(sipCallId: String?) = apply { this.sipCallId = sipCallId }
/** Alias for calling [Builder.sipCallId] with `sipCallId.orElse(null)`. */
fun sipCallId(sipCallId: Optional) = sipCallId(sipCallId.getOrNull())
+ fun startTime(startTime: StartTime?) = apply { this.startTime = startTime }
+
+ /** Alias for calling [Builder.startTime] with `startTime.orElse(null)`. */
+ fun startTime(startTime: Optional) = startTime(startTime.getOrNull())
+
/**
* If present, recordings will be filtered to those with a matching `to` attribute
* (case-sensitive).
@@ -454,13 +515,17 @@ private constructor(
*/
fun build(): Filter =
Filter(
+ callControlId,
callLegId,
callSessionId,
conferenceId,
+ conferenceRegion,
connectionId,
createdAt,
+ endTime,
from,
sipCallId,
+ startTime,
to,
additionalProperties.build(),
)
@@ -594,32 +659,320 @@ private constructor(
"CreatedAt{gte=$gte, lte=$lte, additionalProperties=$additionalProperties}"
}
+ class EndTime
+ private constructor(
+ private val gte: String?,
+ private val lte: String?,
+ private val additionalProperties: QueryParams,
+ ) {
+
+ /**
+ * Returns only recordings with an end time later than or equal to the given ISO 8601
+ * datetime.
+ */
+ fun gte(): Optional = Optional.ofNullable(gte)
+
+ /**
+ * Returns only recordings with an end time earlier than or equal to the given ISO 8601
+ * datetime.
+ */
+ fun lte(): Optional = Optional.ofNullable(lte)
+
+ /** Query params to send with the request. */
+ fun _additionalProperties(): QueryParams = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [EndTime]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [EndTime]. */
+ class Builder internal constructor() {
+
+ private var gte: String? = null
+ private var lte: String? = null
+ private var additionalProperties: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(endTime: EndTime) = apply {
+ gte = endTime.gte
+ lte = endTime.lte
+ additionalProperties = endTime.additionalProperties.toBuilder()
+ }
+
+ /**
+ * Returns only recordings with an end time later than or equal to the given ISO
+ * 8601 datetime.
+ */
+ fun gte(gte: String?) = apply { this.gte = gte }
+
+ /** Alias for calling [Builder.gte] with `gte.orElse(null)`. */
+ fun gte(gte: Optional) = gte(gte.getOrNull())
+
+ /**
+ * Returns only recordings with an end time earlier than or equal to the given ISO
+ * 8601 datetime.
+ */
+ fun lte(lte: String?) = apply { this.lte = lte }
+
+ /** Alias for calling [Builder.lte] with `lte.orElse(null)`. */
+ fun lte(lte: Optional) = lte(lte.getOrNull())
+
+ fun additionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun additionalProperties(additionalProperties: Map>) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: String) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.put(key, values)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun putAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
+
+ fun replaceAdditionalProperties(key: String, value: String) = apply {
+ additionalProperties.replace(key, value)
+ }
+
+ fun replaceAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.replace(key, values)
+ }
+
+ fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.replaceAll(additionalProperties)
+ }
+
+ fun replaceAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.replaceAll(additionalProperties) }
+
+ fun removeAdditionalProperties(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ additionalProperties.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [EndTime].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): EndTime = EndTime(gte, lte, additionalProperties.build())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is EndTime &&
+ gte == other.gte &&
+ lte == other.lte &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(gte, lte, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "EndTime{gte=$gte, lte=$lte, additionalProperties=$additionalProperties}"
+ }
+
+ class StartTime
+ private constructor(
+ private val gte: String?,
+ private val lte: String?,
+ private val additionalProperties: QueryParams,
+ ) {
+
+ /**
+ * Returns only recordings with a start time later than or equal to the given ISO 8601
+ * datetime.
+ */
+ fun gte(): Optional = Optional.ofNullable(gte)
+
+ /**
+ * Returns only recordings with a start time earlier than or equal to the given ISO 8601
+ * datetime.
+ */
+ fun lte(): Optional = Optional.ofNullable(lte)
+
+ /** Query params to send with the request. */
+ fun _additionalProperties(): QueryParams = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [StartTime]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [StartTime]. */
+ class Builder internal constructor() {
+
+ private var gte: String? = null
+ private var lte: String? = null
+ private var additionalProperties: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(startTime: StartTime) = apply {
+ gte = startTime.gte
+ lte = startTime.lte
+ additionalProperties = startTime.additionalProperties.toBuilder()
+ }
+
+ /**
+ * Returns only recordings with a start time later than or equal to the given ISO
+ * 8601 datetime.
+ */
+ fun gte(gte: String?) = apply { this.gte = gte }
+
+ /** Alias for calling [Builder.gte] with `gte.orElse(null)`. */
+ fun gte(gte: Optional) = gte(gte.getOrNull())
+
+ /**
+ * Returns only recordings with a start time earlier than or equal to the given ISO
+ * 8601 datetime.
+ */
+ fun lte(lte: String?) = apply { this.lte = lte }
+
+ /** Alias for calling [Builder.lte] with `lte.orElse(null)`. */
+ fun lte(lte: Optional) = lte(lte.getOrNull())
+
+ fun additionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun additionalProperties(additionalProperties: Map>) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: String) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.put(key, values)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun putAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
+
+ fun replaceAdditionalProperties(key: String, value: String) = apply {
+ additionalProperties.replace(key, value)
+ }
+
+ fun replaceAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.replace(key, values)
+ }
+
+ fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.replaceAll(additionalProperties)
+ }
+
+ fun replaceAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.replaceAll(additionalProperties) }
+
+ fun removeAdditionalProperties(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ additionalProperties.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [StartTime].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): StartTime = StartTime(gte, lte, additionalProperties.build())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is StartTime &&
+ gte == other.gte &&
+ lte == other.lte &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(gte, lte, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "StartTime{gte=$gte, lte=$lte, additionalProperties=$additionalProperties}"
+ }
+
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Filter &&
+ callControlId == other.callControlId &&
callLegId == other.callLegId &&
callSessionId == other.callSessionId &&
conferenceId == other.conferenceId &&
+ conferenceRegion == other.conferenceRegion &&
connectionId == other.connectionId &&
createdAt == other.createdAt &&
+ endTime == other.endTime &&
from == other.from &&
sipCallId == other.sipCallId &&
+ startTime == other.startTime &&
to == other.to &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
Objects.hash(
+ callControlId,
callLegId,
callSessionId,
conferenceId,
+ conferenceRegion,
connectionId,
createdAt,
+ endTime,
from,
sipCallId,
+ startTime,
to,
additionalProperties,
)
@@ -628,7 +981,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Filter{callLegId=$callLegId, callSessionId=$callSessionId, conferenceId=$conferenceId, connectionId=$connectionId, createdAt=$createdAt, from=$from, sipCallId=$sipCallId, to=$to, additionalProperties=$additionalProperties}"
+ "Filter{callControlId=$callControlId, callLegId=$callLegId, callSessionId=$callSessionId, conferenceId=$conferenceId, conferenceRegion=$conferenceRegion, connectionId=$connectionId, createdAt=$createdAt, endTime=$endTime, from=$from, sipCallId=$sipCallId, startTime=$startTime, to=$to, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingResponseData.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingResponseData.kt
index 2ea43d721..d9df7a167 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingResponseData.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/RecordingResponseData.kt
@@ -26,14 +26,18 @@ private constructor(
private val callSessionId: JsonField,
private val channels: JsonField,
private val conferenceId: JsonField,
+ private val connectionId: JsonField,
private val createdAt: JsonField,
private val downloadUrls: JsonField,
private val durationMillis: JsonField,
+ private val from: JsonField,
+ private val initiatedBy: JsonField,
private val recordType: JsonField,
private val recordingEndedAt: JsonField,
private val recordingStartedAt: JsonField,
private val source: JsonField,
private val status: JsonField,
+ private val to: JsonField,
private val updatedAt: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -54,6 +58,9 @@ private constructor(
@JsonProperty("conference_id")
@ExcludeMissing
conferenceId: JsonField = JsonMissing.of(),
+ @JsonProperty("connection_id")
+ @ExcludeMissing
+ connectionId: JsonField = JsonMissing.of(),
@JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(),
@JsonProperty("download_urls")
@ExcludeMissing
@@ -61,6 +68,10 @@ private constructor(
@JsonProperty("duration_millis")
@ExcludeMissing
durationMillis: JsonField = JsonMissing.of(),
+ @JsonProperty("from") @ExcludeMissing from: JsonField = JsonMissing.of(),
+ @JsonProperty("initiated_by")
+ @ExcludeMissing
+ initiatedBy: JsonField = JsonMissing.of(),
@JsonProperty("record_type")
@ExcludeMissing
recordType: JsonField = JsonMissing.of(),
@@ -72,6 +83,7 @@ private constructor(
recordingStartedAt: JsonField = JsonMissing.of(),
@JsonProperty("source") @ExcludeMissing source: JsonField = JsonMissing.of(),
@JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("to") @ExcludeMissing to: JsonField = JsonMissing.of(),
@JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(),
) : this(
id,
@@ -80,14 +92,18 @@ private constructor(
callSessionId,
channels,
conferenceId,
+ connectionId,
createdAt,
downloadUrls,
durationMillis,
+ from,
+ initiatedBy,
recordType,
recordingEndedAt,
recordingStartedAt,
source,
status,
+ to,
updatedAt,
mutableMapOf(),
)
@@ -142,6 +158,15 @@ private constructor(
*/
fun conferenceId(): Optional = conferenceId.getOptional("conference_id")
+ /**
+ * Identifies the Telnyx application (Call Control, TeXML) or SIP connection resource associated
+ * with this recording.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun connectionId(): Optional = connectionId.getOptional("connection_id")
+
/**
* ISO 8601 formatted date indicating when the resource was created.
*
@@ -166,6 +191,24 @@ private constructor(
*/
fun durationMillis(): Optional = durationMillis.getOptional("duration_millis")
+ /**
+ * The `from` (caller) number for the call that generated this recording.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun from(): Optional = from.getOptional("from")
+
+ /**
+ * Indicates what triggered the recording. Possible values include `DialVerb`, `Conference`,
+ * `OutboundAPI`, `Trunking`, `RecordVerb`, `StartCallRecordingAPI`,
+ * `StartConferenceRecordingAPI`.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun initiatedBy(): Optional = initiatedBy.getOptional("initiated_by")
+
/**
* @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -205,6 +248,14 @@ private constructor(
*/
fun status(): Optional = status.getOptional("status")
+ /**
+ * The `to` (callee) number for the call that generated this recording.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun to(): Optional = to.getOptional("to")
+
/**
* ISO 8601 formatted date indicating when the resource was updated.
*
@@ -261,6 +312,15 @@ private constructor(
@ExcludeMissing
fun _conferenceId(): JsonField = conferenceId
+ /**
+ * Returns the raw JSON value of [connectionId].
+ *
+ * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("connection_id")
+ @ExcludeMissing
+ fun _connectionId(): JsonField = connectionId
+
/**
* Returns the raw JSON value of [createdAt].
*
@@ -286,6 +346,22 @@ private constructor(
@ExcludeMissing
fun _durationMillis(): JsonField = durationMillis
+ /**
+ * Returns the raw JSON value of [from].
+ *
+ * Unlike [from], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("from") @ExcludeMissing fun _from(): JsonField = from
+
+ /**
+ * Returns the raw JSON value of [initiatedBy].
+ *
+ * Unlike [initiatedBy], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("initiated_by")
+ @ExcludeMissing
+ fun _initiatedBy(): JsonField = initiatedBy
+
/**
* Returns the raw JSON value of [recordType].
*
@@ -329,6 +405,13 @@ private constructor(
*/
@JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+ /**
+ * Returns the raw JSON value of [to].
+ *
+ * Unlike [to], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("to") @ExcludeMissing fun _to(): JsonField = to
+
/**
* Returns the raw JSON value of [updatedAt].
*
@@ -363,14 +446,18 @@ private constructor(
private var callSessionId: JsonField = JsonMissing.of()
private var channels: JsonField = JsonMissing.of()
private var conferenceId: JsonField = JsonMissing.of()
+ private var connectionId: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var downloadUrls: JsonField = JsonMissing.of()
private var durationMillis: JsonField = JsonMissing.of()
+ private var from: JsonField = JsonMissing.of()
+ private var initiatedBy: JsonField = JsonMissing.of()
private var recordType: JsonField = JsonMissing.of()
private var recordingEndedAt: JsonField = JsonMissing.of()
private var recordingStartedAt: JsonField = JsonMissing.of()
private var source: JsonField = JsonMissing.of()
private var status: JsonField = JsonMissing.of()
+ private var to: JsonField = JsonMissing.of()
private var updatedAt: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -382,14 +469,18 @@ private constructor(
callSessionId = recordingResponseData.callSessionId
channels = recordingResponseData.channels
conferenceId = recordingResponseData.conferenceId
+ connectionId = recordingResponseData.connectionId
createdAt = recordingResponseData.createdAt
downloadUrls = recordingResponseData.downloadUrls
durationMillis = recordingResponseData.durationMillis
+ from = recordingResponseData.from
+ initiatedBy = recordingResponseData.initiatedBy
recordType = recordingResponseData.recordType
recordingEndedAt = recordingResponseData.recordingEndedAt
recordingStartedAt = recordingResponseData.recordingStartedAt
source = recordingResponseData.source
status = recordingResponseData.status
+ to = recordingResponseData.to
updatedAt = recordingResponseData.updatedAt
additionalProperties = recordingResponseData.additionalProperties.toMutableMap()
}
@@ -478,6 +569,23 @@ private constructor(
this.conferenceId = conferenceId
}
+ /**
+ * Identifies the Telnyx application (Call Control, TeXML) or SIP connection resource
+ * associated with this recording.
+ */
+ fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId))
+
+ /**
+ * Sets [Builder.connectionId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.connectionId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun connectionId(connectionId: JsonField) = apply {
+ this.connectionId = connectionId
+ }
+
/** ISO 8601 formatted date indicating when the resource was created. */
fun createdAt(createdAt: String) = createdAt(JsonField.of(createdAt))
@@ -518,6 +626,33 @@ private constructor(
this.durationMillis = durationMillis
}
+ /** The `from` (caller) number for the call that generated this recording. */
+ fun from(from: String) = from(JsonField.of(from))
+
+ /**
+ * Sets [Builder.from] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.from] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun from(from: JsonField) = apply { this.from = from }
+
+ /**
+ * Indicates what triggered the recording. Possible values include `DialVerb`, `Conference`,
+ * `OutboundAPI`, `Trunking`, `RecordVerb`, `StartCallRecordingAPI`,
+ * `StartConferenceRecordingAPI`.
+ */
+ fun initiatedBy(initiatedBy: String) = initiatedBy(JsonField.of(initiatedBy))
+
+ /**
+ * Sets [Builder.initiatedBy] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.initiatedBy] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun initiatedBy(initiatedBy: JsonField) = apply { this.initiatedBy = initiatedBy }
+
fun recordType(recordType: RecordType) = recordType(JsonField.of(recordType))
/**
@@ -581,6 +716,17 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /** The `to` (callee) number for the call that generated this recording. */
+ fun to(to: String) = to(JsonField.of(to))
+
+ /**
+ * Sets [Builder.to] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.to] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun to(to: JsonField) = apply { this.to = to }
+
/** ISO 8601 formatted date indicating when the resource was updated. */
fun updatedAt(updatedAt: String) = updatedAt(JsonField.of(updatedAt))
@@ -625,14 +771,18 @@ private constructor(
callSessionId,
channels,
conferenceId,
+ connectionId,
createdAt,
downloadUrls,
durationMillis,
+ from,
+ initiatedBy,
recordType,
recordingEndedAt,
recordingStartedAt,
source,
status,
+ to,
updatedAt,
additionalProperties.toMutableMap(),
)
@@ -651,14 +801,18 @@ private constructor(
callSessionId()
channels().ifPresent { it.validate() }
conferenceId()
+ connectionId()
createdAt()
downloadUrls().ifPresent { it.validate() }
durationMillis()
+ from()
+ initiatedBy()
recordType().ifPresent { it.validate() }
recordingEndedAt()
recordingStartedAt()
source().ifPresent { it.validate() }
status().ifPresent { it.validate() }
+ to()
updatedAt()
validated = true
}
@@ -684,14 +838,18 @@ private constructor(
(if (callSessionId.asKnown().isPresent) 1 else 0) +
(channels.asKnown().getOrNull()?.validity() ?: 0) +
(if (conferenceId.asKnown().isPresent) 1 else 0) +
+ (if (connectionId.asKnown().isPresent) 1 else 0) +
(if (createdAt.asKnown().isPresent) 1 else 0) +
(downloadUrls.asKnown().getOrNull()?.validity() ?: 0) +
(if (durationMillis.asKnown().isPresent) 1 else 0) +
+ (if (from.asKnown().isPresent) 1 else 0) +
+ (if (initiatedBy.asKnown().isPresent) 1 else 0) +
(recordType.asKnown().getOrNull()?.validity() ?: 0) +
(if (recordingEndedAt.asKnown().isPresent) 1 else 0) +
(if (recordingStartedAt.asKnown().isPresent) 1 else 0) +
(source.asKnown().getOrNull()?.validity() ?: 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (to.asKnown().isPresent) 1 else 0) +
(if (updatedAt.asKnown().isPresent) 1 else 0)
/**
@@ -1378,14 +1536,18 @@ private constructor(
callSessionId == other.callSessionId &&
channels == other.channels &&
conferenceId == other.conferenceId &&
+ connectionId == other.connectionId &&
createdAt == other.createdAt &&
downloadUrls == other.downloadUrls &&
durationMillis == other.durationMillis &&
+ from == other.from &&
+ initiatedBy == other.initiatedBy &&
recordType == other.recordType &&
recordingEndedAt == other.recordingEndedAt &&
recordingStartedAt == other.recordingStartedAt &&
source == other.source &&
status == other.status &&
+ to == other.to &&
updatedAt == other.updatedAt &&
additionalProperties == other.additionalProperties
}
@@ -1398,14 +1560,18 @@ private constructor(
callSessionId,
channels,
conferenceId,
+ connectionId,
createdAt,
downloadUrls,
durationMillis,
+ from,
+ initiatedBy,
recordType,
recordingEndedAt,
recordingStartedAt,
source,
status,
+ to,
updatedAt,
additionalProperties,
)
@@ -1414,5 +1580,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "RecordingResponseData{id=$id, callControlId=$callControlId, callLegId=$callLegId, callSessionId=$callSessionId, channels=$channels, conferenceId=$conferenceId, createdAt=$createdAt, downloadUrls=$downloadUrls, durationMillis=$durationMillis, recordType=$recordType, recordingEndedAt=$recordingEndedAt, recordingStartedAt=$recordingStartedAt, source=$source, status=$status, updatedAt=$updatedAt, additionalProperties=$additionalProperties}"
+ "RecordingResponseData{id=$id, callControlId=$callControlId, callLegId=$callLegId, callSessionId=$callSessionId, channels=$channels, conferenceId=$conferenceId, connectionId=$connectionId, createdAt=$createdAt, downloadUrls=$downloadUrls, durationMillis=$durationMillis, from=$from, initiatedBy=$initiatedBy, recordType=$recordType, recordingEndedAt=$recordingEndedAt, recordingStartedAt=$recordingStartedAt, source=$source, status=$status, to=$to, updatedAt=$updatedAt, additionalProperties=$additionalProperties}"
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/actions/ActionDeleteResponse.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/actions/ActionDeleteResponse.kt
new file mode 100644
index 000000000..45c14b83e
--- /dev/null
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordings/actions/ActionDeleteResponse.kt
@@ -0,0 +1,274 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.telnyx.sdk.models.recordings.actions
+
+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.telnyx.sdk.core.Enum
+import com.telnyx.sdk.core.ExcludeMissing
+import com.telnyx.sdk.core.JsonField
+import com.telnyx.sdk.core.JsonMissing
+import com.telnyx.sdk.core.JsonValue
+import com.telnyx.sdk.errors.TelnyxInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class ActionDeleteResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val status: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of()
+ ) : this(status, mutableMapOf())
+
+ /**
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun status(): Optional = status.getOptional("status")
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ @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 [ActionDeleteResponse]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [ActionDeleteResponse]. */
+ class Builder internal constructor() {
+
+ private var status: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(actionDeleteResponse: ActionDeleteResponse) = apply {
+ status = actionDeleteResponse.status
+ additionalProperties = actionDeleteResponse.additionalProperties.toMutableMap()
+ }
+
+ fun status(status: Status) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [Status] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ 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 [ActionDeleteResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): ActionDeleteResponse =
+ ActionDeleteResponse(status, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): ActionDeleteResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ status().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: TelnyxInvalidDataException) {
+ 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 = (status.asKnown().getOrNull()?.validity() ?: 0)
+
+ class Status @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 OK = of("ok")
+
+ @JvmStatic fun of(value: String) = Status(JsonField.of(value))
+ }
+
+ /** An enum containing [Status]'s known values. */
+ enum class Known {
+ OK
+ }
+
+ /**
+ * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Status] 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 {
+ OK,
+ /** An enum member indicating that [Status] 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) {
+ OK -> Value.OK
+ 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 TelnyxInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ OK -> Known.OK
+ else -> throw TelnyxInvalidDataException("Unknown Status: $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 TelnyxInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { TelnyxInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ fun validate(): Status = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: TelnyxInvalidDataException) {
+ 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 Status && 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 ActionDeleteResponse &&
+ status == other.status &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(status, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "ActionDeleteResponse{status=$status, additionalProperties=$additionalProperties}"
+}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPage.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPage.kt
new file mode 100644
index 000000000..ae3f5d415
--- /dev/null
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPage.kt
@@ -0,0 +1,136 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.telnyx.sdk.models.recordingtranscriptions
+
+import com.telnyx.sdk.core.AutoPager
+import com.telnyx.sdk.core.Page
+import com.telnyx.sdk.core.checkRequired
+import com.telnyx.sdk.services.blocking.RecordingTranscriptionService
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrDefault
+import kotlin.jvm.optionals.getOrNull
+
+/** @see RecordingTranscriptionService.list */
+class RecordingTranscriptionListPage
+private constructor(
+ private val service: RecordingTranscriptionService,
+ private val params: RecordingTranscriptionListParams,
+ private val response: RecordingTranscriptionListPageResponse,
+) : Page {
+
+ /**
+ * Delegates to [RecordingTranscriptionListPageResponse], but gracefully handles missing data.
+ *
+ * @see RecordingTranscriptionListPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [RecordingTranscriptionListPageResponse], but gracefully handles missing data.
+ *
+ * @see RecordingTranscriptionListPageResponse.meta
+ */
+ fun meta(): Optional =
+ response._meta().getOptional("meta")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty()
+
+ fun nextPageParams(): RecordingTranscriptionListParams {
+ val pageNumber = params.pageNumber().getOrDefault(1)
+ return params.toBuilder().pageNumber(pageNumber + 1).build()
+ }
+
+ override fun nextPage(): RecordingTranscriptionListPage = service.list(nextPageParams())
+
+ fun autoPager(): AutoPager = AutoPager.from(this)
+
+ /** The parameters that were used to request this page. */
+ fun params(): RecordingTranscriptionListParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): RecordingTranscriptionListPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [RecordingTranscriptionListPage].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [RecordingTranscriptionListPage]. */
+ class Builder internal constructor() {
+
+ private var service: RecordingTranscriptionService? = null
+ private var params: RecordingTranscriptionListParams? = null
+ private var response: RecordingTranscriptionListPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(recordingTranscriptionListPage: RecordingTranscriptionListPage) = apply {
+ service = recordingTranscriptionListPage.service
+ params = recordingTranscriptionListPage.params
+ response = recordingTranscriptionListPage.response
+ }
+
+ fun service(service: RecordingTranscriptionService) = apply { this.service = service }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: RecordingTranscriptionListParams) = apply { this.params = params }
+
+ /** The response that this page was parsed from. */
+ fun response(response: RecordingTranscriptionListPageResponse) = apply {
+ this.response = response
+ }
+
+ /**
+ * Returns an immutable instance of [RecordingTranscriptionListPage].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): RecordingTranscriptionListPage =
+ RecordingTranscriptionListPage(
+ checkRequired("service", service),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is RecordingTranscriptionListPage &&
+ service == other.service &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, params, response)
+
+ override fun toString() =
+ "RecordingTranscriptionListPage{service=$service, params=$params, response=$response}"
+}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPageAsync.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPageAsync.kt
new file mode 100644
index 000000000..5d6b42b9a
--- /dev/null
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPageAsync.kt
@@ -0,0 +1,153 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.telnyx.sdk.models.recordingtranscriptions
+
+import com.telnyx.sdk.core.AutoPagerAsync
+import com.telnyx.sdk.core.PageAsync
+import com.telnyx.sdk.core.checkRequired
+import com.telnyx.sdk.services.async.RecordingTranscriptionServiceAsync
+import java.util.Objects
+import java.util.Optional
+import java.util.concurrent.CompletableFuture
+import java.util.concurrent.Executor
+import kotlin.jvm.optionals.getOrDefault
+import kotlin.jvm.optionals.getOrNull
+
+/** @see RecordingTranscriptionServiceAsync.list */
+class RecordingTranscriptionListPageAsync
+private constructor(
+ private val service: RecordingTranscriptionServiceAsync,
+ private val streamHandlerExecutor: Executor,
+ private val params: RecordingTranscriptionListParams,
+ private val response: RecordingTranscriptionListPageResponse,
+) : PageAsync {
+
+ /**
+ * Delegates to [RecordingTranscriptionListPageResponse], but gracefully handles missing data.
+ *
+ * @see RecordingTranscriptionListPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [RecordingTranscriptionListPageResponse], but gracefully handles missing data.
+ *
+ * @see RecordingTranscriptionListPageResponse.meta
+ */
+ fun meta(): Optional =
+ response._meta().getOptional("meta")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty()
+
+ fun nextPageParams(): RecordingTranscriptionListParams {
+ val pageNumber = params.pageNumber().getOrDefault(1)
+ return params.toBuilder().pageNumber(pageNumber + 1).build()
+ }
+
+ override fun nextPage(): CompletableFuture =
+ service.list(nextPageParams())
+
+ fun autoPager(): AutoPagerAsync =
+ AutoPagerAsync.from(this, streamHandlerExecutor)
+
+ /** The parameters that were used to request this page. */
+ fun params(): RecordingTranscriptionListParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): RecordingTranscriptionListPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [RecordingTranscriptionListPageAsync].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [RecordingTranscriptionListPageAsync]. */
+ class Builder internal constructor() {
+
+ private var service: RecordingTranscriptionServiceAsync? = null
+ private var streamHandlerExecutor: Executor? = null
+ private var params: RecordingTranscriptionListParams? = null
+ private var response: RecordingTranscriptionListPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(
+ recordingTranscriptionListPageAsync: RecordingTranscriptionListPageAsync
+ ) = apply {
+ service = recordingTranscriptionListPageAsync.service
+ streamHandlerExecutor = recordingTranscriptionListPageAsync.streamHandlerExecutor
+ params = recordingTranscriptionListPageAsync.params
+ response = recordingTranscriptionListPageAsync.response
+ }
+
+ fun service(service: RecordingTranscriptionServiceAsync) = apply { this.service = service }
+
+ fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
+ this.streamHandlerExecutor = streamHandlerExecutor
+ }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: RecordingTranscriptionListParams) = apply { this.params = params }
+
+ /** The response that this page was parsed from. */
+ fun response(response: RecordingTranscriptionListPageResponse) = apply {
+ this.response = response
+ }
+
+ /**
+ * Returns an immutable instance of [RecordingTranscriptionListPageAsync].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): RecordingTranscriptionListPageAsync =
+ RecordingTranscriptionListPageAsync(
+ checkRequired("service", service),
+ checkRequired("streamHandlerExecutor", streamHandlerExecutor),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is RecordingTranscriptionListPageAsync &&
+ service == other.service &&
+ streamHandlerExecutor == other.streamHandlerExecutor &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response)
+
+ override fun toString() =
+ "RecordingTranscriptionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
+}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListResponse.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPageResponse.kt
similarity index 94%
rename from telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListResponse.kt
rename to telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPageResponse.kt
index 2080fc1a6..745a12ce6 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListResponse.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListPageResponse.kt
@@ -19,7 +19,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
-class RecordingTranscriptionListResponse
+class RecordingTranscriptionListPageResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val data: JsonField>,
@@ -79,12 +79,12 @@ private constructor(
/**
* Returns a mutable builder for constructing an instance of
- * [RecordingTranscriptionListResponse].
+ * [RecordingTranscriptionListPageResponse].
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [RecordingTranscriptionListResponse]. */
+ /** A builder for [RecordingTranscriptionListPageResponse]. */
class Builder internal constructor() {
private var data: JsonField>? = null
@@ -92,13 +92,14 @@ private constructor(
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(recordingTranscriptionListResponse: RecordingTranscriptionListResponse) =
- apply {
- data = recordingTranscriptionListResponse.data.map { it.toMutableList() }
- meta = recordingTranscriptionListResponse.meta
- additionalProperties =
- recordingTranscriptionListResponse.additionalProperties.toMutableMap()
- }
+ internal fun from(
+ recordingTranscriptionListPageResponse: RecordingTranscriptionListPageResponse
+ ) = apply {
+ data = recordingTranscriptionListPageResponse.data.map { it.toMutableList() }
+ meta = recordingTranscriptionListPageResponse.meta
+ additionalProperties =
+ recordingTranscriptionListPageResponse.additionalProperties.toMutableMap()
+ }
fun data(data: List) = data(JsonField.of(data))
@@ -155,12 +156,12 @@ private constructor(
}
/**
- * Returns an immutable instance of [RecordingTranscriptionListResponse].
+ * Returns an immutable instance of [RecordingTranscriptionListPageResponse].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
- fun build(): RecordingTranscriptionListResponse =
- RecordingTranscriptionListResponse(
+ fun build(): RecordingTranscriptionListPageResponse =
+ RecordingTranscriptionListPageResponse(
(data ?: JsonMissing.of()).map { it.toImmutable() },
meta,
additionalProperties.toMutableMap(),
@@ -169,7 +170,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): RecordingTranscriptionListResponse = apply {
+ fun validate(): RecordingTranscriptionListPageResponse = apply {
if (validated) {
return@apply
}
@@ -412,7 +413,7 @@ private constructor(
return true
}
- return other is RecordingTranscriptionListResponse &&
+ return other is RecordingTranscriptionListPageResponse &&
data == other.data &&
meta == other.meta &&
additionalProperties == other.additionalProperties
@@ -423,5 +424,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "RecordingTranscriptionListResponse{data=$data, meta=$meta, additionalProperties=$additionalProperties}"
+ "RecordingTranscriptionListPageResponse{data=$data, meta=$meta, additionalProperties=$additionalProperties}"
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListParams.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListParams.kt
index b4984d631..af6d40ff5 100644
--- a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListParams.kt
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/recordingtranscriptions/RecordingTranscriptionListParams.kt
@@ -6,14 +6,26 @@ import com.telnyx.sdk.core.Params
import com.telnyx.sdk.core.http.Headers
import com.telnyx.sdk.core.http.QueryParams
import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
/** Returns a list of your recording transcriptions. */
class RecordingTranscriptionListParams
private constructor(
+ private val filter: Filter?,
+ private val pageNumber: Long?,
+ private val pageSize: Long?,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
) : Params {
+ /** Filter recording transcriptions by various attributes. */
+ fun filter(): Optional = Optional.ofNullable(filter)
+
+ fun pageNumber(): Optional = Optional.ofNullable(pageNumber)
+
+ fun pageSize(): Optional = Optional.ofNullable(pageSize)
+
/** Additional headers to send with the request. */
fun _additionalHeaders(): Headers = additionalHeaders
@@ -36,17 +48,53 @@ private constructor(
/** A builder for [RecordingTranscriptionListParams]. */
class Builder internal constructor() {
+ private var filter: Filter? = null
+ private var pageNumber: Long? = null
+ private var pageSize: Long? = null
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@JvmSynthetic
internal fun from(recordingTranscriptionListParams: RecordingTranscriptionListParams) =
apply {
+ filter = recordingTranscriptionListParams.filter
+ pageNumber = recordingTranscriptionListParams.pageNumber
+ pageSize = recordingTranscriptionListParams.pageSize
additionalHeaders = recordingTranscriptionListParams.additionalHeaders.toBuilder()
additionalQueryParams =
recordingTranscriptionListParams.additionalQueryParams.toBuilder()
}
+ /** Filter recording transcriptions by various attributes. */
+ fun filter(filter: Filter?) = apply { this.filter = filter }
+
+ /** Alias for calling [Builder.filter] with `filter.orElse(null)`. */
+ fun filter(filter: Optional) = filter(filter.getOrNull())
+
+ fun pageNumber(pageNumber: Long?) = apply { this.pageNumber = pageNumber }
+
+ /**
+ * Alias for [Builder.pageNumber].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun pageNumber(pageNumber: Long) = pageNumber(pageNumber as Long?)
+
+ /** Alias for calling [Builder.pageNumber] with `pageNumber.orElse(null)`. */
+ fun pageNumber(pageNumber: Optional) = pageNumber(pageNumber.getOrNull())
+
+ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize }
+
+ /**
+ * Alias for [Builder.pageSize].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun pageSize(pageSize: Long) = pageSize(pageSize as Long?)
+
+ /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */
+ fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull())
+
fun additionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.clear()
putAllAdditionalHeaders(additionalHeaders)
@@ -152,6 +200,9 @@ private constructor(
*/
fun build(): RecordingTranscriptionListParams =
RecordingTranscriptionListParams(
+ filter,
+ pageNumber,
+ pageSize,
additionalHeaders.build(),
additionalQueryParams.build(),
)
@@ -159,7 +210,293 @@ private constructor(
override fun _headers(): Headers = additionalHeaders
- override fun _queryParams(): QueryParams = additionalQueryParams
+ override fun _queryParams(): QueryParams =
+ QueryParams.builder()
+ .apply {
+ filter?.let {
+ it.createdAt().ifPresent {
+ it.gte().ifPresent { put("filter[created_at][gte]", it) }
+ it.lte().ifPresent { put("filter[created_at][lte]", it) }
+ it._additionalProperties().keys().forEach { key ->
+ it._additionalProperties().values(key).forEach { value ->
+ put("filter[created_at][$key]", value)
+ }
+ }
+ }
+ it.recordingId().ifPresent { put("filter[recording_id]", it) }
+ it._additionalProperties().keys().forEach { key ->
+ it._additionalProperties().values(key).forEach { value ->
+ put("filter[$key]", value)
+ }
+ }
+ }
+ pageNumber?.let { put("page[number]", it.toString()) }
+ pageSize?.let { put("page[size]", it.toString()) }
+ putAll(additionalQueryParams)
+ }
+ .build()
+
+ /** Filter recording transcriptions by various attributes. */
+ class Filter
+ private constructor(
+ private val createdAt: CreatedAt?,
+ private val recordingId: String?,
+ private val additionalProperties: QueryParams,
+ ) {
+
+ fun createdAt(): Optional = Optional.ofNullable(createdAt)
+
+ /**
+ * If present, transcriptions will be filtered to those associated with the given recording.
+ */
+ fun recordingId(): Optional = Optional.ofNullable(recordingId)
+
+ /** Query params to send with the request. */
+ fun _additionalProperties(): QueryParams = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [Filter]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Filter]. */
+ class Builder internal constructor() {
+
+ private var createdAt: CreatedAt? = null
+ private var recordingId: String? = null
+ private var additionalProperties: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(filter: Filter) = apply {
+ createdAt = filter.createdAt
+ recordingId = filter.recordingId
+ additionalProperties = filter.additionalProperties.toBuilder()
+ }
+
+ fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt }
+
+ /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */
+ fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull())
+
+ /**
+ * If present, transcriptions will be filtered to those associated with the given
+ * recording.
+ */
+ fun recordingId(recordingId: String?) = apply { this.recordingId = recordingId }
+
+ /** Alias for calling [Builder.recordingId] with `recordingId.orElse(null)`. */
+ fun recordingId(recordingId: Optional) = recordingId(recordingId.getOrNull())
+
+ fun additionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun additionalProperties(additionalProperties: Map>) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: String) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.put(key, values)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map>) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun replaceAdditionalProperties(key: String, value: String) = apply {
+ additionalProperties.replace(key, value)
+ }
+
+ fun replaceAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.replace(key, values)
+ }
+
+ fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.replaceAll(additionalProperties)
+ }
+
+ fun replaceAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.replaceAll(additionalProperties) }
+
+ fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ additionalProperties.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [Filter].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Filter = Filter(createdAt, recordingId, additionalProperties.build())
+ }
+
+ class CreatedAt
+ private constructor(
+ private val gte: String?,
+ private val lte: String?,
+ private val additionalProperties: QueryParams,
+ ) {
+
+ /** Returns only transcriptions created later than or at given ISO 8601 datetime. */
+ fun gte(): Optional = Optional.ofNullable(gte)
+
+ /** Returns only transcriptions created earlier than or at given ISO 8601 datetime. */
+ fun lte(): Optional = Optional.ofNullable(lte)
+
+ /** Query params to send with the request. */
+ fun _additionalProperties(): QueryParams = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [CreatedAt]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CreatedAt]. */
+ class Builder internal constructor() {
+
+ private var gte: String? = null
+ private var lte: String? = null
+ private var additionalProperties: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(createdAt: CreatedAt) = apply {
+ gte = createdAt.gte
+ lte = createdAt.lte
+ additionalProperties = createdAt.additionalProperties.toBuilder()
+ }
+
+ /** Returns only transcriptions created later than or at given ISO 8601 datetime. */
+ fun gte(gte: String?) = apply { this.gte = gte }
+
+ /** Alias for calling [Builder.gte] with `gte.orElse(null)`. */
+ fun gte(gte: Optional) = gte(gte.getOrNull())
+
+ /**
+ * Returns only transcriptions created earlier than or at given ISO 8601 datetime.
+ */
+ fun lte(lte: String?) = apply { this.lte = lte }
+
+ /** Alias for calling [Builder.lte] with `lte.orElse(null)`. */
+ fun lte(lte: Optional) = lte(lte.getOrNull())
+
+ fun additionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun additionalProperties(additionalProperties: Map>) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: String) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.put(key, values)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun putAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
+
+ fun replaceAdditionalProperties(key: String, value: String) = apply {
+ additionalProperties.replace(key, value)
+ }
+
+ fun replaceAdditionalProperties(key: String, values: Iterable) = apply {
+ additionalProperties.replace(key, values)
+ }
+
+ fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply {
+ this.additionalProperties.replaceAll(additionalProperties)
+ }
+
+ fun replaceAllAdditionalProperties(
+ additionalProperties: Map>
+ ) = apply { this.additionalProperties.replaceAll(additionalProperties) }
+
+ fun removeAdditionalProperties(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ additionalProperties.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [CreatedAt].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): CreatedAt = CreatedAt(gte, lte, additionalProperties.build())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CreatedAt &&
+ gte == other.gte &&
+ lte == other.lte &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(gte, lte, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "CreatedAt{gte=$gte, lte=$lte, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Filter &&
+ createdAt == other.createdAt &&
+ recordingId == other.recordingId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(createdAt, recordingId, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Filter{createdAt=$createdAt, recordingId=$recordingId, additionalProperties=$additionalProperties}"
+ }
override fun equals(other: Any?): Boolean {
if (this === other) {
@@ -167,12 +504,16 @@ private constructor(
}
return other is RecordingTranscriptionListParams &&
+ filter == other.filter &&
+ pageNumber == other.pageNumber &&
+ pageSize == other.pageSize &&
additionalHeaders == other.additionalHeaders &&
additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams)
+ override fun hashCode(): Int =
+ Objects.hash(filter, pageNumber, pageSize, additionalHeaders, additionalQueryParams)
override fun toString() =
- "RecordingTranscriptionListParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+ "RecordingTranscriptionListParams{filter=$filter, pageNumber=$pageNumber, pageSize=$pageSize, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/voiceclones/VoiceCloneCreateFromUploadParams.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/voiceclones/VoiceCloneCreateFromUploadParams.kt
new file mode 100644
index 000000000..e36b64128
--- /dev/null
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/voiceclones/VoiceCloneCreateFromUploadParams.kt
@@ -0,0 +1,923 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.telnyx.sdk.models.voiceclones
+
+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.telnyx.sdk.core.Enum
+import com.telnyx.sdk.core.ExcludeMissing
+import com.telnyx.sdk.core.JsonField
+import com.telnyx.sdk.core.JsonValue
+import com.telnyx.sdk.core.MultipartField
+import com.telnyx.sdk.core.Params
+import com.telnyx.sdk.core.checkRequired
+import com.telnyx.sdk.core.http.Headers
+import com.telnyx.sdk.core.http.QueryParams
+import com.telnyx.sdk.core.toImmutable
+import com.telnyx.sdk.errors.TelnyxInvalidDataException
+import java.io.InputStream
+import java.nio.file.Path
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.io.path.inputStream
+import kotlin.io.path.name
+
+/**
+ * Creates a new voice clone by uploading an audio file directly. Supported formats: WAV, MP3, FLAC,
+ * OGG, M4A. For best results, provide 5–10 seconds of clear speech. Maximum file size: 2MB.
+ */
+class VoiceCloneCreateFromUploadParams
+private constructor(
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For best
+ * quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ *
+ * @throws TelnyxInvalidDataException 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 audioFile(): InputStream = body.audioFile()
+
+ /**
+ * ISO 639-1 language code (e.g. `en`, `fr`) or `auto` for automatic detection.
+ *
+ * @throws TelnyxInvalidDataException 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 language(): String = body.language()
+
+ /**
+ * Name for the voice clone.
+ *
+ * @throws TelnyxInvalidDataException 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()
+
+ /**
+ * Gender of the voice clone.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun gender(): Optional = body.gender()
+
+ /**
+ * Optional custom label describing the voice style. If omitted, falls back to the source
+ * design's prompt text.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun label(): Optional = body.label()
+
+ /**
+ * Optional transcript of the audio file. Providing this improves clone quality.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun refText(): Optional = body.refText()
+
+ /**
+ * Returns the raw multipart value of [audioFile].
+ *
+ * Unlike [audioFile], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ fun _audioFile(): MultipartField = body._audioFile()
+
+ /**
+ * Returns the raw multipart value of [language].
+ *
+ * Unlike [language], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ fun _language(): MultipartField = body._language()
+
+ /**
+ * Returns the raw multipart value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ fun _name(): MultipartField = body._name()
+
+ /**
+ * Returns the raw multipart value of [gender].
+ *
+ * Unlike [gender], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ fun _gender(): MultipartField = body._gender()
+
+ /**
+ * Returns the raw multipart value of [label].
+ *
+ * Unlike [label], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ fun _label(): MultipartField = body._label()
+
+ /**
+ * Returns the raw multipart value of [refText].
+ *
+ * Unlike [refText], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ fun _refText(): MultipartField = body._refText()
+
+ 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
+ * [VoiceCloneCreateFromUploadParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .audioFile()
+ * .language()
+ * .name()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [VoiceCloneCreateFromUploadParams]. */
+ 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(voiceCloneCreateFromUploadParams: VoiceCloneCreateFromUploadParams) =
+ apply {
+ body = voiceCloneCreateFromUploadParams.body.toBuilder()
+ additionalHeaders = voiceCloneCreateFromUploadParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ voiceCloneCreateFromUploadParams.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:
+ * - [audioFile]
+ * - [language]
+ * - [name]
+ * - [gender]
+ * - [label]
+ * - etc.
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For best
+ * quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ */
+ fun audioFile(audioFile: InputStream) = apply { body.audioFile(audioFile) }
+
+ /**
+ * Sets [Builder.audioFile] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.audioFile] with a well-typed [InputStream] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun audioFile(audioFile: MultipartField) = apply { body.audioFile(audioFile) }
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For best
+ * quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ */
+ fun audioFile(audioFile: ByteArray) = apply { body.audioFile(audioFile) }
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For best
+ * quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ */
+ fun audioFile(path: Path) = apply { body.audioFile(path) }
+
+ /** ISO 639-1 language code (e.g. `en`, `fr`) or `auto` for automatic detection. */
+ fun language(language: String) = apply { body.language(language) }
+
+ /**
+ * Sets [Builder.language] to an arbitrary multipart 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: MultipartField) = apply { body.language(language) }
+
+ /** Name for the voice clone. */
+ fun name(name: String) = apply { body.name(name) }
+
+ /**
+ * Sets [Builder.name] to an arbitrary multipart 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: MultipartField) = apply { body.name(name) }
+
+ /** Gender of the voice clone. */
+ fun gender(gender: Gender) = apply { body.gender(gender) }
+
+ /**
+ * Sets [Builder.gender] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.gender] with a well-typed [Gender] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun gender(gender: MultipartField) = apply { body.gender(gender) }
+
+ /**
+ * Optional custom label describing the voice style. If omitted, falls back to the source
+ * design's prompt text.
+ */
+ fun label(label: String) = apply { body.label(label) }
+
+ /**
+ * Sets [Builder.label] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.label] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun label(label: MultipartField) = apply { body.label(label) }
+
+ /** Optional transcript of the audio file. Providing this improves clone quality. */
+ fun refText(refText: String) = apply { body.refText(refText) }
+
+ /**
+ * Sets [Builder.refText] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.refText] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun refText(refText: MultipartField) = apply { body.refText(refText) }
+
+ 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 [VoiceCloneCreateFromUploadParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .audioFile()
+ * .language()
+ * .name()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): VoiceCloneCreateFromUploadParams =
+ VoiceCloneCreateFromUploadParams(
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): Map> =
+ (mapOf(
+ "audio_file" to _audioFile(),
+ "language" to _language(),
+ "name" to _name(),
+ "gender" to _gender(),
+ "label" to _label(),
+ "ref_text" to _refText(),
+ ) + _additionalBodyProperties().mapValues { (_, value) -> MultipartField.of(value) })
+ .toImmutable()
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ /** Multipart form data for creating a voice clone from a direct audio upload. */
+ class Body
+ private constructor(
+ private val audioFile: MultipartField,
+ private val language: MultipartField,
+ private val name: MultipartField,
+ private val gender: MultipartField,
+ private val label: MultipartField,
+ private val refText: MultipartField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For best
+ * quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ *
+ * @throws TelnyxInvalidDataException 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 audioFile(): InputStream = audioFile.value.getRequired("audio_file")
+
+ /**
+ * ISO 639-1 language code (e.g. `en`, `fr`) or `auto` for automatic detection.
+ *
+ * @throws TelnyxInvalidDataException 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 language(): String = language.value.getRequired("language")
+
+ /**
+ * Name for the voice clone.
+ *
+ * @throws TelnyxInvalidDataException 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.value.getRequired("name")
+
+ /**
+ * Gender of the voice clone.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun gender(): Optional = gender.value.getOptional("gender")
+
+ /**
+ * Optional custom label describing the voice style. If omitted, falls back to the source
+ * design's prompt text.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun label(): Optional = label.value.getOptional("label")
+
+ /**
+ * Optional transcript of the audio file. Providing this improves clone quality.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun refText(): Optional = refText.value.getOptional("ref_text")
+
+ /**
+ * Returns the raw multipart value of [audioFile].
+ *
+ * Unlike [audioFile], this method doesn't throw if the multipart field has an unexpected
+ * type.
+ */
+ @JsonProperty("audio_file")
+ @ExcludeMissing
+ fun _audioFile(): MultipartField = audioFile
+
+ /**
+ * Returns the raw multipart value of [language].
+ *
+ * Unlike [language], this method doesn't throw if the multipart field has an unexpected
+ * type.
+ */
+ @JsonProperty("language") @ExcludeMissing fun _language(): MultipartField = language
+
+ /**
+ * Returns the raw multipart value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ @JsonProperty("name") @ExcludeMissing fun _name(): MultipartField = name
+
+ /**
+ * Returns the raw multipart value of [gender].
+ *
+ * Unlike [gender], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ @JsonProperty("gender") @ExcludeMissing fun _gender(): MultipartField = gender
+
+ /**
+ * Returns the raw multipart value of [label].
+ *
+ * Unlike [label], this method doesn't throw if the multipart field has an unexpected type.
+ */
+ @JsonProperty("label") @ExcludeMissing fun _label(): MultipartField = label
+
+ /**
+ * Returns the raw multipart value of [refText].
+ *
+ * Unlike [refText], this method doesn't throw if the multipart field has an unexpected
+ * type.
+ */
+ @JsonProperty("ref_text") @ExcludeMissing fun _refText(): MultipartField = refText
+
+ @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
+ * .audioFile()
+ * .language()
+ * .name()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var audioFile: MultipartField? = null
+ private var language: MultipartField? = null
+ private var name: MultipartField? = null
+ private var gender: MultipartField = MultipartField.of(null)
+ private var label: MultipartField = MultipartField.of(null)
+ private var refText: MultipartField = MultipartField.of(null)
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ audioFile = body.audioFile
+ language = body.language
+ name = body.name
+ gender = body.gender
+ label = body.label
+ refText = body.refText
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For
+ * best quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ */
+ fun audioFile(audioFile: InputStream) = audioFile(MultipartField.of(audioFile))
+
+ /**
+ * Sets [Builder.audioFile] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.audioFile] with a well-typed [InputStream] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun audioFile(audioFile: MultipartField) = apply {
+ this.audioFile = audioFile
+ }
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For
+ * best quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ */
+ fun audioFile(audioFile: ByteArray) = audioFile(audioFile.inputStream())
+
+ /**
+ * Audio file to clone the voice from. Supported formats: WAV, MP3, FLAC, OGG, M4A. For
+ * best quality, provide 5–10 seconds of clear, uninterrupted speech. Maximum size: 2MB.
+ */
+ fun audioFile(path: Path) =
+ audioFile(
+ MultipartField.builder()
+ .value(path.inputStream())
+ .filename(path.name)
+ .build()
+ )
+
+ /** ISO 639-1 language code (e.g. `en`, `fr`) or `auto` for automatic detection. */
+ fun language(language: String) = language(MultipartField.of(language))
+
+ /**
+ * Sets [Builder.language] to an arbitrary multipart 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: MultipartField) = apply { this.language = language }
+
+ /** Name for the voice clone. */
+ fun name(name: String) = name(MultipartField.of(name))
+
+ /**
+ * Sets [Builder.name] to an arbitrary multipart 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: MultipartField) = apply { this.name = name }
+
+ /** Gender of the voice clone. */
+ fun gender(gender: Gender) = gender(MultipartField.of(gender))
+
+ /**
+ * Sets [Builder.gender] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.gender] with a well-typed [Gender] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun gender(gender: MultipartField) = apply { this.gender = gender }
+
+ /**
+ * Optional custom label describing the voice style. If omitted, falls back to the
+ * source design's prompt text.
+ */
+ fun label(label: String) = label(MultipartField.of(label))
+
+ /**
+ * Sets [Builder.label] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.label] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun label(label: MultipartField) = apply { this.label = label }
+
+ /** Optional transcript of the audio file. Providing this improves clone quality. */
+ fun refText(refText: String) = refText(MultipartField.of(refText))
+
+ /**
+ * Sets [Builder.refText] to an arbitrary multipart value.
+ *
+ * You should usually call [Builder.refText] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun refText(refText: MultipartField) = apply { this.refText = refText }
+
+ 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
+ * .audioFile()
+ * .language()
+ * .name()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Body =
+ Body(
+ checkRequired("audioFile", audioFile),
+ checkRequired("language", language),
+ checkRequired("name", name),
+ gender,
+ label,
+ refText,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ audioFile()
+ language()
+ name()
+ gender().ifPresent { it.validate() }
+ label()
+ refText()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: TelnyxInvalidDataException) {
+ false
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Body &&
+ audioFile == other.audioFile &&
+ language == other.language &&
+ name == other.name &&
+ gender == other.gender &&
+ label == other.label &&
+ refText == other.refText &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(audioFile, language, name, gender, label, refText, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Body{audioFile=$audioFile, language=$language, name=$name, gender=$gender, label=$label, refText=$refText, additionalProperties=$additionalProperties}"
+ }
+
+ /** Gender of the voice clone. */
+ class Gender @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 MALE = of("male")
+
+ @JvmField val FEMALE = of("female")
+
+ @JvmField val NEUTRAL = of("neutral")
+
+ @JvmStatic fun of(value: String) = Gender(JsonField.of(value))
+ }
+
+ /** An enum containing [Gender]'s known values. */
+ enum class Known {
+ MALE,
+ FEMALE,
+ NEUTRAL,
+ }
+
+ /**
+ * An enum containing [Gender]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Gender] 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 {
+ MALE,
+ FEMALE,
+ NEUTRAL,
+ /** An enum member indicating that [Gender] 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) {
+ MALE -> Value.MALE
+ FEMALE -> Value.FEMALE
+ NEUTRAL -> Value.NEUTRAL
+ 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 TelnyxInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ MALE -> Known.MALE
+ FEMALE -> Known.FEMALE
+ NEUTRAL -> Known.NEUTRAL
+ else -> throw TelnyxInvalidDataException("Unknown Gender: $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 TelnyxInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { TelnyxInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ fun validate(): Gender = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: TelnyxInvalidDataException) {
+ 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 Gender && 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 VoiceCloneCreateFromUploadParams &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "VoiceCloneCreateFromUploadParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/voiceclones/VoiceCloneCreateFromUploadResponse.kt b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/voiceclones/VoiceCloneCreateFromUploadResponse.kt
new file mode 100644
index 000000000..252333713
--- /dev/null
+++ b/telnyx-core/src/main/kotlin/com/telnyx/sdk/models/voiceclones/VoiceCloneCreateFromUploadResponse.kt
@@ -0,0 +1,164 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.telnyx.sdk.models.voiceclones
+
+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.telnyx.sdk.core.ExcludeMissing
+import com.telnyx.sdk.core.JsonField
+import com.telnyx.sdk.core.JsonMissing
+import com.telnyx.sdk.core.JsonValue
+import com.telnyx.sdk.errors.TelnyxInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Response envelope for a single voice clone. */
+class VoiceCloneCreateFromUploadResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val data: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("data") @ExcludeMissing data: JsonField = JsonMissing.of()
+ ) : this(data, mutableMapOf())
+
+ /**
+ * A voice clone object.
+ *
+ * @throws TelnyxInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun data(): Optional = data.getOptional("data")
+
+ /**
+ * Returns the raw JSON value of [data].
+ *
+ * Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("data") @ExcludeMissing fun _data(): JsonField = data
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map