diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6b7b74c..da59f99 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.3.0"
+ ".": "0.4.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 32808d2..49508b3 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 17
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml
-openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f
-config_hash: ab495a165f0919b37cbf9efbd0f0e6ef
+configured_endpoints: 21
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-d9763d006969b49a1473851069fdfa429eb13133b64103a62963bb70ddb22305.yml
+openapi_spec_hash: 6aee689b7a759b12c85c088c15e29bc0
+config_hash: 4ab3e1ee76a463e0ed214541260ee12e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19f5970..76db8cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,25 @@
# Changelog
+## 0.4.0 (2026-02-23)
+
+Full Changelog: [v0.3.0...v0.4.0](https://github.com/CASParser/cas-parser-java/compare/v0.3.0...v0.4.0)
+
+### Features
+
+* **api:** api update ([b23e224](https://github.com/CASParser/cas-parser-java/commit/b23e22466dac01c31d286182542dc8146d5fac7d))
+* **api:** api update ([cfdb276](https://github.com/CASParser/cas-parser-java/commit/cfdb276b8126bf167b489ded6fc13d84ad876dad))
+* **api:** api update ([8d2cb43](https://github.com/CASParser/cas-parser-java/commit/8d2cb43b11b1923624fdc32f7433115f5b20cf37))
+* **api:** manual updates ([2bb349e](https://github.com/CASParser/cas-parser-java/commit/2bb349ef8822aeda2d8d47d5f0c27994f9624446))
+* **client:** add connection pooling option ([3ad0fbc](https://github.com/CASParser/cas-parser-java/commit/3ad0fbcafa782f6f7dfcead9d4c4646aedd4e681))
+
+
+### Chores
+
+* **internal:** make `OkHttp` constructor internal ([1939ec1](https://github.com/CASParser/cas-parser-java/commit/1939ec1346feeb7a1ea45db385d6f8b7f8daacf6))
+* **internal:** remove mock server code ([0bdc28f](https://github.com/CASParser/cas-parser-java/commit/0bdc28fc1a9ae2e735d2c40d9cf86c1dc00461ae))
+* **internal:** update `TestServerExtension` comment ([ff77ead](https://github.com/CASParser/cas-parser-java/commit/ff77ead512a0b13377c61c0e92cc478586e7a67e))
+* update mock server docs ([e7286da](https://github.com/CASParser/cas-parser-java/commit/e7286da78e71c2750514686fb39e2b1a0b5140af))
+
## 0.3.0 (2026-02-14)
Full Changelog: [v0.2.1...v0.3.0](https://github.com/CASParser/cas-parser-java/compare/v0.2.1...v0.3.0)
diff --git a/README.md b/README.md
index c55a4ea..bb3747b 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.3.0)
-[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.3.0)
+[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.4.0)
+[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.4.0)
@@ -22,7 +22,7 @@ Use the Cas Parser MCP Server to enable AI assistants to interact with this API,
-The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.3.0).
+The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.4.0).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.casparser.in](https://docs.casp
### Gradle
```kotlin
-implementation("com.cas_parser.api:cas-parser-java:0.3.0")
+implementation("com.cas_parser.api:cas-parser-java:0.4.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.cas_parser.api:cas-parser-java:0.3.0")
com.cas_parser.api
cas-parser-java
- 0.3.0
+ 0.4.0
```
@@ -342,6 +342,25 @@ CasParserClient client = CasParserOkHttpClient.builder()
.build();
```
+### Connection pooling
+
+To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
+
+```java
+import com.cas_parser.api.client.CasParserClient;
+import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
+import java.time.Duration;
+
+CasParserClient client = CasParserOkHttpClient.builder()
+ .fromEnv()
+ // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.
+ .maxIdleConnections(10)
+ .keepAliveDuration(Duration.ofMinutes(2))
+ .build();
+```
+
+If both options are unset, OkHttp's default connection pool settings are used.
+
### HTTPS
> [!NOTE]
diff --git a/build.gradle.kts b/build.gradle.kts
index 90d29ec..40e9f7a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ repositories {
allprojects {
group = "com.cas_parser.api"
- version = "0.3.0" // x-release-please-version
+ version = "0.4.0" // x-release-please-version
}
subprojects {
diff --git a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt
index dc713f6..417682f 100644
--- a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt
+++ b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt
@@ -47,6 +47,8 @@ class CasParserOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -75,6 +77,46 @@ class CasParserOkHttpClient private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * The maximum number of idle connections kept by the underlying OkHttp connection pool.
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Alias for [Builder.maxIdleConnections].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int) =
+ maxIdleConnections(maxIdleConnections as Int?)
+
+ /**
+ * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
+ */
+ fun maxIdleConnections(maxIdleConnections: Optional) =
+ maxIdleConnections(maxIdleConnections.getOrNull())
+
+ /**
+ * The keep-alive duration for idle connections in the underlying OkHttp connection pool.
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
+ /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
+ fun keepAliveDuration(keepAliveDuration: Optional) =
+ keepAliveDuration(keepAliveDuration.getOrNull())
+
/**
* The socket factory used to secure HTTPS connections.
*
@@ -328,6 +370,8 @@ class CasParserOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .maxIdleConnections(maxIdleConnections)
+ .keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
diff --git a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt
index 5d4beab..e83fa10 100644
--- a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt
+++ b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt
@@ -47,6 +47,8 @@ class CasParserOkHttpClientAsync private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -75,6 +77,46 @@ class CasParserOkHttpClientAsync private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * The maximum number of idle connections kept by the underlying OkHttp connection pool.
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Alias for [Builder.maxIdleConnections].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int) =
+ maxIdleConnections(maxIdleConnections as Int?)
+
+ /**
+ * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
+ */
+ fun maxIdleConnections(maxIdleConnections: Optional) =
+ maxIdleConnections(maxIdleConnections.getOrNull())
+
+ /**
+ * The keep-alive duration for idle connections in the underlying OkHttp connection pool.
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
+ /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
+ fun keepAliveDuration(keepAliveDuration: Optional) =
+ keepAliveDuration(keepAliveDuration.getOrNull())
+
/**
* The socket factory used to secure HTTPS connections.
*
@@ -328,6 +370,8 @@ class CasParserOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .maxIdleConnections(maxIdleConnections)
+ .keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
diff --git a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/OkHttpClient.kt b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/OkHttpClient.kt
index 7079d3c..7bc37ab 100644
--- a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/OkHttpClient.kt
+++ b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/OkHttpClient.kt
@@ -16,11 +16,13 @@ import java.time.Duration
import java.util.concurrent.CancellationException
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutorService
+import java.util.concurrent.TimeUnit
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import okhttp3.Call
import okhttp3.Callback
+import okhttp3.ConnectionPool
import okhttp3.Dispatcher
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
@@ -33,7 +35,7 @@ import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
class OkHttpClient
-private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
+internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
val call = newCall(request, requestOptions)
@@ -200,6 +202,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var dispatcherExecutorService: ExecutorService? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
@@ -211,6 +215,28 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
+ /**
+ * Sets the maximum number of idle connections kept by the underlying [ConnectionPool].
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Sets the keep-alive duration for idle connections in the underlying [ConnectionPool].
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}
@@ -240,6 +266,22 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
.apply {
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }
+ val maxIdleConnections = maxIdleConnections
+ val keepAliveDuration = keepAliveDuration
+ if (maxIdleConnections != null && keepAliveDuration != null) {
+ connectionPool(
+ ConnectionPool(
+ maxIdleConnections,
+ keepAliveDuration.toNanos(),
+ TimeUnit.NANOSECONDS,
+ )
+ )
+ } else {
+ check((maxIdleConnections != null) == (keepAliveDuration != null)) {
+ "Both or none of `maxIdleConnections` and `keepAliveDuration` must be set, but only one was set"
+ }
+ }
+
val sslSocketFactory = sslSocketFactory
val trustManager = trustManager
if (sslSocketFactory != null && trustManager != null) {
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt
index 87a671b..df928cf 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt
@@ -8,6 +8,7 @@ import com.cas_parser.api.services.blocking.CamsKfintechService
import com.cas_parser.api.services.blocking.CdslService
import com.cas_parser.api.services.blocking.ContractNoteService
import com.cas_parser.api.services.blocking.CreditService
+import com.cas_parser.api.services.blocking.InboundEmailService
import com.cas_parser.api.services.blocking.InboxService
import com.cas_parser.api.services.blocking.KfintechService
import com.cas_parser.api.services.blocking.LogService
@@ -74,6 +75,8 @@ interface CasParserClient {
fun smart(): SmartService
+ fun inboundEmail(): InboundEmailService
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -118,5 +121,7 @@ interface CasParserClient {
fun nsdl(): NsdlService.WithRawResponse
fun smart(): SmartService.WithRawResponse
+
+ fun inboundEmail(): InboundEmailService.WithRawResponse
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt
index 22f6ad3..4d828d5 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt
@@ -8,6 +8,7 @@ import com.cas_parser.api.services.async.CamsKfintechServiceAsync
import com.cas_parser.api.services.async.CdslServiceAsync
import com.cas_parser.api.services.async.ContractNoteServiceAsync
import com.cas_parser.api.services.async.CreditServiceAsync
+import com.cas_parser.api.services.async.InboundEmailServiceAsync
import com.cas_parser.api.services.async.InboxServiceAsync
import com.cas_parser.api.services.async.KfintechServiceAsync
import com.cas_parser.api.services.async.LogServiceAsync
@@ -74,6 +75,8 @@ interface CasParserClientAsync {
fun smart(): SmartServiceAsync
+ fun inboundEmail(): InboundEmailServiceAsync
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -122,5 +125,7 @@ interface CasParserClientAsync {
fun nsdl(): NsdlServiceAsync.WithRawResponse
fun smart(): SmartServiceAsync.WithRawResponse
+
+ fun inboundEmail(): InboundEmailServiceAsync.WithRawResponse
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt
index 5f28136..b10af0a 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt
@@ -14,6 +14,8 @@ import com.cas_parser.api.services.async.ContractNoteServiceAsync
import com.cas_parser.api.services.async.ContractNoteServiceAsyncImpl
import com.cas_parser.api.services.async.CreditServiceAsync
import com.cas_parser.api.services.async.CreditServiceAsyncImpl
+import com.cas_parser.api.services.async.InboundEmailServiceAsync
+import com.cas_parser.api.services.async.InboundEmailServiceAsyncImpl
import com.cas_parser.api.services.async.InboxServiceAsync
import com.cas_parser.api.services.async.InboxServiceAsyncImpl
import com.cas_parser.api.services.async.KfintechServiceAsync
@@ -83,6 +85,10 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
SmartServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val inboundEmail: InboundEmailServiceAsync by lazy {
+ InboundEmailServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
override fun sync(): CasParserClient = sync
override fun withRawResponse(): CasParserClientAsync.WithRawResponse = withRawResponse
@@ -112,6 +118,8 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
override fun smart(): SmartServiceAsync = smart
+ override fun inboundEmail(): InboundEmailServiceAsync = inboundEmail
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -161,6 +169,10 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
SmartServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val inboundEmail: InboundEmailServiceAsync.WithRawResponse by lazy {
+ InboundEmailServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): CasParserClientAsync.WithRawResponse =
@@ -189,5 +201,7 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
override fun nsdl(): NsdlServiceAsync.WithRawResponse = nsdl
override fun smart(): SmartServiceAsync.WithRawResponse = smart
+
+ override fun inboundEmail(): InboundEmailServiceAsync.WithRawResponse = inboundEmail
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt
index f4b18e8..db32253 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt
@@ -14,6 +14,8 @@ import com.cas_parser.api.services.blocking.ContractNoteService
import com.cas_parser.api.services.blocking.ContractNoteServiceImpl
import com.cas_parser.api.services.blocking.CreditService
import com.cas_parser.api.services.blocking.CreditServiceImpl
+import com.cas_parser.api.services.blocking.InboundEmailService
+import com.cas_parser.api.services.blocking.InboundEmailServiceImpl
import com.cas_parser.api.services.blocking.InboxService
import com.cas_parser.api.services.blocking.InboxServiceImpl
import com.cas_parser.api.services.blocking.KfintechService
@@ -77,6 +79,10 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
private val smart: SmartService by lazy { SmartServiceImpl(clientOptionsWithUserAgent) }
+ private val inboundEmail: InboundEmailService by lazy {
+ InboundEmailServiceImpl(clientOptionsWithUserAgent)
+ }
+
override fun async(): CasParserClientAsync = async
override fun withRawResponse(): CasParserClient.WithRawResponse = withRawResponse
@@ -106,6 +112,8 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
override fun smart(): SmartService = smart
+ override fun inboundEmail(): InboundEmailService = inboundEmail
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -155,6 +163,10 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
SmartServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val inboundEmail: InboundEmailService.WithRawResponse by lazy {
+ InboundEmailServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): CasParserClient.WithRawResponse =
@@ -183,5 +195,7 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
override fun nsdl(): NsdlService.WithRawResponse = nsdl
override fun smart(): SmartService.WithRawResponse = smart
+
+ override fun inboundEmail(): InboundEmailService.WithRawResponse = inboundEmail
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt
index 676dc4d..93daf86 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt
@@ -24,6 +24,8 @@ import java.util.Optional
* **Use this endpoint from your backend** to create tokens that can be safely passed to
* frontend/SDK.
*
+ * **Legacy path:** `/v1/access-token` (still supported)
+ *
* Access tokens:
* - Are prefixed with `at_` for easy identification
* - Valid for up to 60 minutes
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailCreateParams.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailCreateParams.kt
new file mode 100644
index 0000000..a20d52b
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailCreateParams.kt
@@ -0,0 +1,1061 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.inboundemail
+
+import com.cas_parser.api.core.Enum
+import com.cas_parser.api.core.ExcludeMissing
+import com.cas_parser.api.core.JsonField
+import com.cas_parser.api.core.JsonMissing
+import com.cas_parser.api.core.JsonValue
+import com.cas_parser.api.core.Params
+import com.cas_parser.api.core.checkKnown
+import com.cas_parser.api.core.checkRequired
+import com.cas_parser.api.core.http.Headers
+import com.cas_parser.api.core.http.QueryParams
+import com.cas_parser.api.core.toImmutable
+import com.cas_parser.api.errors.CasParserInvalidDataException
+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 java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Create a dedicated inbound email address for collecting CAS statements via email forwarding.
+ *
+ * **How it works:**
+ * 1. Create an inbound email with your webhook URL
+ * 2. Display the email address to your user (e.g., "Forward your CAS to
+ * ie_xxx@import.casparser.in")
+ * 3. When an investor forwards a CAS email, we verify the sender and deliver to your webhook
+ *
+ * **Webhook Delivery:**
+ * - We POST to your `callback_url` with JSON body containing files (matching EmailCASFile schema)
+ * - Failed deliveries are retried automatically with exponential backoff
+ *
+ * **Inactivity:**
+ * - Inbound emails with no activity in 30 days are marked inactive
+ * - Active inbound emails remain operational indefinitely
+ */
+class InboundEmailCreateParams
+private constructor(
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /**
+ * Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP allowed for
+ * localhost during development).
+ *
+ * @throws CasParserInvalidDataException 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 callbackUrl(): String = body.callbackUrl()
+
+ /**
+ * Optional custom email prefix for user-friendly addresses.
+ * - Must be 3-32 characters
+ * - Alphanumeric + hyphens only
+ * - Must start and end with letter/number
+ * - Example: `john-portfolio@import.casparser.in`
+ * - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun alias(): Optional = body.alias()
+
+ /**
+ * Filter emails by CAS provider. If omitted, accepts all providers.
+ * - `cdsl` → eCAS@cdslstatement.com
+ * - `nsdl` → NSDL-CAS@nsdl.co.in
+ * - `cams` → donotreply@camsonline.com
+ * - `kfintech` → samfS@kfintech.com
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun allowedSources(): Optional> = body.allowedSources()
+
+ /**
+ * Optional key-value pairs (max 10) to include in webhook payload. Useful for passing context
+ * like plan_type, campaign_id, etc.
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun metadata(): Optional = body.metadata()
+
+ /**
+ * Your internal identifier (e.g., user_id, account_id). Returned in webhook payload for
+ * correlation.
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun reference(): Optional = body.reference()
+
+ /**
+ * Returns the raw JSON value of [callbackUrl].
+ *
+ * Unlike [callbackUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _callbackUrl(): JsonField = body._callbackUrl()
+
+ /**
+ * Returns the raw JSON value of [alias].
+ *
+ * Unlike [alias], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _alias(): JsonField = body._alias()
+
+ /**
+ * Returns the raw JSON value of [allowedSources].
+ *
+ * Unlike [allowedSources], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _allowedSources(): JsonField> = body._allowedSources()
+
+ /**
+ * Returns the raw JSON value of [metadata].
+ *
+ * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _metadata(): JsonField = body._metadata()
+
+ /**
+ * Returns the raw JSON value of [reference].
+ *
+ * Unlike [reference], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _reference(): JsonField = body._reference()
+
+ 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 [InboundEmailCreateParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .callbackUrl()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InboundEmailCreateParams]. */
+ 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(inboundEmailCreateParams: InboundEmailCreateParams) = apply {
+ body = inboundEmailCreateParams.body.toBuilder()
+ additionalHeaders = inboundEmailCreateParams.additionalHeaders.toBuilder()
+ additionalQueryParams = inboundEmailCreateParams.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:
+ * - [callbackUrl]
+ * - [alias]
+ * - [allowedSources]
+ * - [metadata]
+ * - [reference]
+ * - etc.
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ /**
+ * Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP allowed
+ * for localhost during development).
+ */
+ fun callbackUrl(callbackUrl: String) = apply { body.callbackUrl(callbackUrl) }
+
+ /**
+ * Sets [Builder.callbackUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.callbackUrl] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun callbackUrl(callbackUrl: JsonField) = apply { body.callbackUrl(callbackUrl) }
+
+ /**
+ * Optional custom email prefix for user-friendly addresses.
+ * - Must be 3-32 characters
+ * - Alphanumeric + hyphens only
+ * - Must start and end with letter/number
+ * - Example: `john-portfolio@import.casparser.in`
+ * - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
+ */
+ fun alias(alias: String) = apply { body.alias(alias) }
+
+ /**
+ * Sets [Builder.alias] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.alias] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun alias(alias: JsonField) = apply { body.alias(alias) }
+
+ /**
+ * Filter emails by CAS provider. If omitted, accepts all providers.
+ * - `cdsl` → eCAS@cdslstatement.com
+ * - `nsdl` → NSDL-CAS@nsdl.co.in
+ * - `cams` → donotreply@camsonline.com
+ * - `kfintech` → samfS@kfintech.com
+ */
+ fun allowedSources(allowedSources: List) = apply {
+ body.allowedSources(allowedSources)
+ }
+
+ /**
+ * Sets [Builder.allowedSources] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.allowedSources] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun allowedSources(allowedSources: JsonField>) = apply {
+ body.allowedSources(allowedSources)
+ }
+
+ /**
+ * Adds a single [AllowedSource] to [allowedSources].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addAllowedSource(allowedSource: AllowedSource) = apply {
+ body.addAllowedSource(allowedSource)
+ }
+
+ /**
+ * Optional key-value pairs (max 10) to include in webhook payload. Useful for passing
+ * context like plan_type, campaign_id, etc.
+ */
+ fun metadata(metadata: Metadata) = apply { body.metadata(metadata) }
+
+ /**
+ * Sets [Builder.metadata] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun metadata(metadata: JsonField) = apply { body.metadata(metadata) }
+
+ /**
+ * Your internal identifier (e.g., user_id, account_id). Returned in webhook payload for
+ * correlation.
+ */
+ fun reference(reference: String) = apply { body.reference(reference) }
+
+ /**
+ * Sets [Builder.reference] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.reference] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun reference(reference: JsonField) = apply { body.reference(reference) }
+
+ 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 [InboundEmailCreateParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .callbackUrl()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): InboundEmailCreateParams =
+ InboundEmailCreateParams(
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): Body = body
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val callbackUrl: JsonField,
+ private val alias: JsonField,
+ private val allowedSources: JsonField>,
+ private val metadata: JsonField,
+ private val reference: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("callback_url")
+ @ExcludeMissing
+ callbackUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("alias") @ExcludeMissing alias: JsonField = JsonMissing.of(),
+ @JsonProperty("allowed_sources")
+ @ExcludeMissing
+ allowedSources: JsonField> = JsonMissing.of(),
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ metadata: JsonField = JsonMissing.of(),
+ @JsonProperty("reference")
+ @ExcludeMissing
+ reference: JsonField = JsonMissing.of(),
+ ) : this(callbackUrl, alias, allowedSources, metadata, reference, mutableMapOf())
+
+ /**
+ * Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP allowed
+ * for localhost during development).
+ *
+ * @throws CasParserInvalidDataException 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 callbackUrl(): String = callbackUrl.getRequired("callback_url")
+
+ /**
+ * Optional custom email prefix for user-friendly addresses.
+ * - Must be 3-32 characters
+ * - Alphanumeric + hyphens only
+ * - Must start and end with letter/number
+ * - Example: `john-portfolio@import.casparser.in`
+ * - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun alias(): Optional = alias.getOptional("alias")
+
+ /**
+ * Filter emails by CAS provider. If omitted, accepts all providers.
+ * - `cdsl` → eCAS@cdslstatement.com
+ * - `nsdl` → NSDL-CAS@nsdl.co.in
+ * - `cams` → donotreply@camsonline.com
+ * - `kfintech` → samfS@kfintech.com
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun allowedSources(): Optional> =
+ allowedSources.getOptional("allowed_sources")
+
+ /**
+ * Optional key-value pairs (max 10) to include in webhook payload. Useful for passing
+ * context like plan_type, campaign_id, etc.
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun metadata(): Optional = metadata.getOptional("metadata")
+
+ /**
+ * Your internal identifier (e.g., user_id, account_id). Returned in webhook payload for
+ * correlation.
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun reference(): Optional = reference.getOptional("reference")
+
+ /**
+ * Returns the raw JSON value of [callbackUrl].
+ *
+ * Unlike [callbackUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("callback_url")
+ @ExcludeMissing
+ fun _callbackUrl(): JsonField = callbackUrl
+
+ /**
+ * Returns the raw JSON value of [alias].
+ *
+ * Unlike [alias], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("alias") @ExcludeMissing fun _alias(): JsonField = alias
+
+ /**
+ * Returns the raw JSON value of [allowedSources].
+ *
+ * Unlike [allowedSources], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("allowed_sources")
+ @ExcludeMissing
+ fun _allowedSources(): JsonField> = allowedSources
+
+ /**
+ * Returns the raw JSON value of [metadata].
+ *
+ * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata
+
+ /**
+ * Returns the raw JSON value of [reference].
+ *
+ * Unlike [reference], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("reference") @ExcludeMissing fun _reference(): JsonField = reference
+
+ @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
+ * .callbackUrl()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var callbackUrl: JsonField? = null
+ private var alias: JsonField = JsonMissing.of()
+ private var allowedSources: JsonField>? = null
+ private var metadata: JsonField = JsonMissing.of()
+ private var reference: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ callbackUrl = body.callbackUrl
+ alias = body.alias
+ allowedSources = body.allowedSources.map { it.toMutableList() }
+ metadata = body.metadata
+ reference = body.reference
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP
+ * allowed for localhost during development).
+ */
+ fun callbackUrl(callbackUrl: String) = callbackUrl(JsonField.of(callbackUrl))
+
+ /**
+ * Sets [Builder.callbackUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.callbackUrl] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun callbackUrl(callbackUrl: JsonField) = apply {
+ this.callbackUrl = callbackUrl
+ }
+
+ /**
+ * Optional custom email prefix for user-friendly addresses.
+ * - Must be 3-32 characters
+ * - Alphanumeric + hyphens only
+ * - Must start and end with letter/number
+ * - Example: `john-portfolio@import.casparser.in`
+ * - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
+ */
+ fun alias(alias: String) = alias(JsonField.of(alias))
+
+ /**
+ * Sets [Builder.alias] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.alias] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun alias(alias: JsonField) = apply { this.alias = alias }
+
+ /**
+ * Filter emails by CAS provider. If omitted, accepts all providers.
+ * - `cdsl` → eCAS@cdslstatement.com
+ * - `nsdl` → NSDL-CAS@nsdl.co.in
+ * - `cams` → donotreply@camsonline.com
+ * - `kfintech` → samfS@kfintech.com
+ */
+ fun allowedSources(allowedSources: List) =
+ allowedSources(JsonField.of(allowedSources))
+
+ /**
+ * Sets [Builder.allowedSources] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.allowedSources] with a well-typed
+ * `List` value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun allowedSources(allowedSources: JsonField>) = apply {
+ this.allowedSources = allowedSources.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [AllowedSource] to [allowedSources].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addAllowedSource(allowedSource: AllowedSource) = apply {
+ allowedSources =
+ (allowedSources ?: JsonField.of(mutableListOf())).also {
+ checkKnown("allowedSources", it).add(allowedSource)
+ }
+ }
+
+ /**
+ * Optional key-value pairs (max 10) to include in webhook payload. Useful for passing
+ * context like plan_type, campaign_id, etc.
+ */
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * Sets [Builder.metadata] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.metadata] with a well-typed [Metadata] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
+
+ /**
+ * Your internal identifier (e.g., user_id, account_id). Returned in webhook payload for
+ * correlation.
+ */
+ fun reference(reference: String) = reference(JsonField.of(reference))
+
+ /**
+ * Sets [Builder.reference] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.reference] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun reference(reference: JsonField) = apply { this.reference = reference }
+
+ 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
+ * .callbackUrl()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Body =
+ Body(
+ checkRequired("callbackUrl", callbackUrl),
+ alias,
+ (allowedSources ?: JsonMissing.of()).map { it.toImmutable() },
+ metadata,
+ reference,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ callbackUrl()
+ alias()
+ allowedSources().ifPresent { it.forEach { it.validate() } }
+ metadata().ifPresent { it.validate() }
+ reference()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: CasParserInvalidDataException) {
+ 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 (callbackUrl.asKnown().isPresent) 1 else 0) +
+ (if (alias.asKnown().isPresent) 1 else 0) +
+ (allowedSources.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (metadata.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (reference.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Body &&
+ callbackUrl == other.callbackUrl &&
+ alias == other.alias &&
+ allowedSources == other.allowedSources &&
+ metadata == other.metadata &&
+ reference == other.reference &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ callbackUrl,
+ alias,
+ allowedSources,
+ metadata,
+ reference,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Body{callbackUrl=$callbackUrl, alias=$alias, allowedSources=$allowedSources, metadata=$metadata, reference=$reference, additionalProperties=$additionalProperties}"
+ }
+
+ class AllowedSource @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 CDSL = of("cdsl")
+
+ @JvmField val NSDL = of("nsdl")
+
+ @JvmField val CAMS = of("cams")
+
+ @JvmField val KFINTECH = of("kfintech")
+
+ @JvmStatic fun of(value: String) = AllowedSource(JsonField.of(value))
+ }
+
+ /** An enum containing [AllowedSource]'s known values. */
+ enum class Known {
+ CDSL,
+ NSDL,
+ CAMS,
+ KFINTECH,
+ }
+
+ /**
+ * An enum containing [AllowedSource]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [AllowedSource] 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 {
+ CDSL,
+ NSDL,
+ CAMS,
+ KFINTECH,
+ /**
+ * An enum member indicating that [AllowedSource] 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) {
+ CDSL -> Value.CDSL
+ NSDL -> Value.NSDL
+ CAMS -> Value.CAMS
+ KFINTECH -> Value.KFINTECH
+ 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 CasParserInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CDSL -> Known.CDSL
+ NSDL -> Known.NSDL
+ CAMS -> Known.CAMS
+ KFINTECH -> Known.KFINTECH
+ else -> throw CasParserInvalidDataException("Unknown AllowedSource: $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 CasParserInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ CasParserInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AllowedSource = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: CasParserInvalidDataException) {
+ 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 AllowedSource && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /**
+ * Optional key-value pairs (max 10) to include in webhook payload. Useful for passing context
+ * like plan_type, campaign_id, etc.
+ */
+ class Metadata
+ @JsonCreator
+ private constructor(
+ @com.fasterxml.jackson.annotation.JsonValue
+ private val additionalProperties: Map
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [Metadata]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Metadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(metadata: Metadata) = apply {
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Metadata].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Metadata = Metadata(additionalProperties.toImmutable())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Metadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: CasParserInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Metadata && additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is InboundEmailCreateParams &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "InboundEmailCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailCreateResponse.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailCreateResponse.kt
new file mode 100644
index 0000000..fb3d9d5
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailCreateResponse.kt
@@ -0,0 +1,884 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.inboundemail
+
+import com.cas_parser.api.core.Enum
+import com.cas_parser.api.core.ExcludeMissing
+import com.cas_parser.api.core.JsonField
+import com.cas_parser.api.core.JsonMissing
+import com.cas_parser.api.core.JsonValue
+import com.cas_parser.api.core.checkKnown
+import com.cas_parser.api.core.toImmutable
+import com.cas_parser.api.errors.CasParserInvalidDataException
+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 java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** An inbound email address for receiving forwarded CAS emails */
+class InboundEmailCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val allowedSources: JsonField>,
+ private val callbackUrl: JsonField,
+ private val createdAt: JsonField,
+ private val email: JsonField,
+ private val inboundEmailId: JsonField,
+ private val metadata: JsonField,
+ private val reference: JsonField,
+ private val status: JsonField,
+ private val updatedAt: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("allowed_sources")
+ @ExcludeMissing
+ allowedSources: JsonField> = JsonMissing.of(),
+ @JsonProperty("callback_url")
+ @ExcludeMissing
+ callbackUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("email") @ExcludeMissing email: JsonField = JsonMissing.of(),
+ @JsonProperty("inbound_email_id")
+ @ExcludeMissing
+ inboundEmailId: JsonField = JsonMissing.of(),
+ @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(),
+ @JsonProperty("reference") @ExcludeMissing reference: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("updated_at")
+ @ExcludeMissing
+ updatedAt: JsonField = JsonMissing.of(),
+ ) : this(
+ allowedSources,
+ callbackUrl,
+ createdAt,
+ email,
+ inboundEmailId,
+ metadata,
+ reference,
+ status,
+ updatedAt,
+ mutableMapOf(),
+ )
+
+ /**
+ * Accepted CAS providers (empty = all)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun allowedSources(): Optional> =
+ allowedSources.getOptional("allowed_sources")
+
+ /**
+ * Webhook URL for email notifications
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun callbackUrl(): Optional = callbackUrl.getOptional("callback_url")
+
+ /**
+ * When the mailbox was created
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun createdAt(): Optional = createdAt.getOptional("created_at")
+
+ /**
+ * The inbound email address to forward CAS statements to
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun email(): Optional = email.getOptional("email")
+
+ /**
+ * Unique inbound email identifier
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun inboundEmailId(): Optional = inboundEmailId.getOptional("inbound_email_id")
+
+ /**
+ * Custom key-value metadata
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun metadata(): Optional = metadata.getOptional("metadata")
+
+ /**
+ * Your internal reference identifier
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun reference(): Optional = reference.getOptional("reference")
+
+ /**
+ * Current mailbox status
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun status(): Optional = status.getOptional("status")
+
+ /**
+ * When the mailbox was last updated
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun updatedAt(): Optional = updatedAt.getOptional("updated_at")
+
+ /**
+ * Returns the raw JSON value of [allowedSources].
+ *
+ * Unlike [allowedSources], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("allowed_sources")
+ @ExcludeMissing
+ fun _allowedSources(): JsonField> = allowedSources
+
+ /**
+ * Returns the raw JSON value of [callbackUrl].
+ *
+ * Unlike [callbackUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("callback_url")
+ @ExcludeMissing
+ fun _callbackUrl(): JsonField = callbackUrl
+
+ /**
+ * Returns the raw JSON value of [createdAt].
+ *
+ * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ fun _createdAt(): JsonField = createdAt
+
+ /**
+ * Returns the raw JSON value of [email].
+ *
+ * Unlike [email], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("email") @ExcludeMissing fun _email(): JsonField = email
+
+ /**
+ * Returns the raw JSON value of [inboundEmailId].
+ *
+ * Unlike [inboundEmailId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("inbound_email_id")
+ @ExcludeMissing
+ fun _inboundEmailId(): JsonField = inboundEmailId
+
+ /**
+ * Returns the raw JSON value of [metadata].
+ *
+ * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata
+
+ /**
+ * Returns the raw JSON value of [reference].
+ *
+ * Unlike [reference], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("reference") @ExcludeMissing fun _reference(): JsonField = reference
+
+ /**
+ * 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
+
+ /**
+ * Returns the raw JSON value of [updatedAt].
+ *
+ * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("updated_at")
+ @ExcludeMissing
+ fun _updatedAt(): JsonField = updatedAt
+
+ @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 [InboundEmailCreateResponse].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InboundEmailCreateResponse]. */
+ class Builder internal constructor() {
+
+ private var allowedSources: JsonField>? = null
+ private var callbackUrl: JsonField = JsonMissing.of()
+ private var createdAt: JsonField = JsonMissing.of()
+ private var email: JsonField = JsonMissing.of()
+ private var inboundEmailId: JsonField = JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
+ private var reference: JsonField = JsonMissing.of()
+ private var status: JsonField = JsonMissing.of()
+ private var updatedAt: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(inboundEmailCreateResponse: InboundEmailCreateResponse) = apply {
+ allowedSources = inboundEmailCreateResponse.allowedSources.map { it.toMutableList() }
+ callbackUrl = inboundEmailCreateResponse.callbackUrl
+ createdAt = inboundEmailCreateResponse.createdAt
+ email = inboundEmailCreateResponse.email
+ inboundEmailId = inboundEmailCreateResponse.inboundEmailId
+ metadata = inboundEmailCreateResponse.metadata
+ reference = inboundEmailCreateResponse.reference
+ status = inboundEmailCreateResponse.status
+ updatedAt = inboundEmailCreateResponse.updatedAt
+ additionalProperties = inboundEmailCreateResponse.additionalProperties.toMutableMap()
+ }
+
+ /** Accepted CAS providers (empty = all) */
+ fun allowedSources(allowedSources: List) =
+ allowedSources(JsonField.of(allowedSources))
+
+ /**
+ * Sets [Builder.allowedSources] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.allowedSources] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun allowedSources(allowedSources: JsonField>) = apply {
+ this.allowedSources = allowedSources.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [AllowedSource] to [allowedSources].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addAllowedSource(allowedSource: AllowedSource) = apply {
+ allowedSources =
+ (allowedSources ?: JsonField.of(mutableListOf())).also {
+ checkKnown("allowedSources", it).add(allowedSource)
+ }
+ }
+
+ /** Webhook URL for email notifications */
+ fun callbackUrl(callbackUrl: String) = callbackUrl(JsonField.of(callbackUrl))
+
+ /**
+ * Sets [Builder.callbackUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.callbackUrl] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun callbackUrl(callbackUrl: JsonField) = apply { this.callbackUrl = callbackUrl }
+
+ /** When the mailbox was created */
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ /**
+ * Sets [Builder.createdAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+
+ /** The inbound email address to forward CAS statements to */
+ fun email(email: String) = email(JsonField.of(email))
+
+ /**
+ * Sets [Builder.email] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.email] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun email(email: JsonField) = apply { this.email = email }
+
+ /** Unique inbound email identifier */
+ fun inboundEmailId(inboundEmailId: String) = inboundEmailId(JsonField.of(inboundEmailId))
+
+ /**
+ * Sets [Builder.inboundEmailId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.inboundEmailId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun inboundEmailId(inboundEmailId: JsonField) = apply {
+ this.inboundEmailId = inboundEmailId
+ }
+
+ /** Custom key-value metadata */
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * Sets [Builder.metadata] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
+
+ /** Your internal reference identifier */
+ fun reference(reference: String?) = reference(JsonField.ofNullable(reference))
+
+ /** Alias for calling [Builder.reference] with `reference.orElse(null)`. */
+ fun reference(reference: Optional) = reference(reference.getOrNull())
+
+ /**
+ * Sets [Builder.reference] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.reference] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun reference(reference: JsonField) = apply { this.reference = reference }
+
+ /** Current mailbox status */
+ 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 }
+
+ /** When the mailbox was last updated */
+ fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt))
+
+ /**
+ * Sets [Builder.updatedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt }
+
+ 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 [InboundEmailCreateResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): InboundEmailCreateResponse =
+ InboundEmailCreateResponse(
+ (allowedSources ?: JsonMissing.of()).map { it.toImmutable() },
+ callbackUrl,
+ createdAt,
+ email,
+ inboundEmailId,
+ metadata,
+ reference,
+ status,
+ updatedAt,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): InboundEmailCreateResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ allowedSources().ifPresent { it.forEach { it.validate() } }
+ callbackUrl()
+ createdAt()
+ email()
+ inboundEmailId()
+ metadata().ifPresent { it.validate() }
+ reference()
+ status().ifPresent { it.validate() }
+ updatedAt()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: CasParserInvalidDataException) {
+ 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 =
+ (allowedSources.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (callbackUrl.asKnown().isPresent) 1 else 0) +
+ (if (createdAt.asKnown().isPresent) 1 else 0) +
+ (if (email.asKnown().isPresent) 1 else 0) +
+ (if (inboundEmailId.asKnown().isPresent) 1 else 0) +
+ (metadata.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (reference.asKnown().isPresent) 1 else 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (updatedAt.asKnown().isPresent) 1 else 0)
+
+ class AllowedSource @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 CDSL = of("cdsl")
+
+ @JvmField val NSDL = of("nsdl")
+
+ @JvmField val CAMS = of("cams")
+
+ @JvmField val KFINTECH = of("kfintech")
+
+ @JvmStatic fun of(value: String) = AllowedSource(JsonField.of(value))
+ }
+
+ /** An enum containing [AllowedSource]'s known values. */
+ enum class Known {
+ CDSL,
+ NSDL,
+ CAMS,
+ KFINTECH,
+ }
+
+ /**
+ * An enum containing [AllowedSource]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [AllowedSource] 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 {
+ CDSL,
+ NSDL,
+ CAMS,
+ KFINTECH,
+ /**
+ * An enum member indicating that [AllowedSource] 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) {
+ CDSL -> Value.CDSL
+ NSDL -> Value.NSDL
+ CAMS -> Value.CAMS
+ KFINTECH -> Value.KFINTECH
+ 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 CasParserInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CDSL -> Known.CDSL
+ NSDL -> Known.NSDL
+ CAMS -> Known.CAMS
+ KFINTECH -> Known.KFINTECH
+ else -> throw CasParserInvalidDataException("Unknown AllowedSource: $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 CasParserInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ CasParserInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AllowedSource = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: CasParserInvalidDataException) {
+ 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 AllowedSource && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** Custom key-value metadata */
+ class Metadata
+ @JsonCreator
+ private constructor(
+ @com.fasterxml.jackson.annotation.JsonValue
+ private val additionalProperties: Map
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [Metadata]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Metadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(metadata: Metadata) = apply {
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Metadata].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Metadata = Metadata(additionalProperties.toImmutable())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Metadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: CasParserInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Metadata && additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
+ }
+
+ /** Current mailbox status */
+ 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 ACTIVE = of("active")
+
+ @JvmField val PAUSED = of("paused")
+
+ @JvmStatic fun of(value: String) = Status(JsonField.of(value))
+ }
+
+ /** An enum containing [Status]'s known values. */
+ enum class Known {
+ ACTIVE,
+ PAUSED,
+ }
+
+ /**
+ * 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 {
+ ACTIVE,
+ PAUSED,
+ /** 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) {
+ ACTIVE -> Value.ACTIVE
+ PAUSED -> Value.PAUSED
+ 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 CasParserInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ ACTIVE -> Known.ACTIVE
+ PAUSED -> Known.PAUSED
+ else -> throw CasParserInvalidDataException("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 CasParserInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ CasParserInvalidDataException("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: CasParserInvalidDataException) {
+ 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 InboundEmailCreateResponse &&
+ allowedSources == other.allowedSources &&
+ callbackUrl == other.callbackUrl &&
+ createdAt == other.createdAt &&
+ email == other.email &&
+ inboundEmailId == other.inboundEmailId &&
+ metadata == other.metadata &&
+ reference == other.reference &&
+ status == other.status &&
+ updatedAt == other.updatedAt &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ allowedSources,
+ callbackUrl,
+ createdAt,
+ email,
+ inboundEmailId,
+ metadata,
+ reference,
+ status,
+ updatedAt,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "InboundEmailCreateResponse{allowedSources=$allowedSources, callbackUrl=$callbackUrl, createdAt=$createdAt, email=$email, inboundEmailId=$inboundEmailId, metadata=$metadata, reference=$reference, status=$status, updatedAt=$updatedAt, additionalProperties=$additionalProperties}"
+}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailDeleteParams.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailDeleteParams.kt
new file mode 100644
index 0000000..1546fbf
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inboundemail/InboundEmailDeleteParams.kt
@@ -0,0 +1,241 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.inboundemail
+
+import com.cas_parser.api.core.JsonValue
+import com.cas_parser.api.core.Params
+import com.cas_parser.api.core.http.Headers
+import com.cas_parser.api.core.http.QueryParams
+import com.cas_parser.api.core.toImmutable
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Permanently delete an inbound email address. It will stop accepting emails.
+ *
+ * **Note:** Deletion is immediate and cannot be undone. Any emails received after deletion will be
+ * rejected.
+ */
+class InboundEmailDeleteParams
+private constructor(
+ private val inboundEmailId: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+ private val additionalBodyProperties: Map,
+) : Params {
+
+ fun inboundEmailId(): Optional = Optional.ofNullable(inboundEmailId)
+
+ /** Additional body properties to send with the request. */
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): InboundEmailDeleteParams = builder().build()
+
+ /** Returns a mutable builder for constructing an instance of [InboundEmailDeleteParams]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InboundEmailDeleteParams]. */
+ class Builder internal constructor() {
+
+ private var inboundEmailId: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+ private var additionalBodyProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(inboundEmailDeleteParams: InboundEmailDeleteParams) = apply {
+ inboundEmailId = inboundEmailDeleteParams.inboundEmailId
+ additionalHeaders = inboundEmailDeleteParams.additionalHeaders.toBuilder()
+ additionalQueryParams = inboundEmailDeleteParams.additionalQueryParams.toBuilder()
+ additionalBodyProperties =
+ inboundEmailDeleteParams.additionalBodyProperties.toMutableMap()
+ }
+
+ fun inboundEmailId(inboundEmailId: String?) = apply { this.inboundEmailId = inboundEmailId }
+
+ /** Alias for calling [Builder.inboundEmailId] with `inboundEmailId.orElse(null)`. */
+ fun inboundEmailId(inboundEmailId: Optional) =
+ inboundEmailId(inboundEmailId.getOrNull())
+
+ 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)
+ }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ this.additionalBodyProperties.clear()
+ putAllAdditionalBodyProperties(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ additionalBodyProperties.put(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ this.additionalBodyProperties.putAll(additionalBodyProperties)
+ }
+
+ fun removeAdditionalBodyProperty(key: String) = apply {
+ additionalBodyProperties.remove(key)
+ }
+
+ fun removeAllAdditionalBodyProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalBodyProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [InboundEmailDeleteParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): InboundEmailDeleteParams =
+ InboundEmailDeleteParams(
+ inboundEmailId,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ additionalBodyProperties.toImmutable(),
+ )
+ }
+
+ fun _body(): Optional