diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index cadbcc6fc..f3343e210 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.124.0"
+ ".": "0.125.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 1a1957f0a..883f26c00 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 191
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml
-openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2
-config_hash: ac8326134e692f3f3bdec82396bbec80
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0f374e78a0212145a2f55a55dfc39a612de19094d5152ae26b1bc74b01b9e343.yml
+openapi_spec_hash: ec888cdaebea979a2cd6231ca04c346c
+config_hash: 01dfc901bb6d54b0f582155d779bcbe0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4dbb06e50..273dd1b83 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,41 @@
# Changelog
+## 0.125.0 (2026-05-06)
+
+Full Changelog: [v0.124.0...v0.125.0](https://github.com/lithic-com/lithic-java/compare/v0.124.0...v0.125.0)
+
+### Features
+
+* **api:** add AMEX to Network enum in settlement params and models ([638084a](https://github.com/lithic-com/lithic-java/commit/638084a329e3e2da55a350e950f6752e185b5ae4))
+* **api:** add CARD_TRANSACTION_UPDATE event stream and conditional action to auth rules ([064ee52](https://github.com/lithic-com/lithic-java/commit/064ee523f9ced5648ad252fd7a625709b61ad1f4))
+* **api:** add IS_NEW_MERCHANT attribute to authorization action parameters ([6a44f6b](https://github.com/lithic-com/lithic-java/commit/6a44f6b77dc5749fe3e39e6deee4e0e2de316efe))
+* **client:** improve logging ([bb282c7](https://github.com/lithic-com/lithic-java/commit/bb282c75d62080e57456309b7b0c510dab94f5ca))
+* **client:** more robust error parsing ([af54a46](https://github.com/lithic-com/lithic-java/commit/af54a46bbbdbb176835e48074572df830dbc39c2))
+* **client:** support proxy authentication ([183501b](https://github.com/lithic-com/lithic-java/commit/183501b5aa6bde88a884b70a370f848b29cdcd8b))
+* support setting headers via env ([0493d0a](https://github.com/lithic-com/lithic-java/commit/0493d0ad4f3d8e45f35b652e670e505bcbfaf67a))
+
+
+### Bug Fixes
+
+* **types:** add EMPTY exemption type, make fields optional in Account/Card/NonPciCard ([2a2a00a](https://github.com/lithic-com/lithic-java/commit/2a2a00acc9cd3a92991a7ae50b6e02cdebaa930d))
+
+
+### Performance Improvements
+
+* **client:** create one json mapper ([1743358](https://github.com/lithic-com/lithic-java/commit/1743358e72d12f38c5012963276deef9f78831d9))
+
+
+### Chores
+
+* remove duplicated dokka setup ([1728d1a](https://github.com/lithic-com/lithic-java/commit/1728d1a87fbefc15fd86228d122d3a6e2ec53afb))
+
+
+### Documentation
+
+* **api:** improve event_tokens and transaction_token field docs in SettlementDetail ([1ccf96d](https://github.com/lithic-com/lithic-java/commit/1ccf96d80d888a5c0756ef5a115dd3e810f9f25b))
+* **api:** update exp_month/exp_year descriptions in card create/renew ([36c34a0](https://github.com/lithic-com/lithic-java/commit/36c34a04d23013e6504d322f84ed85506ab46220))
+* clarify forwards compat behavior ([746bf4a](https://github.com/lithic-com/lithic-java/commit/746bf4a1c7e5de2f4c498d411422827c2107ffc5))
+
## 0.124.0 (2026-04-20)
Full Changelog: [v0.123.0...v0.124.0](https://github.com/lithic-com/lithic-java/compare/v0.123.0...v0.124.0)
diff --git a/README.md b/README.md
index 0af7be254..b323db83b 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.124.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.124.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.125.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.125.0)
@@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all
-The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.124.0).
+The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.125.0).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.124.0")
+implementation("com.lithic.api:lithic-java:0.125.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.124.0")
com.lithic.api
lithic-java
- 0.124.0
+ 0.125.0
```
@@ -349,8 +349,6 @@ while (true) {
## Logging
-The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).
-
Enable logging by setting the `LITHIC_LOG` environment variable to `info`:
```sh
@@ -363,6 +361,19 @@ Or to `debug` for more verbose logging:
export LITHIC_LOG=debug
```
+Or configure the client manually using the `logLevel` method:
+
+```java
+import com.lithic.api.client.LithicClient;
+import com.lithic.api.client.okhttp.LithicOkHttpClient;
+import com.lithic.api.core.LogLevel;
+
+LithicClient client = LithicOkHttpClient.builder()
+ .fromEnv()
+ .logLevel(LogLevel.INFO)
+ .build();
+```
+
## Webhooks
Lithic uses webhooks to notify your application when events happen. The SDK provides methods for verifying webhook signatures and parsing event payloads.
@@ -500,6 +511,21 @@ LithicClient client = LithicOkHttpClient.builder()
.build();
```
+If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:
+
+```java
+import com.lithic.api.client.LithicClient;
+import com.lithic.api.client.okhttp.LithicOkHttpClient;
+import com.lithic.api.core.http.ProxyAuthenticator;
+
+LithicClient client = LithicOkHttpClient.builder()
+ .fromEnv()
+ .proxy(...)
+ // Or a custom implementation of `ProxyAuthenticator`.
+ .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))
+ .build();
+```
+
### Connection pooling
To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
@@ -751,7 +777,9 @@ In rare cases, the API may return a response that doesn't match the expected typ
By default, the SDK will not throw an exception in this case. It will throw [`LithicInvalidDataException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt) only if you directly access the property.
-If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
+Validating the response is _not_ forwards compatible with new types from the API for existing fields.
+
+If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:
```java
import com.lithic.api.models.Card;
diff --git a/build.gradle.kts b/build.gradle.kts
index 666c01572..9cf695abb 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.124.0" // x-release-please-version
+ version = "0.125.0" // x-release-please-version
}
subprojects {
@@ -21,7 +21,6 @@ subprojects {
group = "Verification"
description = "Verifies all source files are formatted."
}
- apply(plugin = "org.jetbrains.dokka")
}
subprojects {
diff --git a/lithic-java-client-okhttp/build.gradle.kts b/lithic-java-client-okhttp/build.gradle.kts
index 1227e2871..0a36f8b40 100644
--- a/lithic-java-client-okhttp/build.gradle.kts
+++ b/lithic-java-client-okhttp/build.gradle.kts
@@ -7,7 +7,6 @@ dependencies {
api(project(":lithic-java-core"))
implementation("com.squareup.okhttp3:okhttp:4.12.0")
- implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.27.7")
diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt
index 824255b18..4edcc3221 100644
--- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt
+++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt
@@ -6,11 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.lithic.api.client.LithicClient
import com.lithic.api.client.LithicClientImpl
import com.lithic.api.core.ClientOptions
+import com.lithic.api.core.LogLevel
import com.lithic.api.core.Sleeper
import com.lithic.api.core.Timeout
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
+import com.lithic.api.core.http.ProxyAuthenticator
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.jsonMapper
import java.net.Proxy
@@ -49,6 +51,7 @@ class LithicOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
@@ -79,6 +82,20 @@ class LithicOkHttpClient private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
+ * Required`.
+ */
+ fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
+ this.proxyAuthenticator = proxyAuthenticator
+ }
+
+ /**
+ * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
+ */
+ fun proxyAuthenticator(proxyAuthenticator: Optional) =
+ proxyAuthenticator(proxyAuthenticator.getOrNull())
+
/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
@@ -236,6 +253,9 @@ class LithicOkHttpClient private constructor() {
/**
* Whether to call `validate` on every response before returning it.
*
+ * Setting this to `true` is _not_ forwards compatible with new types from the API for
+ * existing fields.
+ *
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
@@ -277,6 +297,15 @@ class LithicOkHttpClient private constructor() {
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
+ /**
+ * The level at which to log request and response information.
+ *
+ * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
+ *
+ * Defaults to [LogLevel.fromEnv].
+ */
+ fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }
+
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
fun webhookSecret(webhookSecret: String?) = apply {
@@ -386,6 +415,7 @@ class LithicOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .proxyAuthenticator(proxyAuthenticator)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt
index 9224b3804..d4b432cc6 100644
--- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt
+++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt
@@ -6,11 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.lithic.api.client.LithicClientAsync
import com.lithic.api.client.LithicClientAsyncImpl
import com.lithic.api.core.ClientOptions
+import com.lithic.api.core.LogLevel
import com.lithic.api.core.Sleeper
import com.lithic.api.core.Timeout
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
+import com.lithic.api.core.http.ProxyAuthenticator
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.jsonMapper
import java.net.Proxy
@@ -49,6 +51,7 @@ class LithicOkHttpClientAsync private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
@@ -79,6 +82,20 @@ class LithicOkHttpClientAsync private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
+ * Required`.
+ */
+ fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
+ this.proxyAuthenticator = proxyAuthenticator
+ }
+
+ /**
+ * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
+ */
+ fun proxyAuthenticator(proxyAuthenticator: Optional) =
+ proxyAuthenticator(proxyAuthenticator.getOrNull())
+
/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
@@ -236,6 +253,9 @@ class LithicOkHttpClientAsync private constructor() {
/**
* Whether to call `validate` on every response before returning it.
*
+ * Setting this to `true` is _not_ forwards compatible with new types from the API for
+ * existing fields.
+ *
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
@@ -277,6 +297,15 @@ class LithicOkHttpClientAsync private constructor() {
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
+ /**
+ * The level at which to log request and response information.
+ *
+ * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
+ *
+ * Defaults to [LogLevel.fromEnv].
+ */
+ fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }
+
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
fun webhookSecret(webhookSecret: String?) = apply {
@@ -386,6 +415,7 @@ class LithicOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .proxyAuthenticator(proxyAuthenticator)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt
index 5c5c11677..71a2e2c98 100644
--- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt
+++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt
@@ -8,9 +8,11 @@ import com.lithic.api.core.http.HttpMethod
import com.lithic.api.core.http.HttpRequest
import com.lithic.api.core.http.HttpRequestBody
import com.lithic.api.core.http.HttpResponse
+import com.lithic.api.core.http.ProxyAuthenticator
import com.lithic.api.errors.LithicIoException
import java.io.IOException
import java.io.InputStream
+import java.io.OutputStream
import java.net.Proxy
import java.time.Duration
import java.util.concurrent.CancellationException
@@ -20,10 +22,12 @@ import java.util.concurrent.TimeUnit
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
+import kotlin.jvm.optionals.getOrNull
import okhttp3.Call
import okhttp3.Callback
import okhttp3.ConnectionPool
import okhttp3.Dispatcher
+import okhttp3.HttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaType
@@ -31,8 +35,9 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
-import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
+import okio.buffer
+import okio.sink
class OkHttpClient
internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
@@ -41,7 +46,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
val call = newCall(request, requestOptions)
return try {
- call.execute().toResponse()
+ call.execute().toHttpResponse()
} catch (e: IOException) {
throw LithicIoException("Request failed", e)
} finally {
@@ -59,7 +64,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
call.enqueue(
object : Callback {
override fun onResponse(call: Call, response: Response) {
- future.complete(response.toResponse())
+ future.complete(response.toHttpResponse())
}
override fun onFailure(call: Call, e: IOException) {
@@ -87,18 +92,6 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call {
val clientBuilder = okHttpClient.newBuilder()
- val logLevel =
- when (System.getenv("LITHIC_LOG")?.lowercase()) {
- "info" -> HttpLoggingInterceptor.Level.BASIC
- "debug" -> HttpLoggingInterceptor.Level.BODY
- else -> null
- }
- if (logLevel != null) {
- clientBuilder.addNetworkInterceptor(
- HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") }
- )
- }
-
requestOptions.timeout?.let {
clientBuilder
.connectTimeout(it.connect())
@@ -111,89 +104,6 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
return client.newCall(request.toRequest(client))
}
- private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request {
- var body: RequestBody? = body?.toRequestBody()
- if (body == null && requiresBody(method)) {
- body = "".toRequestBody()
- }
-
- val builder = Request.Builder().url(toUrl()).method(method.name, body)
- headers.names().forEach { name ->
- headers.values(name).forEach { builder.addHeader(name, it) }
- }
-
- if (
- !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0
- ) {
- builder.addHeader(
- "X-Stainless-Read-Timeout",
- Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(),
- )
- }
- if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) {
- builder.addHeader(
- "X-Stainless-Timeout",
- Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(),
- )
- }
-
- return builder.build()
- }
-
- /** `OkHttpClient` always requires a request body for some methods. */
- private fun requiresBody(method: HttpMethod): Boolean =
- when (method) {
- HttpMethod.POST,
- HttpMethod.PUT,
- HttpMethod.PATCH -> true
- else -> false
- }
-
- private fun HttpRequest.toUrl(): String {
- val builder = baseUrl.toHttpUrl().newBuilder()
- pathSegments.forEach(builder::addPathSegment)
- queryParams.keys().forEach { key ->
- queryParams.values(key).forEach { builder.addQueryParameter(key, it) }
- }
-
- return builder.toString()
- }
-
- private fun HttpRequestBody.toRequestBody(): RequestBody {
- val mediaType = contentType()?.toMediaType()
- val length = contentLength()
-
- return object : RequestBody() {
- override fun contentType(): MediaType? = mediaType
-
- override fun contentLength(): Long = length
-
- override fun isOneShot(): Boolean = !repeatable()
-
- override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream())
- }
- }
-
- private fun Response.toResponse(): HttpResponse {
- val headers = headers.toHeaders()
-
- return object : HttpResponse {
- override fun statusCode(): Int = code
-
- override fun headers(): Headers = headers
-
- override fun body(): InputStream = body!!.byteStream()
-
- override fun close() = body!!.close()
- }
- }
-
- private fun okhttp3.Headers.toHeaders(): Headers {
- val headersBuilder = Headers.builder()
- forEach { (name, value) -> headersBuilder.put(name, value) }
- return headersBuilder.build()
- }
-
companion object {
@JvmStatic fun builder() = Builder()
}
@@ -202,6 +112,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
+ private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var dispatcherExecutorService: ExecutorService? = null
@@ -215,6 +126,10 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
+ fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
+ this.proxyAuthenticator = proxyAuthenticator
+ }
+
/**
* Sets the maximum number of idle connections kept by the underlying [ConnectionPool].
*
@@ -264,6 +179,19 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
.callTimeout(timeout.request())
.proxy(proxy)
.apply {
+ proxyAuthenticator?.let { auth ->
+ proxyAuthenticator { route, response ->
+ auth
+ .authenticate(
+ route?.proxy ?: Proxy.NO_PROXY,
+ response.request.toHttpRequest(),
+ response.toHttpResponse(),
+ )
+ .getOrNull()
+ ?.toRequest(client = null)
+ }
+ }
+
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }
val maxIdleConnections = maxIdleConnections
@@ -303,3 +231,126 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
)
}
}
+
+private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient?): Request {
+ var body: RequestBody? = body?.toRequestBody()
+ if (body == null && requiresBody(method)) {
+ body = "".toRequestBody()
+ }
+
+ val builder = Request.Builder().url(toUrl()).method(method.name, body)
+ headers.names().forEach { name -> headers.values(name).forEach { builder.addHeader(name, it) } }
+
+ if (client != null) {
+ if (
+ !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0
+ ) {
+ builder.addHeader(
+ "X-Stainless-Read-Timeout",
+ Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(),
+ )
+ }
+ if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) {
+ builder.addHeader(
+ "X-Stainless-Timeout",
+ Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(),
+ )
+ }
+ }
+
+ return builder.build()
+}
+
+/** `OkHttpClient` always requires a request body for some methods. */
+private fun requiresBody(method: HttpMethod): Boolean =
+ when (method) {
+ HttpMethod.POST,
+ HttpMethod.PUT,
+ HttpMethod.PATCH -> true
+ else -> false
+ }
+
+private fun HttpRequest.toUrl(): String {
+ val builder = baseUrl.toHttpUrl().newBuilder()
+ pathSegments.forEach(builder::addPathSegment)
+ queryParams.keys().forEach { key ->
+ queryParams.values(key).forEach { builder.addQueryParameter(key, it) }
+ }
+
+ return builder.toString()
+}
+
+private fun HttpRequestBody.toRequestBody(): RequestBody {
+ val mediaType = contentType()?.toMediaType()
+ val length = contentLength()
+
+ return object : RequestBody() {
+ override fun contentType(): MediaType? = mediaType
+
+ override fun contentLength(): Long = length
+
+ override fun isOneShot(): Boolean = !repeatable()
+
+ override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream())
+ }
+}
+
+private fun Request.toHttpRequest(): HttpRequest {
+ val builder = HttpRequest.builder().method(HttpMethod.valueOf(method)).baseUrl(url.toBaseUrl())
+ url.pathSegments.forEach(builder::addPathSegment)
+ url.queryParameterNames.forEach { name ->
+ url.queryParameterValues(name).filterNotNull().forEach { builder.putQueryParam(name, it) }
+ }
+ headers.forEach { (name, value) -> builder.putHeader(name, value) }
+ body?.let { builder.body(it.toHttpRequestBody()) }
+ return builder.build()
+}
+
+private fun HttpUrl.toBaseUrl(): String = buildString {
+ append(scheme).append("://").append(host)
+ if (port != HttpUrl.defaultPort(scheme)) {
+ append(":").append(port)
+ }
+}
+
+private fun RequestBody.toHttpRequestBody(): HttpRequestBody {
+ val mediaType = contentType()?.toString()
+ val length = contentLength()
+ val isOneShot = isOneShot()
+ val source = this
+ return object : HttpRequestBody {
+ override fun contentType(): String? = mediaType
+
+ override fun contentLength(): Long = length
+
+ override fun repeatable(): Boolean = !isOneShot
+
+ override fun writeTo(outputStream: OutputStream) {
+ val sink = outputStream.sink().buffer()
+ source.writeTo(sink)
+ sink.flush()
+ }
+
+ override fun close() {}
+ }
+}
+
+private fun Response.toHttpResponse(): HttpResponse {
+ val headers = headers.toHeaders()
+
+ return object : HttpResponse {
+ override fun statusCode(): Int = code
+
+ override fun headers(): Headers = headers
+
+ override fun body(): InputStream = body!!.byteStream()
+
+ override fun close() = body!!.close()
+ }
+}
+
+private fun okhttp3.Headers.toHeaders(): Headers {
+ val headersBuilder = Headers.builder()
+ forEach { (name, value) -> headersBuilder.put(name, value) }
+ return headersBuilder.build()
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt
index f90712b8f..6e72f6e01 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
+import com.lithic.api.core.http.LoggingHttpClient
import com.lithic.api.core.http.PhantomReachableClosingHttpClient
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.http.RetryingHttpClient
@@ -80,6 +81,9 @@ private constructor(
/**
* Whether to call `validate` on every response before returning it.
*
+ * Setting this to `true` is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
@@ -107,6 +111,14 @@ private constructor(
* Defaults to 2.
*/
@get:JvmName("maxRetries") val maxRetries: Int,
+ /**
+ * The level at which to log request and response information.
+ *
+ * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
+ *
+ * Defaults to [LogLevel.fromEnv].
+ */
+ @get:JvmName("logLevel") val logLevel: LogLevel,
@get:JvmName("apiKey") val apiKey: String,
private val webhookSecret: String?,
) {
@@ -171,6 +183,7 @@ private constructor(
private var responseValidation: Boolean = false
private var timeout: Timeout = Timeout.default()
private var maxRetries: Int = 2
+ private var logLevel: LogLevel = LogLevel.fromEnv()
private var apiKey: String? = null
private var webhookSecret: String? = null
@@ -188,6 +201,7 @@ private constructor(
responseValidation = clientOptions.responseValidation
timeout = clientOptions.timeout
maxRetries = clientOptions.maxRetries
+ logLevel = clientOptions.logLevel
apiKey = clientOptions.apiKey
webhookSecret = clientOptions.webhookSecret
}
@@ -275,6 +289,9 @@ private constructor(
/**
* Whether to call `validate` on every response before returning it.
*
+ * Setting this to `true` is _not_ forwards compatible with new types from the API for
+ * existing fields.
+ *
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
@@ -316,6 +333,15 @@ private constructor(
*/
fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries }
+ /**
+ * The level at which to log request and response information.
+ *
+ * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
+ *
+ * Defaults to [LogLevel.fromEnv].
+ */
+ fun logLevel(logLevel: LogLevel) = apply { this.logLevel = logLevel }
+
fun apiKey(apiKey: String) = apply { this.apiKey = apiKey }
fun webhookSecret(webhookSecret: String?) = apply { this.webhookSecret = webhookSecret }
@@ -420,6 +446,7 @@ private constructor(
* System properties take precedence over environment variables.
*/
fun fromEnv() = apply {
+ logLevel(LogLevel.fromEnv())
(System.getProperty("lithic.baseUrl") ?: System.getenv("LITHIC_BASE_URL"))?.let {
baseUrl(it)
}
@@ -428,6 +455,14 @@ private constructor(
}
(System.getProperty("lithic.webhookSecret") ?: System.getenv("LITHIC_WEBHOOK_SECRET"))
?.let { webhookSecret(it) }
+ System.getenv("LITHIC_CUSTOM_HEADERS")?.let { customHeadersEnv ->
+ for (line in customHeadersEnv.split("\n")) {
+ val colon = line.indexOf(':')
+ if (colon >= 0) {
+ putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
+ }
+ }
+ }
}
/**
@@ -488,7 +523,13 @@ private constructor(
return ClientOptions(
httpClient,
RetryingHttpClient.builder()
- .httpClient(httpClient)
+ .httpClient(
+ LoggingHttpClient.builder()
+ .httpClient(httpClient)
+ .clock(clock)
+ .level(logLevel)
+ .build()
+ )
.sleeper(sleeper)
.clock(clock)
.maxRetries(maxRetries)
@@ -504,6 +545,7 @@ private constructor(
responseValidation,
timeout,
maxRetries,
+ logLevel,
apiKey,
webhookSecret,
)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt
new file mode 100644
index 000000000..b35f44038
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/LogLevel.kt
@@ -0,0 +1,33 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.core
+
+/** The level at which to log request and response information. */
+enum class LogLevel {
+ /** No logging. */
+ OFF,
+ /** Minimal request and response summary logs. No headers or bodies are logged. */
+ INFO,
+ /** [INFO] logs plus details about request failures. */
+ ERROR,
+ /**
+ * Full request and response logs. Sensitive headers are redacted, but sensitive data in request
+ * and response bodies may still be visible.
+ */
+ DEBUG;
+
+ /** Returns whether this level is at or higher than the given [level]. */
+ fun shouldLog(level: LogLevel): Boolean = ordinal >= level.ordinal
+
+ companion object {
+
+ /** Returns a [LogLevel] based on the `LITHIC_LOG` environment variable. */
+ fun fromEnv() =
+ when (System.getenv("LITHIC_LOG")?.lowercase()) {
+ "info" -> INFO
+ "error" -> ERROR
+ "debug" -> DEBUG
+ else -> OFF
+ }
+ }
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt
index c40847243..262d820fc 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt
@@ -29,7 +29,9 @@ import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoField
-fun jsonMapper(): JsonMapper =
+fun jsonMapper(): JsonMapper = JSON_MAPPER
+
+private val JSON_MAPPER: JsonMapper =
JsonMapper.builder()
.addModule(kotlinModule())
.addModule(Jdk8Module())
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt
index ee9fe54c2..4ff16b664 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/RequestOptions.kt
@@ -33,6 +33,15 @@ class RequestOptions private constructor(val responseValidation: Boolean?, val t
private var responseValidation: Boolean? = null
private var timeout: Timeout? = null
+ /**
+ * Whether to call `validate` on the response before returning it.
+ *
+ * Setting this to `true` is _not_ forwards compatible with new types from the API for
+ * existing fields.
+ *
+ * Defaults to false, which means the shape of the response will not be validated upfront.
+ * Instead, validation will only occur for the parts of the response that are accessed.
+ */
fun responseValidation(responseValidation: Boolean) = apply {
this.responseValidation = responseValidation
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt
index 5109aaf69..ef291e9d3 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/Utils.kt
@@ -6,6 +6,7 @@ import com.lithic.api.core.http.Headers
import com.lithic.api.errors.LithicInvalidDataException
import java.util.Collections
import java.util.SortedMap
+import java.util.SortedSet
import java.util.concurrent.CompletableFuture
import java.util.concurrent.locks.Lock
@@ -17,6 +18,11 @@ internal fun T?.getOrThrow(name: String): T =
internal fun List.toImmutable(): List =
if (isEmpty()) Collections.emptyList() else Collections.unmodifiableList(toList())
+@JvmSynthetic
+internal fun > SortedSet.toImmutable(): SortedSet =
+ if (isEmpty()) Collections.emptySortedSet()
+ else Collections.unmodifiableSortedSet(toSortedSet(comparator() ?: Comparator.naturalOrder()))
+
@JvmSynthetic
internal fun Map.toImmutable(): Map =
if (isEmpty()) immutableEmptyMap() else Collections.unmodifiableMap(toMap())
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt
new file mode 100644
index 000000000..43cf6062e
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/LoggingHttpClient.kt
@@ -0,0 +1,627 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.core.http
+
+import com.lithic.api.core.LogLevel
+import com.lithic.api.core.RequestOptions
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.toImmutable
+import java.io.ByteArrayOutputStream
+import java.io.InputStream
+import java.io.OutputStream
+import java.nio.ByteBuffer
+import java.nio.charset.CharacterCodingException
+import java.nio.charset.Charset
+import java.nio.charset.CharsetDecoder
+import java.nio.charset.CodingErrorAction
+import java.nio.charset.StandardCharsets
+import java.time.Clock
+import java.time.Duration
+import java.time.OffsetDateTime
+import java.util.SortedSet
+import java.util.concurrent.CompletableFuture
+import java.util.concurrent.CompletionException
+import kotlin.time.toKotlinDuration
+
+/** A wrapper [HttpClient] around [httpClient] that logs request and response information. */
+class LoggingHttpClient
+private constructor(
+ /** The underlying [HttpClient] for making requests. */
+ @get:JvmName("httpClient") val httpClient: HttpClient,
+ /**
+ * Sensitive headers to redact from logs.
+ *
+ * Defaults to `Set.of("Authorization")`.
+ */
+ @get:JvmName("redactedHeaders") val redactedHeaders: SortedSet,
+ /**
+ * The clock to use for measuring request and response durations.
+ *
+ * This is primarily useful for using a fake clock in tests.
+ *
+ * Defaults to [Clock.systemUTC].
+ */
+ @get:JvmName("clock") val clock: Clock,
+ /**
+ * The log level to use.
+ *
+ * Pass [LogLevel.fromEnv] to read from environment variables.
+ */
+ @get:JvmName("level") val level: LogLevel,
+) : HttpClient {
+
+ override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
+ val loggingRequest = logRequest(request)
+
+ val before = OffsetDateTime.now(clock)
+ val response =
+ try {
+ httpClient.execute(loggingRequest, requestOptions)
+ } catch (e: Throwable) {
+ logFailure(e, Duration.between(before, OffsetDateTime.now(clock)))
+ throw e
+ }
+
+ val took = Duration.between(before, OffsetDateTime.now(clock))
+ return logResponse(response, took)
+ }
+
+ override fun executeAsync(
+ request: HttpRequest,
+ requestOptions: RequestOptions,
+ ): CompletableFuture {
+ val loggingRequest = logRequest(request)
+
+ val before = OffsetDateTime.now(clock)
+ val future =
+ try {
+ httpClient.executeAsync(loggingRequest, requestOptions)
+ } catch (e: Throwable) {
+ logFailure(e, Duration.between(before, OffsetDateTime.now(clock)))
+ throw e
+ }
+ return future.handle { response, error ->
+ val took = Duration.between(before, OffsetDateTime.now(clock))
+ if (error != null) {
+ logFailure(unwrapCompletionException(error), took)
+ throw error
+ }
+ logResponse(response, took)
+ }
+ }
+
+ private fun logRequest(request: HttpRequest): HttpRequest {
+ if (!level.shouldLog(LogLevel.INFO)) {
+ return request
+ }
+
+ System.err.println(
+ buildString {
+ append("--> ${request.method} ${request.url()}")
+ request.body?.let {
+ val length = it.contentLength()
+ append(if (length >= 0) " ($length-byte body)" else " (unknown-length body)")
+ }
+ }
+ )
+
+ if (!level.shouldLog(LogLevel.DEBUG)) {
+ return request
+ }
+
+ logHeaders(request.headers)
+
+ if (request.body == null) {
+ System.err.println("--> END ${request.method}")
+ System.err.println()
+ return request
+ }
+
+ return request
+ .toBuilder()
+ .body(LoggingHttpRequestBody(request.method, request.body))
+ .build()
+ }
+
+ private fun logResponse(response: HttpResponse, took: Duration): HttpResponse {
+ if (!level.shouldLog(LogLevel.INFO)) {
+ return response
+ }
+
+ val contentLength = response.headers().values("Content-Length").firstOrNull()?.toIntOrNull()
+ System.err.println(
+ "<-- ${response.statusCode()} (${
+ buildString {
+ append(took.format())
+ contentLength?.let { append(", $contentLength-byte body") }
+ }
+ })"
+ )
+
+ if (!level.shouldLog(LogLevel.DEBUG)) {
+ return response
+ }
+
+ logHeaders(response.headers())
+ return LoggingHttpResponse(response)
+ }
+
+ private fun logFailure(error: Throwable, took: Duration) {
+ if (!level.shouldLog(LogLevel.ERROR)) {
+ return
+ }
+
+ System.err.println(
+ buildString {
+ append("<-- !! ${error.javaClass.simpleName}")
+ error.message?.let { append(": $it") }
+ append(" (${took.format()})")
+ }
+ )
+ }
+
+ private fun unwrapCompletionException(error: Throwable): Throwable =
+ if (error is CompletionException && error.cause != null) error.cause!! else error
+
+ private fun logHeaders(headers: Headers) =
+ headers.names().forEach { name ->
+ headers.values(name).forEach { value ->
+ System.err.println("$name: ${if (redactedHeaders.contains(name)) "██" else value}")
+ }
+ }
+
+ override fun close() = httpClient.close()
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [LoggingHttpClient].
+ *
+ * The following fields are required:
+ * ```java
+ * .httpClient()
+ * .level()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [LoggingHttpClient]. */
+ class Builder internal constructor() {
+
+ private var httpClient: HttpClient? = null
+ private var redactedHeaders: Set = setOf("Authorization")
+ private var clock: Clock = Clock.systemUTC()
+ private var level: LogLevel? = null
+
+ @JvmSynthetic
+ internal fun from(loggingHttpClient: LoggingHttpClient) = apply {
+ httpClient = loggingHttpClient.httpClient
+ redactedHeaders = loggingHttpClient.redactedHeaders
+ clock = loggingHttpClient.clock
+ level = loggingHttpClient.level
+ }
+
+ /** The underlying [HttpClient] for making requests. */
+ fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient }
+
+ /**
+ * Sensitive headers to redact from logs.
+ *
+ * Defaults to `Set.of("Authorization")`.
+ */
+ fun redactedHeaders(redactedHeaders: Set) = apply {
+ this.redactedHeaders = redactedHeaders
+ }
+
+ /**
+ * The clock to use for measuring request and response durations.
+ *
+ * This is primarily useful for using a fake clock in tests.
+ *
+ * Defaults to [Clock.systemUTC].
+ */
+ fun clock(clock: Clock) = apply { this.clock = clock }
+
+ /**
+ * The log level to use.
+ *
+ * Pass [LogLevel.fromEnv] to read from environment variables.
+ */
+ fun level(level: LogLevel) = apply { this.level = level }
+
+ /**
+ * Returns an immutable instance of [LoggingHttpClient].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .httpClient()
+ * .level()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): LoggingHttpClient =
+ LoggingHttpClient(
+ checkRequired("httpClient", httpClient),
+ redactedHeaders.toSortedSet(String.CASE_INSENSITIVE_ORDER).toImmutable(),
+ clock,
+ checkRequired("level", level),
+ )
+ }
+}
+
+/**
+ * An [HttpRequestBody] wrapper that delegates to [body] while also logging line by line as it's
+ * written.
+ *
+ * The logging occurs in a streaming manner with minimal buffering.
+ */
+private class LoggingHttpRequestBody(
+ private val method: HttpMethod,
+ private val body: HttpRequestBody,
+) : HttpRequestBody {
+
+ private val charset by lazy { parseCharset(body.contentType()) }
+
+ override fun writeTo(outputStream: OutputStream) {
+ val loggingOutputStream = LoggingOutputStream(outputStream, charset)
+ body.writeTo(loggingOutputStream)
+
+ loggingOutputStream.flush()
+ System.err.println("--> END $method (${loggingOutputStream.writeCount()}-byte body)")
+ System.err.println()
+ }
+
+ override fun contentType(): String? = body.contentType()
+
+ override fun contentLength(): Long = body.contentLength()
+
+ override fun repeatable(): Boolean = body.repeatable()
+
+ override fun close() = body.close()
+}
+
+/**
+ * An [OutputStream] wrapper that delegates to [outputStream] while also logging bytes line by line
+ * as it's written to.
+ *
+ * The written content is assumed to be in the given [charset] and the logging occurs in a streaming
+ * manner with minimal buffering.
+ */
+private class LoggingOutputStream(private val outputStream: OutputStream, charset: Charset?) :
+ OutputStream() {
+
+ private val buffer = LoggingBuffer(charset)
+
+ fun writeCount() = buffer.writeCount()
+
+ override fun write(b: Int) {
+ outputStream.write(b)
+ buffer.write(b)
+ }
+
+ override fun write(b: ByteArray, off: Int, len: Int) {
+ outputStream.write(b, off, len)
+ for (i in off until off + len) {
+ buffer.write(b[i].toInt() and 0xFF)
+ }
+ }
+
+ /** Prints any currently buffered content. */
+ override fun flush() {
+ buffer.flush()
+ outputStream.flush()
+ }
+
+ override fun close() = outputStream.close()
+}
+
+/**
+ * An [HttpResponse] wrapper that delegates to [response] while also logging line-by-line as it's
+ * read.
+ *
+ * The logging occurs in a streaming manner with minimal buffering.
+ */
+private class LoggingHttpResponse(private val response: HttpResponse) : HttpResponse {
+
+ private val loggingBody: Lazy = lazy {
+ LoggingInputStream(
+ response.body(),
+ parseCharset(response.headers().values("Content-Type").firstOrNull()),
+ )
+ }
+
+ override fun statusCode(): Int = response.statusCode()
+
+ override fun headers(): Headers = response.headers()
+
+ override fun body(): InputStream = loggingBody.value
+
+ override fun close() {
+ if (loggingBody.isInitialized()) {
+ loggingBody.value.close()
+ }
+ response.close()
+ }
+}
+
+/**
+ * An [InputStream] wrapper that delegates to [inputStream] while also logging bytes line by line as
+ * it's read.
+ *
+ * The contents of [inputStream] are assumed to be in the given [charset] and the logging occurs in
+ * a streaming manner with minimal buffering.
+ */
+private class LoggingInputStream(private val inputStream: InputStream, charset: Charset?) :
+ InputStream() {
+
+ private var isDone = false
+ private val buffer = LoggingBuffer(charset)
+
+ override fun read(): Int {
+ if (isDone) {
+ return -1
+ }
+
+ val b = inputStream.read()
+
+ if (b == -1) {
+ markDone()
+ return b
+ }
+
+ buffer.write(b)
+ return b
+ }
+
+ override fun read(b: ByteArray, off: Int, len: Int): Int {
+ if (isDone) {
+ return -1
+ }
+
+ val bytesRead = inputStream.read(b, off, len)
+
+ if (bytesRead == -1) {
+ markDone()
+ return bytesRead
+ }
+
+ for (i in off until off + bytesRead) {
+ buffer.write(b[i].toInt() and 0xFF)
+ }
+ return bytesRead
+ }
+
+ override fun close() {
+ if (!isDone) {
+ markDone(closedEarly = true)
+ }
+ inputStream.close()
+ }
+
+ private fun markDone(closedEarly: Boolean = false) {
+ isDone = true
+ buffer.flush()
+ val suffix = if (closedEarly) ", closed early" else ""
+ System.err.println("<-- END HTTP (${buffer.writeCount()}-byte body$suffix)")
+ System.err.println()
+ }
+}
+
+/**
+ * A byte buffer that prints line by line, using the given [charset], as bytes are written to it.
+ *
+ * When [charset] is `null`, the buffer performs an upfront check to detect binary content. If
+ * non-whitespace ISO control characters are found in the first [PROBABLY_UTF8_CODE_POINT_LIMIT]
+ * code points, body logging is suppressed entirely.
+ */
+private class LoggingBuffer(charset: Charset?) {
+
+ private val charset = charset ?: StandardCharsets.UTF_8
+
+ private val decoder: CharsetDecoder =
+ this.charset
+ .newDecoder()
+ .onMalformedInput(CodingErrorAction.REPORT)
+ .onUnmappableCharacter(CodingErrorAction.REPORT)
+ private var writeCount = 0
+ private val buffer = ByteArrayOutputStream(128)
+
+ /**
+ * Whether logging has been suppressed because the content doesn't appear to be readable text.
+ *
+ * This is only set when [charset] is `null` and the content fails the [isProbablyUtf8] check.
+ */
+ private var suppressed = false
+
+ /**
+ * Bytes accumulated for the [isProbablyUtf8] check before any lines are printed.
+ *
+ * Once the check passes (or [charset] is non-null), this is set to `null` and bytes flow
+ * directly to [buffer].
+ */
+ private var prefetchBuffer: ByteArrayOutputStream? =
+ if (charset != null) null else ByteArrayOutputStream(128)
+
+ fun writeCount() = writeCount
+
+ fun write(b: Int) {
+ if (writeCount == 0) {
+ // Print a newline before we start printing anything to separate the printed content
+ // from previous content.
+ System.err.println()
+ }
+
+ writeCount++
+
+ if (suppressed) {
+ return
+ }
+
+ val prefetch = prefetchBuffer
+ if (prefetch != null) {
+ prefetch.write(b)
+ // Continue accumulating until we have enough bytes to decide.
+ if (prefetch.size() < PROBABLY_UTF8_BYTE_LIMIT && b != '\n'.code) {
+ return
+ }
+ // We have enough bytes. Check if the content is probably UTF-8.
+ prefetchBuffer = null
+ val bytes = prefetch.toByteArray()
+ if (!isProbablyUtf8(bytes)) {
+ suppressed = true
+ System.err.println("(binary body omitted)")
+ return
+ }
+ // Content looks like UTF-8. Feed the accumulated bytes into the normal buffer.
+ for (byte in bytes) {
+ writeToBuffer(byte.toInt() and 0xFF)
+ }
+ return
+ }
+
+ writeToBuffer(b)
+ }
+
+ private fun writeToBuffer(b: Int) {
+ if (b == '\n'.code) {
+ flush()
+ return
+ }
+
+ buffer.write(b)
+ }
+
+ /** Prints any currently buffered content. */
+ fun flush() {
+ if (suppressed) {
+ return
+ }
+
+ // If we still have a prefetch buffer when flush is called (body was shorter than the
+ // limit), run the check now.
+ val prefetch = prefetchBuffer
+ if (prefetch != null) {
+ prefetchBuffer = null
+ val bytes = prefetch.toByteArray()
+ if (bytes.isEmpty()) {
+ return
+ }
+ if (!isProbablyUtf8(bytes)) {
+ suppressed = true
+ System.err.println("(binary body omitted)")
+ return
+ }
+ for (byte in bytes) {
+ writeToBuffer(byte.toInt() and 0xFF)
+ }
+ }
+
+ if (buffer.size() == 0) {
+ return
+ }
+
+ val line =
+ try {
+ decoder.decode(ByteBuffer.wrap(buffer.toByteArray()))
+ } catch (e: CharacterCodingException) {
+ "(omitted line is not valid $charset)"
+ }
+ buffer.reset()
+ System.err.println(line)
+ }
+}
+
+/** The maximum number of code points to sample when checking if content is probably UTF-8. */
+private const val PROBABLY_UTF8_CODE_POINT_LIMIT = 64
+
+/**
+ * The maximum number of bytes to accumulate before running the [isProbablyUtf8] check. UTF-8 code
+ * points are at most 4 bytes, so this accommodates [PROBABLY_UTF8_CODE_POINT_LIMIT] code points.
+ */
+private const val PROBABLY_UTF8_BYTE_LIMIT = PROBABLY_UTF8_CODE_POINT_LIMIT * 4
+
+/**
+ * Returns `true` if the given [bytes] probably contain human-readable UTF-8 text.
+ *
+ * Decodes up to [PROBABLY_UTF8_CODE_POINT_LIMIT] code points and returns `false` if any
+ * non-whitespace ISO control characters are found, or if the bytes are not valid UTF-8.
+ */
+private fun isProbablyUtf8(bytes: ByteArray): Boolean {
+ try {
+ val decoder =
+ StandardCharsets.UTF_8.newDecoder()
+ .onMalformedInput(CodingErrorAction.REPORT)
+ .onUnmappableCharacter(CodingErrorAction.REPORT)
+ val charBuffer = decoder.decode(ByteBuffer.wrap(bytes))
+ var codePointCount = 0
+ var i = 0
+ while (i < charBuffer.length && codePointCount < PROBABLY_UTF8_CODE_POINT_LIMIT) {
+ val codePoint = Character.codePointAt(charBuffer, i)
+ if (Character.isISOControl(codePoint) && !Character.isWhitespace(codePoint)) {
+ return false
+ }
+ i += Character.charCount(codePoint)
+ codePointCount++
+ }
+ return true
+ } catch (e: CharacterCodingException) {
+ return false
+ }
+}
+
+/** Returns the [Charset] in the given [contentType] string, or `null` if unspecified. */
+private fun parseCharset(contentType: String?): Charset? =
+ contentType
+ ?.split(";")
+ ?.drop(1)
+ ?.map { it.trim() }
+ ?.firstOrNull { it.startsWith("charset=", ignoreCase = true) }
+ ?.substringAfter("=")
+ ?.trim()
+ ?.removeSurrounding("\"")
+ ?.let { runCatching { charset(it) }.getOrNull() }
+
+/** Formats the [Duration] into a string like "1m 40s 467ms". */
+private fun Duration.format(): String =
+ toKotlinDuration().toComponents { days, hours, minutes, seconds, nanoseconds ->
+ buildString {
+ val milliseconds = nanoseconds / 1_000_000
+ if (days > 0) {
+ append("${days}d")
+ }
+ if (hours > 0) {
+ if (isNotEmpty()) {
+ append(" ")
+ }
+ append("${hours}h")
+ }
+ if (minutes > 0) {
+ if (isNotEmpty()) {
+ append(" ")
+ }
+ append("${minutes}m")
+ }
+ if (seconds > 0) {
+ if (isNotEmpty()) {
+ append(" ")
+ }
+ append("${seconds}s")
+ }
+ if (milliseconds > 0) {
+ if (isNotEmpty()) {
+ append(" ")
+ }
+ append("${milliseconds}ms")
+ }
+
+ if (isEmpty()) {
+ append("0s")
+ }
+ }
+ }
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt
new file mode 100644
index 000000000..08d8441ac
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/ProxyAuthenticator.kt
@@ -0,0 +1,59 @@
+package com.lithic.api.core.http
+
+import java.net.Proxy
+import java.nio.charset.Charset
+import java.nio.charset.StandardCharsets
+import java.util.Base64
+import java.util.Optional
+
+/**
+ * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication Required`.
+ *
+ * Implementations inspect the 407 [response] (typically its `Proxy-Authenticate` header) and return
+ * the request to retry with a `Proxy-Authorization` header set, or [Optional.empty] to abandon
+ * authentication and surface the 407 to the caller.
+ *
+ * Implementations must be thread-safe; they may be invoked concurrently from multiple HTTP calls.
+ */
+fun interface ProxyAuthenticator {
+
+ /**
+ * @param proxy the proxy that produced the challenge, or [Proxy.NO_PROXY] if the route is not
+ * yet established
+ * @param request the request that produced [response]
+ * @param response the 407 challenge response
+ * @return the retry request to send (typically [request] with a `Proxy-Authorization` header
+ * added), or [Optional.empty] to abandon authentication
+ */
+ fun authenticate(
+ proxy: Proxy,
+ request: HttpRequest,
+ response: HttpResponse,
+ ): Optional
+
+ companion object {
+
+ /**
+ * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the ISO-8859-1
+ * charset.
+ */
+ @JvmStatic
+ fun basic(username: String, password: String): ProxyAuthenticator =
+ basic(username, password, StandardCharsets.ISO_8859_1)
+
+ /**
+ * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the given [charset].
+ */
+ @JvmStatic
+ fun basic(username: String, password: String, charset: Charset): ProxyAuthenticator {
+ val token =
+ Base64.getEncoder().encodeToString("$username:$password".toByteArray(charset))
+ val headerValue = "Basic $token"
+ return ProxyAuthenticator { _, request, _ ->
+ Optional.of(
+ request.toBuilder().putHeader("Proxy-Authorization", headerValue).build()
+ )
+ }
+ }
+ }
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt
index c62f9aa7d..5affead20 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt
@@ -5,12 +5,16 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class BadRequestException
private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) :
- LithicServiceException("400: $body", cause) {
+ LithicServiceException(
+ "400: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = 400
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt
index ab4984f76..5e26debc1 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt
@@ -5,6 +5,7 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
@@ -14,7 +15,11 @@ private constructor(
private val headers: Headers,
private val body: JsonValue,
cause: Throwable?,
-) : LithicServiceException("$statusCode: $body", cause) {
+) :
+ LithicServiceException(
+ "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = statusCode
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt
index 679ba27d6..51b0ebecf 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt
@@ -5,12 +5,16 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class NotFoundException
private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) :
- LithicServiceException("404: $body", cause) {
+ LithicServiceException(
+ "404: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = 404
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt
index 57ac7e4ba..3bc0206d7 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt
@@ -5,12 +5,16 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class PermissionDeniedException
private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) :
- LithicServiceException("403: $body", cause) {
+ LithicServiceException(
+ "403: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = 403
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt
index e4392faca..611834161 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt
@@ -5,12 +5,16 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class RateLimitException
private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) :
- LithicServiceException("429: $body", cause) {
+ LithicServiceException(
+ "429: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = 429
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt
index 258621983..89c417b8a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt
@@ -5,12 +5,16 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class UnauthorizedException
private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) :
- LithicServiceException("401: $body", cause) {
+ LithicServiceException(
+ "401: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = 401
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt
index 13bfc75b2..d7c58ebc5 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt
@@ -5,6 +5,7 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
@@ -14,7 +15,11 @@ private constructor(
private val headers: Headers,
private val body: JsonValue,
cause: Throwable?,
-) : LithicServiceException("$statusCode: $body", cause) {
+) :
+ LithicServiceException(
+ "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = statusCode
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt
index 4b296accd..f6d12260b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt
@@ -5,12 +5,16 @@ package com.lithic.api.errors
import com.lithic.api.core.JsonValue
import com.lithic.api.core.checkRequired
import com.lithic.api.core.http.Headers
+import com.lithic.api.core.jsonMapper
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class UnprocessableEntityException
private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) :
- LithicServiceException("422: $body", cause) {
+ LithicServiceException(
+ "422: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}",
+ cause,
+ ) {
override fun statusCode(): Int = 422
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt
index e10c836a8..a34b3df3d 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt
@@ -504,7 +504,10 @@ private constructor(
* * `OTHER` - The reason for the account's current status does not fall into any of the
* above categories. A comment should be provided to specify the particular reason.
*/
- fun substatus(substatus: Substatus) = substatus(JsonField.of(substatus))
+ fun substatus(substatus: Substatus?) = substatus(JsonField.ofNullable(substatus))
+
+ /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */
+ fun substatus(substatus: Optional) = substatus(substatus.getOrNull())
/**
* Sets [Builder.substatus] to an arbitrary JSON value.
@@ -583,6 +586,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Account = apply {
if (validated) {
return@apply
@@ -817,6 +828,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SpendLimit = apply {
if (validated) {
return@apply
@@ -974,6 +994,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -1251,6 +1280,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolder = apply {
if (validated) {
return@apply
@@ -1458,6 +1496,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Substatus = apply {
if (validated) {
return@apply
@@ -1796,6 +1843,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): VerificationAddress = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
index db504ef48..7fc1a6eb9 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
@@ -218,6 +218,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountActivityListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
index b368fcff1..037acc597 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
@@ -582,6 +582,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionCategory = apply {
if (validated) {
return@apply
@@ -708,6 +717,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Result = apply {
if (validated) {
return@apply
@@ -864,6 +882,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
index 0ad887846..022943a3b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
@@ -116,6 +116,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = accountActivityListResponse.accept(new AccountActivityListResponse.Visitor>() {
+ * @Override
+ * public Optional visitInternal(FinancialTransaction internal_) {
+ * return Optional.of(internal_.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
internal_ != null -> visitor.visitInternal(internal_)
@@ -130,6 +159,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountActivityListResponse = apply {
if (validated) {
return@apply
@@ -994,6 +1031,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): FinancialTransaction = apply {
if (validated) {
return@apply
@@ -1262,6 +1308,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionCategory = apply {
if (validated) {
return@apply
@@ -1386,6 +1442,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Family = apply {
if (validated) {
return@apply
@@ -1520,6 +1586,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionResult = apply {
if (validated) {
return@apply
@@ -1678,6 +1754,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
@@ -3219,6 +3305,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardTransaction = apply {
if (validated) {
return@apply
@@ -3388,6 +3483,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Family = apply {
if (validated) {
return@apply
@@ -3546,6 +3651,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
index 10fb37151..44cdf66df 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
@@ -116,6 +116,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = accountActivityRetrieveTransactionResponse.accept(new AccountActivityRetrieveTransactionResponse.Visitor>() {
+ * @Override
+ * public Optional visitInternal(FinancialTransaction internal_) {
+ * return Optional.of(internal_.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
internal_ != null -> visitor.visitInternal(internal_)
@@ -130,6 +159,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountActivityRetrieveTransactionResponse = apply {
if (validated) {
return@apply
@@ -1016,6 +1053,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): FinancialTransaction = apply {
if (validated) {
return@apply
@@ -1284,6 +1330,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionCategory = apply {
if (validated) {
return@apply
@@ -1408,6 +1464,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Family = apply {
if (validated) {
return@apply
@@ -1542,6 +1608,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionResult = apply {
if (validated) {
return@apply
@@ -1700,6 +1776,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
@@ -3241,6 +3327,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardTransaction = apply {
if (validated) {
return@apply
@@ -3410,6 +3505,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Family = apply {
if (validated) {
return@apply
@@ -3568,6 +3673,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt
index c69e04f63..b71436641 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountFinancialAccountType.kt
@@ -100,6 +100,14 @@ private constructor(private val value: JsonField) : Enum {
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountFinancialAccountType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt
index 2c2f571fe..ef3c727a0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt
@@ -999,6 +999,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolder = apply {
if (validated) {
return@apply
@@ -1407,6 +1415,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderIndividualResponse = apply {
if (validated) {
return@apply
@@ -1883,6 +1900,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderBusinessResponse = apply {
if (validated) {
return@apply
@@ -2049,6 +2075,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ExemptionType = apply {
if (validated) {
return@apply
@@ -2200,6 +2235,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -2382,6 +2426,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReason = apply {
if (validated) {
return@apply
@@ -2513,6 +2566,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): UserType = apply {
if (validated) {
return@apply
@@ -2790,6 +2852,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderVerificationApplication = apply {
if (validated) {
return@apply
@@ -2938,6 +3009,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -3123,6 +3204,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReason = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt
index 8445efb3b..6e3edd9f5 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt
@@ -262,6 +262,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = body.accept(new Body.Visitor>() {
+ * @Override
+ * public Optional visitKyb(Kyb kyb) {
+ * return Optional.of(kyb.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
kyb != null -> visitor.visitKyb(kyb)
@@ -273,6 +302,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -968,6 +1006,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): KybDelegated = apply {
if (validated) {
return@apply
@@ -1386,6 +1434,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): KybDelegatedBusinessEntity = apply {
if (validated) {
return@apply
@@ -1845,6 +1903,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): KybDelegatedIndividual = apply {
if (validated) {
return@apply
@@ -2007,6 +2075,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Workflow = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt
index c6820f40c..9044f05ec 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt
@@ -409,6 +409,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderCreateResponse = apply {
if (validated) {
return@apply
@@ -558,6 +566,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -869,6 +886,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReasons = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt
index b36c267e8..ef2933d6e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreatedWebhookEvent.kt
@@ -384,6 +384,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderCreatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -506,6 +514,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -632,6 +649,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt
index cdde246aa..82898d45b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderDocumentUpdatedWebhookEvent.kt
@@ -388,6 +388,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderDocumentUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -510,6 +518,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -741,6 +758,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DocumentType = apply {
if (validated) {
return@apply
@@ -1191,6 +1217,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): RequiredDocumentUpload = apply {
if (validated) {
return@apply
@@ -1326,6 +1361,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ImageType = apply {
if (validated) {
return@apply
@@ -1479,6 +1524,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DocumentUploadStatus = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt
index 47572e3d8..521a8e3be 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntity.kt
@@ -474,6 +474,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderEntity = apply {
if (validated) {
return@apply
@@ -821,6 +829,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
@@ -986,6 +1003,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EntityStatus = apply {
if (validated) {
return@apply
@@ -1114,6 +1140,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EntityType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt
index fc08f3045..d9d39ec2d 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderEntityCreateParams.kt
@@ -897,6 +897,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CreateEntityRequest = apply {
if (validated) {
return@apply
@@ -1281,6 +1290,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
@@ -1433,6 +1451,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EntityType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt
index 97fa2d330..b790c1a47 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListDocumentsResponse.kt
@@ -136,6 +136,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderListDocumentsResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt
index 0390db024..059394d75 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderListPageResponse.kt
@@ -181,6 +181,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt
index ff1c258e4..e6471981d 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentDocumentReviewParams.kt
@@ -643,6 +643,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SimulateEnrollmentDocumentReviewRequest = apply {
if (validated) {
return@apply
@@ -805,6 +814,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -997,6 +1015,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DocumentUploadStatusReasons = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt
index 94680149b..72877df47 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewParams.kt
@@ -528,6 +528,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SimulateEnrollmentReviewRequest = apply {
if (validated) {
return@apply
@@ -675,6 +684,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -958,6 +976,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReason = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt
index 380871128..2fbef4a30 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt
@@ -209,7 +209,7 @@ private constructor(
fun email(): Optional = email.getOptional("email")
/**
- * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is
+ * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder is
* not KYC-Exempt.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -733,10 +733,15 @@ private constructor(
fun email(email: JsonField) = apply { this.email = email }
/**
- * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder
+ * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder
* is not KYC-Exempt.
*/
- fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType))
+ fun exemptionType(exemptionType: ExemptionType?) =
+ exemptionType(JsonField.ofNullable(exemptionType))
+
+ /** Alias for calling [Builder.exemptionType] with `exemptionType.orElse(null)`. */
+ fun exemptionType(exemptionType: Optional) =
+ exemptionType(exemptionType.getOrNull())
/**
* Sets [Builder.exemptionType] to an arbitrary JSON value.
@@ -1002,6 +1007,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderSimulateEnrollmentReviewResponse = apply {
if (validated) {
return@apply
@@ -1403,6 +1416,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Individual = apply {
if (validated) {
return@apply
@@ -1765,6 +1787,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
@@ -1871,7 +1903,7 @@ private constructor(
}
/**
- * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is
+ * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder is
* not KYC-Exempt.
*/
class ExemptionType @JsonCreator private constructor(private val value: JsonField) :
@@ -1965,6 +1997,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ExemptionType = apply {
if (validated) {
return@apply
@@ -2108,6 +2149,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -2419,6 +2469,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReasons = apply {
if (validated) {
return@apply
@@ -2552,6 +2611,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): UserType = apply {
if (validated) {
return@apply
@@ -2883,6 +2951,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): VerificationApplication = apply {
if (validated) {
return@apply
@@ -3027,6 +3104,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -3343,6 +3430,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReasons = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt
index 8d405a3ad..5150871fe 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateParams.kt
@@ -285,6 +285,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = body.accept(new Body.Visitor>() {
+ * @Override
+ * public Optional visitKybPatchRequest(KybPatchRequest kybPatchRequest) {
+ * return Optional.of(kybPatchRequest.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
kybPatchRequest != null -> visitor.visitKybPatchRequest(kybPatchRequest)
@@ -295,6 +324,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -887,6 +925,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): KybPatchRequest = apply {
if (validated) {
return@apply
@@ -1350,6 +1398,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): IndividualPatch = apply {
if (validated) {
return@apply
@@ -1841,6 +1899,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): KybBusinessEntityPatch = apply {
if (validated) {
return@apply
@@ -2105,6 +2173,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): KycPatchRequest = apply {
if (validated) {
return@apply
@@ -2560,6 +2638,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): IndividualPatch = apply {
if (validated) {
return@apply
@@ -3019,6 +3107,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): PatchRequest = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt
index 538514761..2ac0fd197 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt
@@ -55,6 +55,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = accountHolderUpdateResponse.accept(new AccountHolderUpdateResponse.Visitor>() {
+ * @Override
+ * public Optional visitKybKycPatch(KybKycPatchResponse kybKycPatch) {
+ * return Optional.of(kybKycPatch.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
kybKycPatch != null -> visitor.visitKybKycPatch(kybKycPatch)
@@ -64,6 +93,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderUpdateResponse = apply {
if (validated) {
return@apply
@@ -402,7 +439,7 @@ private constructor(
fun email(): Optional = email.getOptional("email")
/**
- * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder
+ * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder
* is not KYC-Exempt.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -927,7 +964,7 @@ private constructor(
fun email(email: JsonField) = apply { this.email = email }
/**
- * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
+ * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
* holder is not KYC-Exempt.
*/
fun exemptionType(exemptionType: ExemptionType) =
@@ -1203,6 +1240,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): KybKycPatchResponse = apply {
if (validated) {
return@apply
@@ -1619,6 +1665,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Individual = apply {
if (validated) {
return@apply
@@ -1992,6 +2048,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
@@ -2098,7 +2164,7 @@ private constructor(
}
/**
- * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder
+ * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account holder
* is not KYC-Exempt.
*/
class ExemptionType @JsonCreator private constructor(private val value: JsonField) :
@@ -2194,6 +2260,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ExemptionType = apply {
if (validated) {
return@apply
@@ -2341,6 +2417,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -2657,6 +2743,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): StatusReasons = apply {
if (validated) {
return@apply
@@ -2795,6 +2891,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): UserType = apply {
if (validated) {
return@apply
@@ -3142,6 +3248,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): VerificationApplication = apply {
if (validated) {
return@apply
@@ -3288,6 +3404,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -3607,6 +3733,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): StatusReasons = apply {
if (validated) {
return@apply
@@ -4108,6 +4244,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): PatchResponse = apply {
if (validated) {
return@apply
@@ -4469,6 +4614,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt
index 2853c9250..0f5e90f6f 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdatedWebhookEvent.kt
@@ -69,6 +69,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = accountHolderUpdatedWebhookEvent.accept(new AccountHolderUpdatedWebhookEvent.Visitor>() {
+ * @Override
+ * public Optional visitKybPayload(KybPayload kybPayload) {
+ * return Optional.of(kybPayload.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
kybPayload != null -> visitor.visitKybPayload(kybPayload)
@@ -79,6 +108,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -615,6 +652,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): KybPayload = apply {
if (validated) {
return@apply
@@ -899,6 +945,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): UpdateRequest = apply {
if (validated) {
return@apply
@@ -1296,6 +1352,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Individual = apply {
if (validated) {
return@apply
@@ -1676,6 +1742,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected
+ * types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for
+ * existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't
+ * match its expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
@@ -1896,6 +1972,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -2202,6 +2288,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): KycPayload = apply {
if (validated) {
return@apply
@@ -2349,6 +2444,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): UpdateRequest = apply {
if (validated) {
return@apply
@@ -2744,6 +2849,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Individual = apply {
if (validated) {
return@apply
@@ -3124,6 +3239,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected
+ * types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for
+ * existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't
+ * match its expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
@@ -3335,6 +3460,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -3872,6 +4007,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): LegacyPayload = apply {
if (validated) {
return@apply
@@ -4005,6 +4149,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt
index caf308a7d..216c21253 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUploadDocumentParams.kt
@@ -482,6 +482,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -725,6 +734,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DocumentType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt
index 63533cca8..36d14a8b9 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderVerificationWebhookEvent.kt
@@ -325,6 +325,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountHolderVerificationWebhookEvent = apply {
if (validated) {
return@apply
@@ -445,6 +453,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -577,6 +594,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt
index 9de383f89..08833c296 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountListPageResponse.kt
@@ -178,6 +178,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt
index 6e914fdfa..cba0e614b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt
@@ -207,6 +207,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountSpendLimits = apply {
if (validated) {
return@apply
@@ -410,6 +418,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AvailableSpendLimit = apply {
if (validated) {
return@apply
@@ -624,6 +641,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SpendLimit = apply {
if (validated) {
return@apply
@@ -850,6 +876,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SpendVelocity = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt
index 9a75e9e55..9fd8d821c 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt
@@ -337,7 +337,10 @@ private constructor(
* * `OTHER` - The reason for the account's current status does not fall into any of the
* above categories. A comment should be provided to specify the particular reason.
*/
- fun substatus(substatus: Substatus) = apply { body.substatus(substatus) }
+ fun substatus(substatus: Substatus?) = apply { body.substatus(substatus) }
+
+ /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */
+ fun substatus(substatus: Optional) = substatus(substatus.getOrNull())
/**
* Sets [Builder.substatus] to an arbitrary JSON value.
@@ -864,7 +867,10 @@ private constructor(
* * `OTHER` - The reason for the account's current status does not fall into any of the
* above categories. A comment should be provided to specify the particular reason.
*/
- fun substatus(substatus: Substatus) = substatus(JsonField.of(substatus))
+ fun substatus(substatus: Substatus?) = substatus(JsonField.ofNullable(substatus))
+
+ /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */
+ fun substatus(substatus: Optional) = substatus(substatus.getOrNull())
/**
* Sets [Builder.substatus] to an arbitrary JSON value.
@@ -936,6 +942,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -1104,6 +1119,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -1293,6 +1317,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Substatus = apply {
if (validated) {
return@apply
@@ -1589,6 +1622,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): VerificationAddress = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt
index 251f675b2..b33a4f5a8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Address.kt
@@ -311,6 +311,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Address = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt
index f62d09bce..80554daec 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AddressUpdate.kt
@@ -286,6 +286,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AddressUpdate = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt
index 0ec8538f5..e2529b0c3 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ApiStatus.kt
@@ -109,6 +109,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ApiStatus = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
index 6741e8056..c259a8dc6 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
@@ -205,7 +205,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
@@ -655,7 +655,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -821,6 +821,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRule = apply {
if (validated) {
return@apply
@@ -1030,6 +1038,20 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/**
* Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`.
*/
@@ -1092,6 +1114,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CurrentVersion = apply {
if (validated) {
return@apply
@@ -1135,6 +1166,9 @@ private constructor(
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? =
null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -1162,6 +1196,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -1180,6 +1218,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -1204,12 +1245,48 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given
+ * [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API,
+ * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this
+ * version of the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in
+ * [visitor] and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -1224,12 +1301,26 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -1277,6 +1368,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
typescriptCode.validate()
}
@@ -1330,6 +1428,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
typescriptCode.validity()
@@ -1350,6 +1453,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -1362,6 +1467,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -1379,6 +1485,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -1418,6 +1526,16 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction =
+ conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -1454,6 +1572,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -1513,6 +1636,18 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())
?.let { Parameters(typescriptCode = it, _json = json) },
)
@@ -1553,6 +1688,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
@@ -1803,6 +1940,20 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/**
* Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`.
*/
@@ -1890,6 +2041,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DraftVersion = apply {
if (validated) {
return@apply
@@ -1937,6 +2097,9 @@ private constructor(
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? =
null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -1964,6 +2127,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -1982,6 +2149,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -2006,12 +2176,48 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given
+ * [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API,
+ * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this
+ * version of the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in
+ * [visitor] and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -2026,12 +2232,26 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -2079,6 +2299,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
typescriptCode.validate()
}
@@ -2132,6 +2359,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
typescriptCode.validity()
@@ -2152,6 +2384,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -2164,6 +2398,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -2181,6 +2416,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -2220,6 +2457,16 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction =
+ conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -2256,6 +2503,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -2315,6 +2567,18 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())
?.let { Parameters(typescriptCode = it, _json = json) },
)
@@ -2355,6 +2619,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
@@ -2470,6 +2736,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -2623,6 +2899,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleState = apply {
if (validated) {
return@apply
@@ -2670,7 +2955,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -2782,6 +3067,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt
index 36cc454d0..24b8c8aba 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt
@@ -312,6 +312,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleCondition = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt
index 12f72e913..6a572b839 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt
@@ -435,6 +435,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BacktestRequest = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
index c90ef0ae5..c89f285dd 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
@@ -246,6 +246,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = body.accept(new Body.Visitor>() {
+ * @Override
+ * public Optional visitAccountLevelRule(AccountLevelRule accountLevelRule) {
+ * return Optional.of(accountLevelRule.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
accountLevelRule != null -> visitor.visitAccountLevelRule(accountLevelRule)
@@ -256,6 +285,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -478,7 +516,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
@@ -696,6 +734,20 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/**
* Alias for calling [parameters] with
* `Parameters.ofTypescriptCode(typescriptCode)`.
@@ -713,7 +765,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -860,6 +912,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountLevelRule = apply {
if (validated) {
return@apply
@@ -913,6 +975,9 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -942,6 +1007,10 @@ private constructor(
Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -963,6 +1032,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean =
conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -988,12 +1060,48 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given
+ * [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the
+ * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known
+ * to this version of the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in
+ * [visitor] and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -1012,12 +1120,26 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -1067,6 +1189,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(
typescriptCode: TypescriptCodeParameters
) {
@@ -1124,6 +1253,11 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(
typescriptCode: TypescriptCodeParameters
) = typescriptCode.validity()
@@ -1145,6 +1279,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -1157,6 +1293,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -1174,6 +1311,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -1215,6 +1354,16 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction =
+ conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -1251,6 +1400,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -1325,6 +1479,18 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())
?.let { Parameters(typescriptCode = it, _json = json) },
)
@@ -1366,6 +1532,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null ->
generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
@@ -1384,7 +1552,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -1501,6 +1669,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): AuthRuleType = apply {
if (validated) {
return@apply
@@ -1627,7 +1805,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
@@ -1841,6 +2019,20 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/**
* Alias for calling [parameters] with
* `Parameters.ofTypescriptCode(typescriptCode)`.
@@ -1858,7 +2050,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -1951,6 +2143,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardLevelRule = apply {
if (validated) {
return@apply
@@ -2002,6 +2204,9 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -2031,6 +2236,10 @@ private constructor(
Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -2052,6 +2261,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean =
conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -2077,12 +2289,48 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given
+ * [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the
+ * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known
+ * to this version of the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in
+ * [visitor] and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -2101,12 +2349,26 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -2156,6 +2418,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(
typescriptCode: TypescriptCodeParameters
) {
@@ -2213,6 +2482,11 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(
typescriptCode: TypescriptCodeParameters
) = typescriptCode.validity()
@@ -2234,6 +2508,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -2246,6 +2522,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -2263,6 +2540,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -2304,6 +2583,16 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction =
+ conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -2340,6 +2629,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -2414,6 +2708,18 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())
?.let { Parameters(typescriptCode = it, _json = json) },
)
@@ -2455,6 +2761,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null ->
generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
@@ -2473,7 +2781,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -2590,6 +2898,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): AuthRuleType = apply {
if (validated) {
return@apply
@@ -2729,7 +3047,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
@@ -2984,6 +3302,20 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/**
* Alias for calling [parameters] with
* `Parameters.ofTypescriptCode(typescriptCode)`.
@@ -3015,7 +3347,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -3198,6 +3530,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ProgramLevelRule = apply {
if (validated) {
return@apply
@@ -3255,6 +3597,9 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -3284,6 +3629,10 @@ private constructor(
Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -3305,6 +3654,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean =
conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -3330,12 +3682,48 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given
+ * [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the
+ * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known
+ * to this version of the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in
+ * [visitor] and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -3354,12 +3742,26 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -3409,6 +3811,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(
typescriptCode: TypescriptCodeParameters
) {
@@ -3466,6 +3875,11 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(
typescriptCode: TypescriptCodeParameters
) = typescriptCode.validity()
@@ -3487,6 +3901,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -3499,6 +3915,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -3516,6 +3933,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -3557,6 +3976,16 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction =
+ conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -3593,6 +4022,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -3667,6 +4101,18 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())
?.let { Parameters(typescriptCode = it, _json = json) },
)
@@ -3708,6 +4154,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null ->
generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
@@ -3726,7 +4174,7 @@ private constructor(
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
- * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event stream.
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
@@ -3843,6 +4291,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): AuthRuleType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
index c375bbbb6..1453ca694 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
@@ -180,6 +180,14 @@ private constructor(
body.parameters(conditionalTokenizationAction)
}
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction: ConditionalCardTransactionUpdateActionParameters
+ ) = apply { body.parameters(conditionalCardTransactionUpdateAction) }
+
/** Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */
fun parameters(typescriptCode: TypescriptCodeParameters) = apply {
body.parameters(typescriptCode)
@@ -459,6 +467,20 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/**
* Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`.
*/
@@ -494,6 +516,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -551,6 +582,9 @@ private constructor(
null,
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -577,6 +611,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -595,6 +633,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -619,12 +660,47 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -638,12 +714,25 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -691,6 +780,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
typescriptCode.validate()
}
@@ -744,6 +840,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
typescriptCode.validity()
@@ -764,6 +865,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -776,6 +879,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -793,6 +897,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -832,6 +938,15 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction = conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -863,6 +978,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -914,6 +1034,18 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())?.let {
Parameters(typescriptCode = it, _json = json)
},
@@ -954,6 +1086,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt
index e9f95f3c1..3d3300d41 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponse.kt
@@ -181,6 +181,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleV2ListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt
index 87e83eaec..0966add33 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt
@@ -450,6 +450,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Scope = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt
index 4276fd480..3a25d7ed0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt
@@ -210,6 +210,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleV2ListResultsPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt
index c55df6a61..0c0a0b4e2 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt
@@ -270,6 +270,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = body.accept(new Body.Visitor>() {
+ * @Override
+ * public Optional visitAccountLevelRule(AccountLevelRule accountLevelRule) {
+ * return Optional.of(accountLevelRule.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
accountLevelRule != null -> visitor.visitAccountLevelRule(accountLevelRule)
@@ -280,6 +309,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -701,6 +739,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountLevelRule = apply {
if (validated) {
return@apply
@@ -828,6 +876,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -1096,6 +1154,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardLevelRule = apply {
if (validated) {
return@apply
@@ -1221,6 +1289,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -1647,6 +1725,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ProgramLevelRule = apply {
if (validated) {
return@apply
@@ -1778,6 +1866,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt
index c3918b33c..0dc2810dc 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt
@@ -232,6 +232,19 @@ private constructor(
fun parameters(conditionalTokenizationAction: ConditionalTokenizationActionParameters) =
parameters(Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction))
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalCardTransactionUpdateAction(conditionalCardTransactionUpdateAction)`.
+ */
+ fun parameters(
+ conditionalCardTransactionUpdateAction: ConditionalCardTransactionUpdateActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
+ )
+
/** Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */
fun parameters(typescriptCode: TypescriptCodeParameters) =
parameters(Parameters.ofTypescriptCode(typescriptCode))
@@ -305,6 +318,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleVersion = apply {
if (validated) {
return@apply
@@ -350,6 +371,9 @@ private constructor(
null,
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null,
+ private val conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters? =
+ null,
private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -376,6 +400,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ fun conditionalCardTransactionUpdateAction():
+ Optional =
+ Optional.ofNullable(conditionalCardTransactionUpdateAction)
+
/** Parameters for defining a TypeScript code rule */
fun typescriptCode(): Optional =
Optional.ofNullable(typescriptCode)
@@ -394,6 +422,9 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isConditionalCardTransactionUpdateAction(): Boolean =
+ conditionalCardTransactionUpdateAction != null
+
fun isTypescriptCode(): Boolean = typescriptCode != null
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@@ -418,12 +449,47 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ fun asConditionalCardTransactionUpdateAction():
+ ConditionalCardTransactionUpdateActionParameters =
+ conditionalCardTransactionUpdateAction.getOrThrow(
+ "conditionalCardTransactionUpdateAction"
+ )
+
/** Parameters for defining a TypeScript code rule */
fun asTypescriptCode(): TypescriptCodeParameters =
typescriptCode.getOrThrow("typescriptCode")
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = parameters.accept(new Parameters.Visitor>() {
+ * @Override
+ * public Optional visitConditionalBlock(ConditionalBlockParameters conditionalBlock) {
+ * return Optional.of(conditionalBlock.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
@@ -437,12 +503,25 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ conditionalCardTransactionUpdateAction != null ->
+ visitor.visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction
+ )
typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Parameters = apply {
if (validated) {
return@apply
@@ -490,6 +569,13 @@ private constructor(
conditionalTokenizationAction.validate()
}
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) {
+ conditionalCardTransactionUpdateAction.validate()
+ }
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
typescriptCode.validate()
}
@@ -543,6 +629,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) = conditionalCardTransactionUpdateAction.validity()
+
override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
typescriptCode.validity()
@@ -563,6 +654,8 @@ private constructor(
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ conditionalCardTransactionUpdateAction ==
+ other.conditionalCardTransactionUpdateAction &&
typescriptCode == other.typescriptCode
}
@@ -575,6 +668,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ conditionalCardTransactionUpdateAction,
typescriptCode,
)
@@ -592,6 +686,8 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ conditionalCardTransactionUpdateAction != null ->
+ "Parameters{conditionalCardTransactionUpdateAction=$conditionalCardTransactionUpdateAction}"
typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
@@ -631,6 +727,15 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+ @JvmStatic
+ fun ofConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ) =
+ Parameters(
+ conditionalCardTransactionUpdateAction = conditionalCardTransactionUpdateAction
+ )
+
/** Parameters for defining a TypeScript code rule */
@JvmStatic
fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
@@ -662,6 +767,11 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ fun visitConditionalCardTransactionUpdateAction(
+ conditionalCardTransactionUpdateAction:
+ ConditionalCardTransactionUpdateActionParameters
+ ): T
+
/** Parameters for defining a TypeScript code rule */
fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
@@ -713,6 +823,18 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalCardTransactionUpdateActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalCardTransactionUpdateAction = it,
+ _json = json,
+ )
+ },
tryDeserialize(node, jacksonTypeRef())?.let {
Parameters(typescriptCode = it, _json = json)
},
@@ -753,6 +875,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.conditionalCardTransactionUpdateAction != null ->
+ generator.writeObject(value.conditionalCardTransactionUpdateAction)
value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
@@ -861,6 +985,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRuleVersionState = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt
index ff370c130..0c5d8b43b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt
@@ -265,6 +265,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthRulesBacktestReportCreatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -382,6 +390,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt
index ef0a8ecdc..14b354311 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthStreamSecret.kt
@@ -113,6 +113,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthStreamSecret = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt
index 5512e68af..15e6c5e1b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationSimulateResponse.kt
@@ -117,6 +117,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthenticationSimulateResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt
index 9d383130c..e3e72ab64 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestCreateResponse.kt
@@ -120,6 +120,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BacktestCreateResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt
index 6ace5eb0b..7c75ae5ba 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt
@@ -211,6 +211,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BacktestResults = apply {
if (validated) {
return@apply
@@ -390,6 +398,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Results = apply {
if (validated) {
return@apply
@@ -594,6 +611,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BacktestSimulationParameters = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt
index f26fbdc65..f0a7f793d 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt
@@ -280,6 +280,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BacktestStats = apply {
if (validated) {
return@apply
@@ -538,6 +546,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Example = apply {
if (validated) {
return@apply
@@ -670,6 +687,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Decision = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt
index 2f5c9d450..f9f4e799f 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt
@@ -519,6 +519,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Balance = apply {
if (validated) {
return@apply
@@ -669,6 +677,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): FinancialAccountType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt
index 3036f1d76..5a93ede2b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListPageResponse.kt
@@ -178,6 +178,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BalanceListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt
index 9fc6ad4b4..c65efde51 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceListParams.kt
@@ -347,6 +347,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): FinancialAccountType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt
index 70e8dbd4c..8b7cdcfea 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BalanceUpdatedWebhookEvent.kt
@@ -186,6 +186,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BalanceUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -298,6 +306,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt
index b61270767..6272f8821 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt
@@ -1067,6 +1067,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CreateBookTransferRequest = apply {
if (validated) {
return@apply
@@ -1292,6 +1301,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferCategory = apply {
if (validated) {
return@apply
@@ -1620,6 +1638,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferType = apply {
if (validated) {
return@apply
@@ -1750,6 +1777,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): OnClosedAccount = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt
index 3466f1e59..bcc12b208 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListPageResponse.kt
@@ -177,6 +177,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt
index 874693b3c..ae97f9ae4 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferListParams.kt
@@ -505,6 +505,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferCategory = apply {
if (validated) {
return@apply
@@ -631,6 +640,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Result = apply {
if (validated) {
return@apply
@@ -757,6 +775,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt
index b5aaffabe..d69299aa8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt
@@ -762,6 +762,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferResponse = apply {
if (validated) {
return@apply
@@ -953,6 +961,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferCategory = apply {
if (validated) {
return@apply
@@ -1387,6 +1404,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferEvent = apply {
if (validated) {
return@apply
@@ -1527,6 +1553,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferDetailedResults = apply {
if (validated) {
return@apply
@@ -1660,6 +1696,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Result = apply {
if (validated) {
return@apply
@@ -1992,6 +2038,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferType = apply {
if (validated) {
return@apply
@@ -2149,6 +2205,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Family = apply {
if (validated) {
return@apply
@@ -2278,6 +2343,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionResult = apply {
if (validated) {
return@apply
@@ -2432,6 +2506,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
@@ -2679,6 +2762,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionSeries = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt
index 193e3c6de..73a8326f0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt
@@ -392,6 +392,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): RetryBookTransferRequest = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt
index 29edfbc0b..10926d9ac 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferReverseParams.kt
@@ -350,6 +350,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt
index 402c6edc5..7d229cd77 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionCreatedWebhookEvent.kt
@@ -843,6 +843,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferTransactionCreatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -986,6 +994,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt
index 9f582acff..b3b73db1e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferTransactionUpdatedWebhookEvent.kt
@@ -843,6 +843,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): BookTransferTransactionUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -986,6 +994,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
index 605ca9af2..7b619e656 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
@@ -206,12 +206,12 @@ private constructor(
fun created(): OffsetDateTime = created.getRequired("created")
/**
- * Deprecated: Funding account for the card.
+ * Funding account for a card
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun funding(): NonPciCard.FundingAccount = funding.getRequired("funding")
+ fun funding(): Optional = funding.getOptional("funding")
/**
* Last four digits of the card number.
@@ -822,8 +822,11 @@ private constructor(
*/
fun created(created: JsonField) = apply { this.created = created }
- /** Deprecated: Funding account for the card. */
- fun funding(funding: NonPciCard.FundingAccount) = funding(JsonField.of(funding))
+ /** Funding account for a card */
+ fun funding(funding: NonPciCard.FundingAccount?) = funding(JsonField.ofNullable(funding))
+
+ /** Alias for calling [Builder.funding] with `funding.orElse(null)`. */
+ fun funding(funding: Optional) = funding(funding.getOrNull())
/**
* Sets [Builder.funding] to an arbitrary JSON value.
@@ -1040,8 +1043,14 @@ private constructor(
* tokenization. This artwork must be approved by Mastercard and configured by Lithic to
* use.
*/
- fun digitalCardArtToken(digitalCardArtToken: String) =
- digitalCardArtToken(JsonField.of(digitalCardArtToken))
+ fun digitalCardArtToken(digitalCardArtToken: String?) =
+ digitalCardArtToken(JsonField.ofNullable(digitalCardArtToken))
+
+ /**
+ * Alias for calling [Builder.digitalCardArtToken] with `digitalCardArtToken.orElse(null)`.
+ */
+ fun digitalCardArtToken(digitalCardArtToken: Optional) =
+ digitalCardArtToken(digitalCardArtToken.getOrNull())
/**
* Sets [Builder.digitalCardArtToken] to an arbitrary JSON value.
@@ -1159,7 +1168,10 @@ private constructor(
* use. Specifies the configuration (i.e., physical card art) that the card should be
* manufactured with.
*/
- fun productId(productId: String) = productId(JsonField.of(productId))
+ fun productId(productId: String?) = productId(JsonField.ofNullable(productId))
+
+ /** Alias for calling [Builder.productId] with `productId.orElse(null)`. */
+ fun productId(productId: Optional) = productId(productId.getOrNull())
/**
* Sets [Builder.productId] to an arbitrary JSON value.
@@ -1212,7 +1224,10 @@ private constructor(
* has been returned. * `OTHER` - The reason for the status does not fall into any of the
* above categories. A comment can be provided to specify the reason.
*/
- fun substatus(substatus: NonPciCard.Substatus) = substatus(JsonField.of(substatus))
+ fun substatus(substatus: NonPciCard.Substatus?) = substatus(JsonField.ofNullable(substatus))
+
+ /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */
+ fun substatus(substatus: Optional) = substatus(substatus.getOrNull())
/**
* Sets [Builder.substatus] to an arbitrary JSON value.
@@ -1327,6 +1342,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Card = apply {
if (validated) {
return@apply
@@ -1336,7 +1359,7 @@ private constructor(
accountToken()
cardProgramToken()
created()
- funding().validate()
+ funding().ifPresent { it.validate() }
lastFour()
pinStatus().validate()
spendLimit()
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt
index a90b2f513..09a7f2047 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt
@@ -1423,6 +1423,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardAuthorizationApprovalRequestWebhookEvent = apply {
if (validated) {
return@apply
@@ -1740,6 +1748,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Amounts = apply {
if (validated) {
return@apply
@@ -1974,6 +1991,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ConvertedAmount = apply {
if (validated) {
return@apply
@@ -2185,6 +2212,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Amount = apply {
if (validated) {
return@apply
@@ -2458,6 +2495,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Avs = apply {
if (validated) {
return@apply
@@ -2608,6 +2654,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AddressMatchResult = apply {
if (validated) {
return@apply
@@ -3016,6 +3072,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaRequestCard = apply {
if (validated) {
return@apply
@@ -3168,6 +3233,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SpendLimitDuration = apply {
if (validated) {
return@apply
@@ -3315,6 +3390,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -3469,6 +3554,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardType = apply {
if (validated) {
return@apply
@@ -3626,6 +3721,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -4167,6 +4271,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionMerchant = apply {
if (validated) {
return@apply
@@ -4538,6 +4651,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ServiceLocation = apply {
if (validated) {
return@apply
@@ -4711,6 +4833,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaRequestStatus = apply {
if (validated) {
return@apply
@@ -4849,6 +4980,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): TransactionInitiator = apply {
if (validated) {
return@apply
@@ -4977,6 +5117,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AccountType = apply {
if (validated) {
return@apply
@@ -5284,6 +5433,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaRequestFleetInfo = apply {
if (validated) {
return@apply
@@ -5422,6 +5580,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): FleetPromptCode = apply {
if (validated) {
return@apply
@@ -5561,6 +5729,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): FleetRestrictionCode = apply {
if (validated) {
return@apply
@@ -5837,6 +6015,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): LatestChallenge = apply {
if (validated) {
return@apply
@@ -5978,6 +6165,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
@@ -6150,6 +6347,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Network = apply {
if (validated) {
return@apply
@@ -6341,6 +6547,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaNetworkSpecificData = apply {
if (validated) {
return@apply
@@ -6629,6 +6844,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaNetworkSpecificDataMastercard = apply {
if (validated) {
return@apply
@@ -6866,6 +7091,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): OnBehalfServiceResult = apply {
if (validated) {
return@apply
@@ -7078,6 +7313,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaNetworkSpecificDataVisa = apply {
if (validated) {
return@apply
@@ -7280,6 +7525,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Pos = apply {
if (validated) {
return@apply
@@ -7531,6 +7785,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaRequestPosEntryMode = apply {
if (validated) {
return@apply
@@ -7663,6 +7927,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Card = apply {
if (validated) {
return@apply
@@ -7838,6 +8112,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Cardholder = apply {
if (validated) {
return@apply
@@ -8047,6 +8331,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Pan = apply {
if (validated) {
return@apply
@@ -8549,6 +8843,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AsaPosTerminal = apply {
if (validated) {
return@apply
@@ -8696,6 +9000,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Operator = apply {
if (validated) {
return@apply
@@ -8842,6 +9156,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): PinCapability = apply {
if (validated) {
return@apply
@@ -9105,6 +9429,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): Type = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt
index ba0b8c2f8..b25e3f7a0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationChallengeResponseWebhookEvent.kt
@@ -423,6 +423,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardAuthorizationChallengeResponseWebhookEvent = apply {
if (validated) {
return@apply
@@ -549,6 +557,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ChallengeMethod = apply {
if (validated) {
return@apply
@@ -672,6 +689,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -798,6 +824,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Response = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt
index de66298c0..884a921e0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBalanceListPageResponse.kt
@@ -182,6 +182,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardBalanceListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt
index d0a765734..c8e431ee8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt
@@ -429,6 +429,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardBulkOrder = apply {
if (validated) {
return@apply
@@ -574,6 +582,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
@@ -703,6 +720,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt
index e230278b1..fa8e66bac 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt
@@ -520,6 +520,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CreateBulkOrderRequest = apply {
if (validated) {
return@apply
@@ -678,6 +687,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt
index 2d10152ee..5c7be111a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListPageResponse.kt
@@ -181,6 +181,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardBulkOrderListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt
index 2acbedea9..5afd1a354 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt
@@ -382,6 +382,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): UpdateBulkOrderRequest = apply {
if (validated) {
return@apply
@@ -507,6 +516,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt
index cf9eef55f..c6d2cd0ca 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt
@@ -657,6 +657,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -848,6 +857,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt
index f22f05feb..c33598207 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertedWebhookEvent.kt
@@ -169,6 +169,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardConvertedWebhookEvent = apply {
if (validated) {
return@apply
@@ -281,6 +289,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt
index efa44b41c..908d33f3c 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt
@@ -106,7 +106,7 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an expiration
- * date will be generated.
+ * date five years in the future will be generated. Five years is the maximum expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -115,7 +115,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -591,7 +592,8 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expMonth(expMonth: String) = apply { body.expMonth(expMonth) }
@@ -605,7 +607,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expYear(expYear: String) = apply { body.expYear(expYear) }
@@ -1181,7 +1184,8 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -1190,7 +1194,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -1721,7 +1726,8 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expMonth(expMonth: String) = expMonth(JsonField.of(expMonth))
@@ -1736,7 +1742,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expYear(expYear: String) = expYear(JsonField.of(expYear))
@@ -2056,6 +2063,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -2307,6 +2323,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Type = apply {
if (validated) {
return@apply
@@ -2515,6 +2540,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ReplacementSubstatus = apply {
if (validated) {
return@apply
@@ -2688,6 +2722,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
@@ -2818,6 +2861,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt
index f811cd601..83103a644 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreatedWebhookEvent.kt
@@ -213,6 +213,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardCreatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -327,6 +335,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt
index 6c256504d..a5ac35bca 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListPageResponse.kt
@@ -184,6 +184,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardFinancialTransactionListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt
index 2b2c085dc..cb08efd33 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardFinancialTransactionListParams.kt
@@ -402,6 +402,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Category = apply {
if (validated) {
return@apply
@@ -528,6 +537,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Result = apply {
if (validated) {
return@apply
@@ -678,6 +696,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Status = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt
index 248710f1f..c77380b0d 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListPageResponse.kt
@@ -178,6 +178,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt
index 750ff0d53..c567fda26 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt
@@ -419,6 +419,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt
index 485b9f183..db0415fcd 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt
@@ -438,6 +438,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardProgram = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt
index f9d40cf32..cce79aea6 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgramListPageResponse.kt
@@ -178,6 +178,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardProgramListPageResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt
index d163e2849..7edef2787 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionParams.kt
@@ -766,6 +766,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -934,6 +943,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DigitalWallet = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt
index 8382e238f..f53ea4dfb 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt
@@ -150,6 +150,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardProvisionResponse = apply {
if (validated) {
return@apply
@@ -220,6 +228,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = provisioningPayload.accept(new ProvisioningPayload.Visitor>() {
+ * @Override
+ * public Optional visitString(String string) {
+ * return Optional.of(string.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
string != null -> visitor.visitString(string)
@@ -229,6 +266,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ProvisioningPayload = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt
index 5567f4697..09545c5c3 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt
@@ -627,6 +627,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -818,6 +827,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt
index db0ad80b1..3b07dadc3 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissuedWebhookEvent.kt
@@ -168,6 +168,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardReissuedWebhookEvent = apply {
if (validated) {
return@apply
@@ -280,6 +288,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt
index 0f50a0c78..248bcf9d2 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt
@@ -58,7 +58,7 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an expiration
- * date six years in the future will be generated.
+ * date five years in the future will be generated. Five years is the maximum expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -67,7 +67,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -232,7 +233,8 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expMonth(expMonth: String) = apply { body.expMonth(expMonth) }
@@ -246,7 +248,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expYear(expYear: String) = apply { body.expYear(expYear) }
@@ -510,7 +513,8 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -519,7 +523,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -681,7 +686,8 @@ private constructor(
/**
* Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expMonth(expMonth: String) = expMonth(JsonField.of(expMonth))
@@ -696,7 +702,8 @@ private constructor(
/**
* Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an
- * expiration date six years in the future will be generated.
+ * expiration date five years in the future will be generated. Five years is the maximum
+ * expiration date.
*/
fun expYear(expYear: String) = expYear(JsonField.of(expYear))
@@ -800,6 +807,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -1005,6 +1021,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt
index 03834f563..2dc25c6de 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewedWebhookEvent.kt
@@ -317,6 +317,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardRenewedWebhookEvent = apply {
if (validated) {
return@apply
@@ -437,6 +445,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt
index 6bfce74d2..deab4b3ed 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSearchByPanParams.kt
@@ -358,6 +358,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt
index 3cc66baac..ee2a5d0d5 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardShippedWebhookEvent.kt
@@ -301,6 +301,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardShippedWebhookEvent = apply {
if (validated) {
return@apply
@@ -419,6 +427,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
@@ -607,6 +624,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ShippingMethod = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt
index 08d43702f..665dab979 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt
@@ -207,6 +207,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardSpendLimits = apply {
if (validated) {
return@apply
@@ -410,6 +418,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AvailableSpendLimit = apply {
if (validated) {
return@apply
@@ -624,6 +641,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SpendLimit = apply {
if (validated) {
return@apply
@@ -850,6 +876,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): SpendVelocity = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt
index 6037dd0ea..2798c9221 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataCreatedWebhookEvent.kt
@@ -344,6 +344,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardTransactionEnhancedDataCreatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -468,6 +476,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt
index a2cc1de04..658f29c2c 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionEnhancedDataUpdatedWebhookEvent.kt
@@ -344,6 +344,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardTransactionEnhancedDataUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -468,6 +476,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt
new file mode 100644
index 000000000..52b12b4bc
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt
@@ -0,0 +1,1143 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+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.fasterxml.jackson.core.JsonGenerator
+import com.fasterxml.jackson.core.ObjectCodec
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.annotation.JsonSerialize
+import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
+import com.lithic.api.core.BaseDeserializer
+import com.lithic.api.core.BaseSerializer
+import com.lithic.api.core.Enum
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.allMaxBy
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.getOrThrow
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+@JsonDeserialize(using = CardTransactionUpdateAction.Deserializer::class)
+@JsonSerialize(using = CardTransactionUpdateAction.Serializer::class)
+class CardTransactionUpdateAction
+private constructor(
+ private val tag: TagAction? = null,
+ private val createCase: CreateCaseAction? = null,
+ private val _json: JsonValue? = null,
+) {
+
+ fun tag(): Optional = Optional.ofNullable(tag)
+
+ fun createCase(): Optional = Optional.ofNullable(createCase)
+
+ fun isTag(): Boolean = tag != null
+
+ fun isCreateCase(): Boolean = createCase != null
+
+ fun asTag(): TagAction = tag.getOrThrow("tag")
+
+ fun asCreateCase(): CreateCaseAction = createCase.getOrThrow("createCase")
+
+ fun _json(): Optional = Optional.ofNullable(_json)
+
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = cardTransactionUpdateAction.accept(new CardTransactionUpdateAction.Visitor>() {
+ * @Override
+ * public Optional visitTag(TagAction tag) {
+ * return Optional.of(tag.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
+ fun accept(visitor: Visitor): T =
+ when {
+ tag != null -> visitor.visitTag(tag)
+ createCase != null -> visitor.visitCreateCase(createCase)
+ else -> visitor.unknown(_json)
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): CardTransactionUpdateAction = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accept(
+ object : Visitor {
+ override fun visitTag(tag: TagAction) {
+ tag.validate()
+ }
+
+ override fun visitCreateCase(createCase: CreateCaseAction) {
+ createCase.validate()
+ }
+ }
+ )
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ 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 =
+ accept(
+ object : Visitor {
+ override fun visitTag(tag: TagAction) = tag.validity()
+
+ override fun visitCreateCase(createCase: CreateCaseAction) = createCase.validity()
+
+ override fun unknown(json: JsonValue?) = 0
+ }
+ )
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CardTransactionUpdateAction &&
+ tag == other.tag &&
+ createCase == other.createCase
+ }
+
+ override fun hashCode(): Int = Objects.hash(tag, createCase)
+
+ override fun toString(): String =
+ when {
+ tag != null -> "CardTransactionUpdateAction{tag=$tag}"
+ createCase != null -> "CardTransactionUpdateAction{createCase=$createCase}"
+ _json != null -> "CardTransactionUpdateAction{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid CardTransactionUpdateAction")
+ }
+
+ companion object {
+
+ @JvmStatic fun ofTag(tag: TagAction) = CardTransactionUpdateAction(tag = tag)
+
+ @JvmStatic
+ fun ofCreateCase(createCase: CreateCaseAction) =
+ CardTransactionUpdateAction(createCase = createCase)
+ }
+
+ /**
+ * An interface that defines how to map each variant of [CardTransactionUpdateAction] to a value
+ * of type [T].
+ */
+ interface Visitor {
+
+ fun visitTag(tag: TagAction): T
+
+ fun visitCreateCase(createCase: CreateCaseAction): T
+
+ /**
+ * Maps an unknown variant of [CardTransactionUpdateAction] to a value of type [T].
+ *
+ * An instance of [CardTransactionUpdateAction] can contain an unknown variant if it was
+ * deserialized from data that doesn't match any known variant. For example, if the SDK is
+ * on an older version than the API, then the API may respond with new variants that the SDK
+ * is unaware of.
+ *
+ * @throws LithicInvalidDataException in the default implementation.
+ */
+ fun unknown(json: JsonValue?): T {
+ throw LithicInvalidDataException("Unknown CardTransactionUpdateAction: $json")
+ }
+ }
+
+ internal class Deserializer :
+ BaseDeserializer(CardTransactionUpdateAction::class) {
+
+ override fun ObjectCodec.deserialize(node: JsonNode): CardTransactionUpdateAction {
+ val json = JsonValue.fromJsonNode(node)
+
+ val bestMatches =
+ sequenceOf(
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ CardTransactionUpdateAction(tag = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ CardTransactionUpdateAction(createCase = it, _json = json)
+ },
+ )
+ .filterNotNull()
+ .allMaxBy { it.validity() }
+ .toList()
+ return when (bestMatches.size) {
+ // This can happen if what we're deserializing is completely incompatible with all
+ // the possible variants (e.g. deserializing from boolean).
+ 0 -> CardTransactionUpdateAction(_json = json)
+ 1 -> bestMatches.single()
+ // If there's more than one match with the highest validity, then use the first
+ // completely valid match, or simply the first match if none are completely valid.
+ else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first()
+ }
+ }
+ }
+
+ internal class Serializer :
+ BaseSerializer(CardTransactionUpdateAction::class) {
+
+ override fun serialize(
+ value: CardTransactionUpdateAction,
+ generator: JsonGenerator,
+ provider: SerializerProvider,
+ ) {
+ when {
+ value.tag != null -> generator.writeObject(value.tag)
+ value.createCase != null -> generator.writeObject(value.createCase)
+ value._json != null -> generator.writeObject(value._json)
+ else -> throw IllegalStateException("Invalid CardTransactionUpdateAction")
+ }
+ }
+ }
+
+ class TagAction
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val key: JsonField,
+ private val type: JsonField,
+ private val value: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("key") @ExcludeMissing key: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(),
+ ) : this(key, type, value, mutableMapOf())
+
+ /**
+ * The key of the tag to apply to the transaction
+ *
+ * @throws LithicInvalidDataException 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 key(): String = key.getRequired("key")
+
+ /**
+ * Tag the transaction with key-value metadata
+ *
+ * @throws LithicInvalidDataException 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 type(): Type = type.getRequired("type")
+
+ /**
+ * The value of the tag to apply to the transaction
+ *
+ * @throws LithicInvalidDataException 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 value(): String = value.getRequired("value")
+
+ /**
+ * Returns the raw JSON value of [key].
+ *
+ * Unlike [key], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("key") @ExcludeMissing fun _key(): JsonField = key
+
+ /**
+ * Returns the raw JSON value of [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ /**
+ * Returns the raw JSON value of [value].
+ *
+ * Unlike [value], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value
+
+ @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 [TagAction].
+ *
+ * The following fields are required:
+ * ```java
+ * .key()
+ * .type()
+ * .value()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [TagAction]. */
+ class Builder internal constructor() {
+
+ private var key: JsonField? = null
+ private var type: JsonField? = null
+ private var value: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(tagAction: TagAction) = apply {
+ key = tagAction.key
+ type = tagAction.type
+ value = tagAction.value
+ additionalProperties = tagAction.additionalProperties.toMutableMap()
+ }
+
+ /** The key of the tag to apply to the transaction */
+ fun key(key: String) = key(JsonField.of(key))
+
+ /**
+ * Sets [Builder.key] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.key] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun key(key: JsonField) = apply { this.key = key }
+
+ /** Tag the transaction with key-value metadata */
+ fun type(type: Type) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [Type] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ /** The value of the tag to apply to the transaction */
+ fun value(value: String) = value(JsonField.of(value))
+
+ /**
+ * Sets [Builder.value] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.value] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun value(value: JsonField) = apply { this.value = value }
+
+ 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 [TagAction].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .key()
+ * .type()
+ * .value()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): TagAction =
+ TagAction(
+ checkRequired("key", key),
+ checkRequired("type", type),
+ checkRequired("value", value),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): TagAction = apply {
+ if (validated) {
+ return@apply
+ }
+
+ key()
+ type().validate()
+ value()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ 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 (key.asKnown().isPresent) 1 else 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (value.asKnown().isPresent) 1 else 0)
+
+ /** Tag the transaction with key-value metadata */
+ class Type @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 TAG = of("TAG")
+
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
+
+ /** An enum containing [Type]'s known values. */
+ enum class Known {
+ TAG
+ }
+
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] 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 {
+ TAG,
+ /** An enum member indicating that [Type] 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) {
+ TAG -> Value.TAG
+ 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 LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ TAG -> Known.TAG
+ else -> throw LithicInvalidDataException("Unknown Type: $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 LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ LithicInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Type = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ 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 Type && 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 TagAction &&
+ key == other.key &&
+ type == other.type &&
+ value == other.value &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(key, type, value, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "TagAction{key=$key, type=$type, value=$value, additionalProperties=$additionalProperties}"
+ }
+
+ class CreateCaseAction
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val queueToken: JsonField,
+ private val scope: JsonField,
+ private val type: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("queue_token")
+ @ExcludeMissing
+ queueToken: JsonField = JsonMissing.of(),
+ @JsonProperty("scope") @ExcludeMissing scope: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ ) : this(queueToken, scope, type, mutableMapOf())
+
+ /**
+ * The token of the queue to create the case in
+ *
+ * @throws LithicInvalidDataException 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 queueToken(): String = queueToken.getRequired("queue_token")
+
+ /**
+ * The scope of the case to create
+ *
+ * @throws LithicInvalidDataException 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 scope(): Scope = scope.getRequired("scope")
+
+ /**
+ * Create a case for the transaction
+ *
+ * @throws LithicInvalidDataException 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 type(): Type = type.getRequired("type")
+
+ /**
+ * Returns the raw JSON value of [queueToken].
+ *
+ * Unlike [queueToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("queue_token")
+ @ExcludeMissing
+ fun _queueToken(): JsonField = queueToken
+
+ /**
+ * Returns the raw JSON value of [scope].
+ *
+ * Unlike [scope], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("scope") @ExcludeMissing fun _scope(): JsonField = scope
+
+ /**
+ * Returns the raw JSON value of [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ @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 [CreateCaseAction].
+ *
+ * The following fields are required:
+ * ```java
+ * .queueToken()
+ * .scope()
+ * .type()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CreateCaseAction]. */
+ class Builder internal constructor() {
+
+ private var queueToken: JsonField? = null
+ private var scope: JsonField? = null
+ private var type: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(createCaseAction: CreateCaseAction) = apply {
+ queueToken = createCaseAction.queueToken
+ scope = createCaseAction.scope
+ type = createCaseAction.type
+ additionalProperties = createCaseAction.additionalProperties.toMutableMap()
+ }
+
+ /** The token of the queue to create the case in */
+ fun queueToken(queueToken: String) = queueToken(JsonField.of(queueToken))
+
+ /**
+ * Sets [Builder.queueToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.queueToken] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun queueToken(queueToken: JsonField) = apply { this.queueToken = queueToken }
+
+ /** The scope of the case to create */
+ fun scope(scope: Scope) = scope(JsonField.of(scope))
+
+ /**
+ * Sets [Builder.scope] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.scope] with a well-typed [Scope] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun scope(scope: JsonField) = apply { this.scope = scope }
+
+ /** Create a case for the transaction */
+ fun type(type: Type) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [Type] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ 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 [CreateCaseAction].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .queueToken()
+ * .scope()
+ * .type()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CreateCaseAction =
+ CreateCaseAction(
+ checkRequired("queueToken", queueToken),
+ checkRequired("scope", scope),
+ checkRequired("type", type),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): CreateCaseAction = apply {
+ if (validated) {
+ return@apply
+ }
+
+ queueToken()
+ scope().validate()
+ type().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ 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 (queueToken.asKnown().isPresent) 1 else 0) +
+ (scope.asKnown().getOrNull()?.validity() ?: 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** The scope of the case to create */
+ class Scope @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 CARD = of("CARD")
+
+ @JvmField val ACCOUNT = of("ACCOUNT")
+
+ @JvmStatic fun of(value: String) = Scope(JsonField.of(value))
+ }
+
+ /** An enum containing [Scope]'s known values. */
+ enum class Known {
+ CARD,
+ ACCOUNT,
+ }
+
+ /**
+ * An enum containing [Scope]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Scope] 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 {
+ CARD,
+ ACCOUNT,
+ /**
+ * An enum member indicating that [Scope] 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) {
+ CARD -> Value.CARD
+ ACCOUNT -> Value.ACCOUNT
+ 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 LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CARD -> Known.CARD
+ ACCOUNT -> Known.ACCOUNT
+ else -> throw LithicInvalidDataException("Unknown Scope: $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 LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ LithicInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Scope = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ 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 Scope && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** Create a case for the transaction */
+ class Type @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 CREATE_CASE = of("CREATE_CASE")
+
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
+
+ /** An enum containing [Type]'s known values. */
+ enum class Known {
+ CREATE_CASE
+ }
+
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] 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 {
+ CREATE_CASE,
+ /** An enum member indicating that [Type] 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) {
+ CREATE_CASE -> Value.CREATE_CASE
+ 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 LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CREATE_CASE -> Known.CREATE_CASE
+ else -> throw LithicInvalidDataException("Unknown Type: $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 LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ LithicInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Type = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ 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 Type && 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 CreateCaseAction &&
+ queueToken == other.queueToken &&
+ scope == other.scope &&
+ type == other.type &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(queueToken, scope, type, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "CreateCaseAction{queueToken=$queueToken, scope=$scope, type=$type, additionalProperties=$additionalProperties}"
+ }
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt
index 9264643cc..41f17e73b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt
@@ -1453,6 +1453,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardTransactionUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -1619,6 +1627,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt
index 711420e84..de774c839 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdateParams.kt
@@ -1161,6 +1161,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -1334,6 +1343,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): PinStatus = apply {
if (validated) {
return@apply
@@ -1471,6 +1489,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): State = apply {
if (validated) {
return@apply
@@ -1675,6 +1702,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Substatus = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt
index ee5b33230..ef075984f 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt
@@ -228,6 +228,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardUpdatedWebhookEvent = apply {
if (validated) {
return@apply
@@ -342,6 +350,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): EventType = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt
index a3f1273f7..3ba3fa88b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt
@@ -616,6 +616,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Body = apply {
if (validated) {
return@apply
@@ -770,6 +779,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DigitalWallet = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt
index 28fece954..234b57250 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt
@@ -55,6 +55,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = cardWebProvisionResponse.accept(new CardWebProvisionResponse.Visitor>() {
+ * @Override
+ * public Optional visitAppleWebPushProvisioning(AppleWebPushProvisioningResponse appleWebPushProvisioning) {
+ * return Optional.of(appleWebPushProvisioning.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
fun accept(visitor: Visitor): T =
when {
appleWebPushProvisioning != null ->
@@ -66,6 +95,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardWebProvisionResponse = apply {
if (validated) {
return@apply
@@ -395,6 +432,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AppleWebPushProvisioningResponse = apply {
if (validated) {
return@apply
@@ -658,6 +704,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): WebPushProvisioningResponseJws = apply {
if (validated) {
return@apply
@@ -805,6 +861,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
fun validate(): WebPushProvisioningResponseHeader = apply {
if (validated) {
return@apply
@@ -1040,6 +1106,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): GoogleWebPushProvisioningResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt
index a36a944e3..ab137282c 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardholderAuthentication.kt
@@ -349,6 +349,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CardholderAuthentication = apply {
if (validated) {
return@apply
@@ -483,6 +491,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthenticationMethod = apply {
if (validated) {
return@apply
@@ -627,6 +644,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): AuthenticationResult = apply {
if (validated) {
return@apply
@@ -781,6 +807,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): DecisionMadeBy = apply {
if (validated) {
return@apply
@@ -926,6 +961,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): LiabilityShift = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt
index 7fb386853..89ad9ef86 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Carrier.kt
@@ -117,6 +117,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Carrier = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt
index 906e45055..6ba66a214 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt
@@ -187,6 +187,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CategoryBalances = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt
index 2f5118ce9..e84942d18 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryDetails.kt
@@ -204,6 +204,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CategoryDetails = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt
index 47e372e3e..f865113c9 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryTier.kt
@@ -143,6 +143,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): CategoryTier = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt
index 4d7334d7f..e3d4f0a3d 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResponse.kt
@@ -178,6 +178,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ChallengeResponse = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt
index 58a7296b6..e28a4adcb 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ChallengeResult.kt
@@ -96,6 +96,14 @@ class ChallengeResult @JsonCreator private constructor(private val value: JsonFi
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ChallengeResult = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt
index df68c5f73..95bb0e4bd 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt
@@ -191,6 +191,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Conditional3dsActionParameters = apply {
if (validated) {
return@apply
@@ -314,6 +322,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Authentication3dsAction = apply {
if (validated) {
return@apply
@@ -605,6 +622,15 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Condition = apply {
if (validated) {
return@apply
@@ -794,6 +820,16 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): Attribute = apply {
if (validated) {
return@apply
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt
index e0ae0a4ad..1f29b9ce8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAchActionParameters.kt
@@ -205,6 +205,14 @@ private constructor(
private var validated: Boolean = false
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
fun validate(): ConditionalAchActionParameters = apply {
if (validated) {
return@apply
@@ -257,6 +265,35 @@ private constructor(
fun _json(): Optional = Optional.ofNullable(_json)
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of
+ * the SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.lithic.api.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = action.accept(new Action.Visitor>() {
+ * @Override
+ * public Optional visitApproveActionAch(ApproveActionAch approveActionAch) {
+ * return Optional.of(approveActionAch.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws LithicInvalidDataException if [Visitor.unknown] is not overridden in [visitor]
+ * and the current variant is unknown.
+ */
fun accept(visitor: Visitor