diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 988e843f..b6700282 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.116.0"
+ ".": "0.117.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 0080147f..5a93d129 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 176
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ce2adff9b644ed4562b5342a4a43d0b40c98d43b4e063b4626f4ca5d342f1b92.yml
-openapi_spec_hash: fbc84b866ce96457261ac58b4e75c71d
-config_hash: 31d71922d7838f34ae0875c9b8026d99
+configured_endpoints: 177
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c24eebe942f400bff8922a6fbef1ce551ad14f61eb4da21b50d823a62ca42586.yml
+openapi_spec_hash: b79ed927e625dedff69cea29131a34d9
+config_hash: 693dddc4721eef512d75ab6c60897794
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fb6fe40f..3bc58031 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,45 @@
# Changelog
+## 0.117.0 (2026-02-18)
+
+Full Changelog: [v0.116.0...v0.117.0](https://github.com/lithic-com/lithic-java/compare/v0.116.0...v0.117.0)
+
+### Features
+
+* **api:** Add /v2/auth_rules/results endpoint for listing rule evaluation data ([6064b3a](https://github.com/lithic-com/lithic-java/commit/6064b3a6c4481eeee5dd71091b9a8362134277f6))
+* **api:** Add amounts object to ASA request ([b7d7006](https://github.com/lithic-com/lithic-java/commit/b7d700661fd0c506e43229c04fd12d81cef3505c))
+* **api:** Add hold token field to book transfers ([7796bac](https://github.com/lithic-com/lithic-java/commit/7796bac615b7324cd9c50bc1c1b35c181d4ffce9))
+* **api:** Add naics_code to account holder requests/responses ([c9ff6da](https://github.com/lithic-com/lithic-java/commit/c9ff6daa033e4022ac9208f4ff81d18346f53695))
+* **api:** Add network specific wallet recommendation reasons ([56b15ff](https://github.com/lithic-com/lithic-java/commit/56b15ffec613c66071c67444273dc8ffd569bce5))
+* **api:** Add PENDING_REVIEW status to KYB enrollment simulation ([a0a4acc](https://github.com/lithic-com/lithic-java/commit/a0a4acc37ebbd6a40fc6769855f87e4b2e20ce30))
+* **api:** Add result schemas for Authorization and Authentication (3DS) actions ([61d743a](https://github.com/lithic-com/lithic-java/commit/61d743af0994d360aab6b9700c620809e0372bf3))
+* **api:** add webhook signature verification ([4e26f35](https://github.com/lithic-com/lithic-java/commit/4e26f350ebf038f7fa0562a484a6fea5a2d85de4))
+* **client:** add connection pooling option ([2b5bf16](https://github.com/lithic-com/lithic-java/commit/2b5bf16839b77bd880a73a2c4211176accc27864))
+* **client:** add more convenience service method overloads ([41826de](https://github.com/lithic-com/lithic-java/commit/41826de4dac92b85774ea9dcdb754a1bb58ada93))
+
+
+### Bug Fixes
+
+* add missing fields ([b075f58](https://github.com/lithic-com/lithic-java/commit/b075f58683c40bd097d18490992744526f74161a))
+* **api:** Update /v2/auth_rules/results endpoint parameter naming and action types ([74dcc48](https://github.com/lithic-com/lithic-java/commit/74dcc48075f54e964f4c8179a6121c53e6a28283))
+* **client:** mark request body as required ([bce1e00](https://github.com/lithic-com/lithic-java/commit/bce1e00834c884f5b930821c7a7949fad1f38f56))
+
+
+### Chores
+
+* configure new SDK language ([2ddf823](https://github.com/lithic-com/lithic-java/commit/2ddf82360b21d85b57231fafc022f10ef909df40))
+* Enable stainless MCP in config ([2f605c1](https://github.com/lithic-com/lithic-java/commit/2f605c19967c7c77dec0358e1ccbacbadf9fc632))
+* **internal:** allow passing args to `./scripts/test` ([b327fb6](https://github.com/lithic-com/lithic-java/commit/b327fb6b7736803c3fd6a0806fe528aeeb96f428))
+* **internal:** make `OkHttp` constructor internal ([92d0d62](https://github.com/lithic-com/lithic-java/commit/92d0d62f76d7eac438e901813dbce1fcf32c22fc))
+* **internal:** remove unnecessary base URL ([2146e4b](https://github.com/lithic-com/lithic-java/commit/2146e4bb9d84df595bcc204ca589f6a0e861dff8))
+* **internal:** update `TestServerExtension` comment ([1d44ad9](https://github.com/lithic-com/lithic-java/commit/1d44ad909ecfd24ab000cfcd3db3874bcf18e97e))
+* **internal:** upgrade AssertJ ([71b1a8b](https://github.com/lithic-com/lithic-java/commit/71b1a8bb689d8740ddf53c0b85745d240ea83981))
+
+
+### Documentation
+
+* Fix documentation of tokenization channel and tokenization source for tokenization rules ([c863228](https://github.com/lithic-com/lithic-java/commit/c8632283a23548a67d038da60a064d70ef03d017))
+
## 0.116.0 (2026-01-27)
Full Changelog: [v0.115.0...v0.116.0](https://github.com/lithic-com/lithic-java/compare/v0.115.0...v0.116.0)
diff --git a/README.md b/README.md
index 7829b853..5b40c425 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.116.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.116.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.117.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.117.0)
@@ -11,9 +11,18 @@ The Lithic Java SDK provides convenient access to the [Lithic REST API](https://
The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.
+## MCP Server
+
+Use the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
+
+[](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)
+[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)
+
+> Note: You may need to set environment variables in your MCP client.
+
-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.116.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.117.0).
@@ -24,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.116.0")
+implementation("com.lithic.api:lithic-java:0.117.0")
```
### Maven
@@ -33,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.116.0")
com.lithic.api
lithic-java
- 0.116.0
+ 0.117.0
```
@@ -491,6 +500,25 @@ LithicClient client = LithicOkHttpClient.builder()
.build();
```
+### Connection pooling
+
+To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
+
+```java
+import com.lithic.api.client.LithicClient;
+import com.lithic.api.client.okhttp.LithicOkHttpClient;
+import java.time.Duration;
+
+LithicClient client = LithicOkHttpClient.builder()
+ .fromEnv()
+ // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.
+ .maxIdleConnections(10)
+ .keepAliveDuration(Duration.ofMinutes(2))
+ .build();
+```
+
+If both options are unset, OkHttp's default connection pool settings are used.
+
### HTTPS
> [!NOTE]
diff --git a/build.gradle.kts b/build.gradle.kts
index 72a101ec..3371f3d6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.116.0" // x-release-please-version
+ version = "0.117.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-client-okhttp/build.gradle.kts b/lithic-java-client-okhttp/build.gradle.kts
index 0d61bae3..1227e287 100644
--- a/lithic-java-client-okhttp/build.gradle.kts
+++ b/lithic-java-client-okhttp/build.gradle.kts
@@ -10,6 +10,6 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
testImplementation(kotlin("test"))
- testImplementation("org.assertj:assertj-core:3.25.3")
+ testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
}
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 ac00e64a..824255b1 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
@@ -49,6 +49,8 @@ class LithicOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -77,6 +79,46 @@ class LithicOkHttpClient private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * The maximum number of idle connections kept by the underlying OkHttp connection pool.
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Alias for [Builder.maxIdleConnections].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int) =
+ maxIdleConnections(maxIdleConnections as Int?)
+
+ /**
+ * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
+ */
+ fun maxIdleConnections(maxIdleConnections: Optional) =
+ maxIdleConnections(maxIdleConnections.getOrNull())
+
+ /**
+ * The keep-alive duration for idle connections in the underlying OkHttp connection pool.
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
+ /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
+ fun keepAliveDuration(keepAliveDuration: Optional) =
+ keepAliveDuration(keepAliveDuration.getOrNull())
+
/**
* The socket factory used to secure HTTPS connections.
*
@@ -344,6 +386,8 @@ class LithicOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .maxIdleConnections(maxIdleConnections)
+ .keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
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 aebe796e..9224b380 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
@@ -49,6 +49,8 @@ class LithicOkHttpClientAsync private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -77,6 +79,46 @@ class LithicOkHttpClientAsync private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * The maximum number of idle connections kept by the underlying OkHttp connection pool.
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Alias for [Builder.maxIdleConnections].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int) =
+ maxIdleConnections(maxIdleConnections as Int?)
+
+ /**
+ * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
+ */
+ fun maxIdleConnections(maxIdleConnections: Optional) =
+ maxIdleConnections(maxIdleConnections.getOrNull())
+
+ /**
+ * The keep-alive duration for idle connections in the underlying OkHttp connection pool.
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
+ /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
+ fun keepAliveDuration(keepAliveDuration: Optional) =
+ keepAliveDuration(keepAliveDuration.getOrNull())
+
/**
* The socket factory used to secure HTTPS connections.
*
@@ -344,6 +386,8 @@ class LithicOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .maxIdleConnections(maxIdleConnections)
+ .keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
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 02e25515..5c5c1167 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
@@ -16,11 +16,13 @@ import java.time.Duration
import java.util.concurrent.CancellationException
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutorService
+import java.util.concurrent.TimeUnit
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import okhttp3.Call
import okhttp3.Callback
+import okhttp3.ConnectionPool
import okhttp3.Dispatcher
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
@@ -33,7 +35,7 @@ import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
class OkHttpClient
-private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
+internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
val call = newCall(request, requestOptions)
@@ -200,6 +202,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var dispatcherExecutorService: ExecutorService? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
@@ -211,6 +215,28 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
+ /**
+ * Sets the maximum number of idle connections kept by the underlying [ConnectionPool].
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Sets the keep-alive duration for idle connections in the underlying [ConnectionPool].
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}
@@ -240,6 +266,22 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
.apply {
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }
+ val maxIdleConnections = maxIdleConnections
+ val keepAliveDuration = keepAliveDuration
+ if (maxIdleConnections != null && keepAliveDuration != null) {
+ connectionPool(
+ ConnectionPool(
+ maxIdleConnections,
+ keepAliveDuration.toNanos(),
+ TimeUnit.NANOSECONDS,
+ )
+ )
+ } else {
+ check((maxIdleConnections != null) == (keepAliveDuration != null)) {
+ "Both or none of `maxIdleConnections` and `keepAliveDuration` must be set, but only one was set"
+ }
+ }
+
val sslSocketFactory = sslSocketFactory
val trustManager = trustManager
if (sslSocketFactory != null && trustManager != null) {
diff --git a/lithic-java-core/build.gradle.kts b/lithic-java-core/build.gradle.kts
index 151c17eb..dc2ea195 100644
--- a/lithic-java-core/build.gradle.kts
+++ b/lithic-java-core/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {
api("com.fasterxml.jackson.core:jackson-core:2.18.2")
api("com.fasterxml.jackson.core:jackson-databind:2.18.2")
api("com.google.errorprone:error_prone_annotations:2.33.0")
+ api("com.standardwebhooks:standardwebhooks:1.1.0")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.18.2")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2")
@@ -33,7 +34,7 @@ dependencies {
testImplementation(kotlin("test"))
testImplementation(project(":lithic-java-client-okhttp"))
testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
- testImplementation("org.assertj:assertj-core:3.25.3")
+ testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
testImplementation("org.junit-pioneer:junit-pioneer:1.9.1")
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/UnwrapWebhookParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/UnwrapWebhookParams.kt
new file mode 100644
index 00000000..8c748395
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/UnwrapWebhookParams.kt
@@ -0,0 +1,102 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.core
+
+import com.lithic.api.core.http.Headers
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class UnwrapWebhookParams
+private constructor(
+ private val body: String,
+ private val headers: Headers?,
+ private val secret: String?,
+) {
+
+ /** The raw JSON body of the webhook request. */
+ fun body(): String = body
+
+ /** The headers from the webhook request. */
+ fun headers(): Optional = Optional.ofNullable(headers)
+
+ /** The secret used to verify the webhook signature. */
+ fun secret(): Optional = Optional.ofNullable(secret)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [UnwrapWebhookParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .body()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [UnwrapWebhookParams]. */
+ class Builder internal constructor() {
+
+ private var body: String? = null
+ private var headers: Headers? = null
+ private var secret: String? = null
+
+ @JvmSynthetic
+ internal fun from(unwrapWebhookParams: UnwrapWebhookParams) = apply {
+ body = unwrapWebhookParams.body
+ headers = unwrapWebhookParams.headers
+ secret = unwrapWebhookParams.secret
+ }
+
+ /** The raw JSON body of the webhook request. */
+ fun body(body: String) = apply { this.body = body }
+
+ /** The headers from the webhook request. */
+ fun headers(headers: Headers?) = apply { this.headers = headers }
+
+ /** Alias for calling [Builder.headers] with `headers.orElse(null)`. */
+ fun headers(headers: Optional) = headers(headers.getOrNull())
+
+ /** The secret used to verify the webhook signature. */
+ fun secret(secret: String?) = apply { this.secret = secret }
+
+ /** Alias for calling [Builder.secret] with `secret.orElse(null)`. */
+ fun secret(secret: Optional) = secret(secret.getOrNull())
+
+ /**
+ * Returns an immutable instance of [UnwrapWebhookParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .body()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): UnwrapWebhookParams =
+ UnwrapWebhookParams(checkRequired("body", body), headers, secret)
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is UnwrapWebhookParams &&
+ body == other.body &&
+ headers == other.headers &&
+ secret == other.secret
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(body, headers, secret) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "UnwrapWebhookParams{body=$body, headers=$headers, secret=$secret}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicWebhookException.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicWebhookException.kt
new file mode 100644
index 00000000..c00f08f9
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicWebhookException.kt
@@ -0,0 +1,5 @@
+package com.lithic.api.errors
+
+class LithicWebhookException
+@JvmOverloads
+constructor(message: String? = null, cause: Throwable? = null) : LithicException(message, cause)
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 94557f28..0bf76e54 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
@@ -36,6 +36,7 @@ private constructor(
private val exemptionType: JsonField,
private val externalId: JsonField,
private val individual: JsonField,
+ private val naicsCode: JsonField,
private val natureOfBusiness: JsonField,
private val phoneNumber: JsonField,
private val requiredDocuments: JsonField>,
@@ -82,6 +83,7 @@ private constructor(
@JsonProperty("individual")
@ExcludeMissing
individual: JsonField = JsonMissing.of(),
+ @JsonProperty("naics_code") @ExcludeMissing naicsCode: JsonField = JsonMissing.of(),
@JsonProperty("nature_of_business")
@ExcludeMissing
natureOfBusiness: JsonField = JsonMissing.of(),
@@ -115,6 +117,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
requiredDocuments,
@@ -245,6 +248,15 @@ private constructor(
fun individual(): Optional =
individual.getOptional("individual")
+ /**
+ * Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
+ * System (NAICS) code for the business.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun naicsCode(): Optional = naicsCode.getOptional("naics_code")
+
/**
* Only present when user_type == "BUSINESS". User-submitted description of the business.
*
@@ -299,8 +311,8 @@ private constructor(
/**
* The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be
* present. If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will be
- * present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -430,6 +442,13 @@ private constructor(
@ExcludeMissing
fun _individual(): JsonField = individual
+ /**
+ * Returns the raw JSON value of [naicsCode].
+ *
+ * Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("naics_code") @ExcludeMissing fun _naicsCode(): JsonField = naicsCode
+
/**
* Returns the raw JSON value of [natureOfBusiness].
*
@@ -545,6 +564,7 @@ private constructor(
private var exemptionType: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
private var individual: JsonField = JsonMissing.of()
+ private var naicsCode: JsonField = JsonMissing.of()
private var natureOfBusiness: JsonField = JsonMissing.of()
private var phoneNumber: JsonField = JsonMissing.of()
private var requiredDocuments: JsonField>? = null
@@ -572,6 +592,7 @@ private constructor(
exemptionType = accountHolder.exemptionType
externalId = accountHolder.externalId
individual = accountHolder.individual
+ naicsCode = accountHolder.naicsCode
natureOfBusiness = accountHolder.natureOfBusiness
phoneNumber = accountHolder.phoneNumber
requiredDocuments = accountHolder.requiredDocuments.map { it.toMutableList() }
@@ -811,6 +832,21 @@ private constructor(
this.individual = individual
}
+ /**
+ * Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
+ * System (NAICS) code for the business.
+ */
+ fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
+
+ /**
+ * Sets [Builder.naicsCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.naicsCode] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun naicsCode(naicsCode: JsonField) = apply { this.naicsCode = naicsCode }
+
/**
* Only present when user_type == "BUSINESS". User-submitted description of the business.
*/
@@ -926,8 +962,8 @@ private constructor(
/**
* The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will
* be present. If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will
- * be present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*/
fun userType(userType: UserType) = userType(JsonField.of(userType))
@@ -1013,6 +1049,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
(requiredDocuments ?: JsonMissing.of()).map { it.toImmutable() },
@@ -1044,6 +1081,7 @@ private constructor(
exemptionType().ifPresent { it.validate() }
externalId()
individual().ifPresent { it.validate() }
+ naicsCode()
natureOfBusiness()
phoneNumber()
requiredDocuments().ifPresent { it.forEach { it.validate() } }
@@ -1083,6 +1121,7 @@ private constructor(
(exemptionType.asKnown().getOrNull()?.validity() ?: 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
(individual.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (naicsCode.asKnown().isPresent) 1 else 0) +
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
(if (phoneNumber.asKnown().isPresent) 1 else 0) +
(requiredDocuments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -2447,8 +2486,8 @@ private constructor(
/**
* The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be
* present. If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will be
- * present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*/
class UserType @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -3226,6 +3265,7 @@ private constructor(
exemptionType == other.exemptionType &&
externalId == other.externalId &&
individual == other.individual &&
+ naicsCode == other.naicsCode &&
natureOfBusiness == other.natureOfBusiness &&
phoneNumber == other.phoneNumber &&
requiredDocuments == other.requiredDocuments &&
@@ -3251,6 +3291,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
requiredDocuments,
@@ -3266,5 +3307,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "AccountHolder{token=$token, created=$created, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
+ "AccountHolder{token=$token, created=$created, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
}
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 d31c3821..6240d0c4 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
@@ -453,6 +453,7 @@ private constructor(
private val beneficialOwnerIndividuals: JsonField>,
private val controlPerson: JsonField,
private val externalId: JsonField,
+ private val naicsCode: JsonField,
private val natureOfBusiness: JsonField,
private val tosTimestamp: JsonField,
private val websiteUrl: JsonField,
@@ -474,6 +475,9 @@ private constructor(
@JsonProperty("external_id")
@ExcludeMissing
externalId: JsonField = JsonMissing.of(),
+ @JsonProperty("naics_code")
+ @ExcludeMissing
+ naicsCode: JsonField = JsonMissing.of(),
@JsonProperty("nature_of_business")
@ExcludeMissing
natureOfBusiness: JsonField = JsonMissing.of(),
@@ -491,6 +495,7 @@ private constructor(
beneficialOwnerIndividuals,
controlPerson,
externalId,
+ naicsCode,
natureOfBusiness,
tosTimestamp,
websiteUrl,
@@ -546,6 +551,14 @@ private constructor(
*/
fun externalId(): Optional = externalId.getOptional("external_id")
+ /**
+ * 6-digit North American Industry Classification System (NAICS) code for the business.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun naicsCode(): Optional = naicsCode.getOptional("naics_code")
+
/**
* Short description of the company's line of business (i.e., what does the company
* do?).
@@ -623,6 +636,16 @@ private constructor(
@ExcludeMissing
fun _externalId(): JsonField = externalId
+ /**
+ * Returns the raw JSON value of [naicsCode].
+ *
+ * Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("naics_code")
+ @ExcludeMissing
+ fun _naicsCode(): JsonField = naicsCode
+
/**
* Returns the raw JSON value of [natureOfBusiness].
*
@@ -696,6 +719,7 @@ private constructor(
null
private var controlPerson: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
+ private var naicsCode: JsonField = JsonMissing.of()
private var natureOfBusiness: JsonField = JsonMissing.of()
private var tosTimestamp: JsonField = JsonMissing.of()
private var websiteUrl: JsonField = JsonMissing.of()
@@ -709,6 +733,7 @@ private constructor(
kybDelegated.beneficialOwnerIndividuals.map { it.toMutableList() }
controlPerson = kybDelegated.controlPerson
externalId = kybDelegated.externalId
+ naicsCode = kybDelegated.naicsCode
natureOfBusiness = kybDelegated.natureOfBusiness
tosTimestamp = kybDelegated.tosTimestamp
websiteUrl = kybDelegated.websiteUrl
@@ -810,6 +835,21 @@ private constructor(
this.externalId = externalId
}
+ /**
+ * 6-digit North American Industry Classification System (NAICS) code for the
+ * business.
+ */
+ fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
+
+ /**
+ * Sets [Builder.naicsCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.naicsCode] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun naicsCode(naicsCode: JsonField) = apply { this.naicsCode = naicsCode }
+
/**
* Short description of the company's line of business (i.e., what does the company
* do?).
@@ -912,6 +952,7 @@ private constructor(
(beneficialOwnerIndividuals ?: JsonMissing.of()).map { it.toImmutable() },
controlPerson,
externalId,
+ naicsCode,
natureOfBusiness,
tosTimestamp,
websiteUrl,
@@ -931,6 +972,7 @@ private constructor(
beneficialOwnerIndividuals().ifPresent { it.forEach { it.validate() } }
controlPerson().ifPresent { it.validate() }
externalId()
+ naicsCode()
natureOfBusiness()
tosTimestamp()
websiteUrl()
@@ -960,6 +1002,7 @@ private constructor(
} ?: 0) +
(controlPerson.asKnown().getOrNull()?.validity() ?: 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
+ (if (naicsCode.asKnown().isPresent) 1 else 0) +
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
(if (tosTimestamp.asKnown().isPresent) 1 else 0) +
(if (websiteUrl.asKnown().isPresent) 1 else 0) +
@@ -2014,6 +2057,7 @@ private constructor(
beneficialOwnerIndividuals == other.beneficialOwnerIndividuals &&
controlPerson == other.controlPerson &&
externalId == other.externalId &&
+ naicsCode == other.naicsCode &&
natureOfBusiness == other.natureOfBusiness &&
tosTimestamp == other.tosTimestamp &&
websiteUrl == other.websiteUrl &&
@@ -2027,6 +2071,7 @@ private constructor(
beneficialOwnerIndividuals,
controlPerson,
externalId,
+ naicsCode,
natureOfBusiness,
tosTimestamp,
websiteUrl,
@@ -2038,7 +2083,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "KybDelegated{businessEntity=$businessEntity, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, externalId=$externalId, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}"
+ "KybDelegated{businessEntity=$businessEntity, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, externalId=$externalId, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}"
}
}
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 3320660d..94680149 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
@@ -600,6 +600,8 @@ private constructor(
@JvmField val REJECTED = of("REJECTED")
+ @JvmField val PENDING_REVIEW = of("PENDING_REVIEW")
+
@JvmStatic fun of(value: String) = Status(JsonField.of(value))
}
@@ -607,6 +609,7 @@ private constructor(
enum class Known {
ACCEPTED,
REJECTED,
+ PENDING_REVIEW,
}
/**
@@ -621,6 +624,7 @@ private constructor(
enum class Value {
ACCEPTED,
REJECTED,
+ PENDING_REVIEW,
/** An enum member indicating that [Status] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -636,6 +640,7 @@ private constructor(
when (this) {
ACCEPTED -> Value.ACCEPTED
REJECTED -> Value.REJECTED
+ PENDING_REVIEW -> Value.PENDING_REVIEW
else -> Value._UNKNOWN
}
@@ -652,6 +657,7 @@ private constructor(
when (this) {
ACCEPTED -> Known.ACCEPTED
REJECTED -> Known.REJECTED
+ PENDING_REVIEW -> Known.PENDING_REVIEW
else -> throw LithicInvalidDataException("Unknown Status: $value")
}
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 2a9e0c44..9ec3b45e 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
@@ -36,6 +36,7 @@ private constructor(
private val exemptionType: JsonField,
private val externalId: JsonField,
private val individual: JsonField,
+ private val naicsCode: JsonField,
private val natureOfBusiness: JsonField,
private val phoneNumber: JsonField,
private val requiredDocuments: JsonField>,
@@ -81,6 +82,7 @@ private constructor(
@JsonProperty("individual")
@ExcludeMissing
individual: JsonField = JsonMissing.of(),
+ @JsonProperty("naics_code") @ExcludeMissing naicsCode: JsonField = JsonMissing.of(),
@JsonProperty("nature_of_business")
@ExcludeMissing
natureOfBusiness: JsonField = JsonMissing.of(),
@@ -114,6 +116,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
requiredDocuments,
@@ -246,6 +249,15 @@ private constructor(
*/
fun individual(): Optional = individual.getOptional("individual")
+ /**
+ * Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
+ * System (NAICS) code for the business.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun naicsCode(): Optional = naicsCode.getOptional("naics_code")
+
/**
* Only present when user_type == "BUSINESS". User-submitted description of the business.
*
@@ -298,8 +310,8 @@ private constructor(
* present.
*
* If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will be
- * present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -426,6 +438,13 @@ private constructor(
@ExcludeMissing
fun _individual(): JsonField = individual
+ /**
+ * Returns the raw JSON value of [naicsCode].
+ *
+ * Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("naics_code") @ExcludeMissing fun _naicsCode(): JsonField = naicsCode
+
/**
* Returns the raw JSON value of [natureOfBusiness].
*
@@ -531,6 +550,7 @@ private constructor(
private var exemptionType: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
private var individual: JsonField = JsonMissing.of()
+ private var naicsCode: JsonField = JsonMissing.of()
private var natureOfBusiness: JsonField = JsonMissing.of()
private var phoneNumber: JsonField = JsonMissing.of()
private var requiredDocuments: JsonField>? = null
@@ -565,6 +585,7 @@ private constructor(
exemptionType = accountHolderSimulateEnrollmentReviewResponse.exemptionType
externalId = accountHolderSimulateEnrollmentReviewResponse.externalId
individual = accountHolderSimulateEnrollmentReviewResponse.individual
+ naicsCode = accountHolderSimulateEnrollmentReviewResponse.naicsCode
natureOfBusiness = accountHolderSimulateEnrollmentReviewResponse.natureOfBusiness
phoneNumber = accountHolderSimulateEnrollmentReviewResponse.phoneNumber
requiredDocuments =
@@ -815,6 +836,21 @@ private constructor(
*/
fun individual(individual: JsonField) = apply { this.individual = individual }
+ /**
+ * Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
+ * System (NAICS) code for the business.
+ */
+ fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
+
+ /**
+ * Sets [Builder.naicsCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.naicsCode] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun naicsCode(naicsCode: JsonField) = apply { this.naicsCode = naicsCode }
+
/**
* Only present when user_type == "BUSINESS". User-submitted description of the business.
*/
@@ -929,8 +965,8 @@ private constructor(
* be present.
*
* If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will
- * be present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*/
fun userType(userType: UserType) = userType(JsonField.of(userType))
@@ -1009,6 +1045,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
(requiredDocuments ?: JsonMissing.of()).map { it.toImmutable() },
@@ -1040,6 +1077,7 @@ private constructor(
exemptionType().ifPresent { it.validate() }
externalId()
individual().ifPresent { it.validate() }
+ naicsCode()
natureOfBusiness()
phoneNumber()
requiredDocuments().ifPresent { it.forEach { it.validate() } }
@@ -1079,6 +1117,7 @@ private constructor(
(exemptionType.asKnown().getOrNull()?.validity() ?: 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
(individual.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (naicsCode.asKnown().isPresent) 1 else 0) +
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
(if (phoneNumber.asKnown().isPresent) 1 else 0) +
(requiredDocuments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -2483,8 +2522,8 @@ private constructor(
* present.
*
* If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will be
- * present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*/
class UserType @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -3444,6 +3483,7 @@ private constructor(
exemptionType == other.exemptionType &&
externalId == other.externalId &&
individual == other.individual &&
+ naicsCode == other.naicsCode &&
natureOfBusiness == other.natureOfBusiness &&
phoneNumber == other.phoneNumber &&
requiredDocuments == other.requiredDocuments &&
@@ -3469,6 +3509,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
requiredDocuments,
@@ -3484,5 +3525,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "AccountHolderSimulateEnrollmentReviewResponse{token=$token, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, created=$created, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
+ "AccountHolderSimulateEnrollmentReviewResponse{token=$token, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, created=$created, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
}
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 35fd00bc..54a08bcc 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
@@ -473,6 +473,7 @@ private constructor(
private val businessEntity: JsonField,
private val controlPerson: JsonField,
private val externalId: JsonField,
+ private val naicsCode: JsonField,
private val natureOfBusiness: JsonField,
private val websiteUrl: JsonField,
private val additionalProperties: MutableMap,
@@ -495,6 +496,9 @@ private constructor(
@JsonProperty("external_id")
@ExcludeMissing
externalId: JsonField = JsonMissing.of(),
+ @JsonProperty("naics_code")
+ @ExcludeMissing
+ naicsCode: JsonField = JsonMissing.of(),
@JsonProperty("nature_of_business")
@ExcludeMissing
natureOfBusiness: JsonField = JsonMissing.of(),
@@ -507,6 +511,7 @@ private constructor(
businessEntity,
controlPerson,
externalId,
+ naicsCode,
natureOfBusiness,
websiteUrl,
mutableMapOf(),
@@ -569,6 +574,14 @@ private constructor(
*/
fun externalId(): Optional = externalId.getOptional("external_id")
+ /**
+ * 6-digit North American Industry Classification System (NAICS) code for the business.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun naicsCode(): Optional = naicsCode.getOptional("naics_code")
+
/**
* Short description of the company's line of business (i.e., what does the company
* do?).
@@ -640,6 +653,16 @@ private constructor(
@ExcludeMissing
fun _externalId(): JsonField = externalId
+ /**
+ * Returns the raw JSON value of [naicsCode].
+ *
+ * Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("naics_code")
+ @ExcludeMissing
+ fun _naicsCode(): JsonField = naicsCode
+
/**
* Returns the raw JSON value of [natureOfBusiness].
*
@@ -689,6 +712,7 @@ private constructor(
private var businessEntity: JsonField = JsonMissing.of()
private var controlPerson: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
+ private var naicsCode: JsonField = JsonMissing.of()
private var natureOfBusiness: JsonField = JsonMissing.of()
private var websiteUrl: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -702,6 +726,7 @@ private constructor(
businessEntity = kybPatchRequest.businessEntity
controlPerson = kybPatchRequest.controlPerson
externalId = kybPatchRequest.externalId
+ naicsCode = kybPatchRequest.naicsCode
natureOfBusiness = kybPatchRequest.natureOfBusiness
websiteUrl = kybPatchRequest.websiteUrl
additionalProperties = kybPatchRequest.additionalProperties.toMutableMap()
@@ -839,6 +864,21 @@ private constructor(
this.externalId = externalId
}
+ /**
+ * 6-digit North American Industry Classification System (NAICS) code for the
+ * business.
+ */
+ fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
+
+ /**
+ * Sets [Builder.naicsCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.naicsCode] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun naicsCode(naicsCode: JsonField) = apply { this.naicsCode = naicsCode }
+
/**
* Short description of the company's line of business (i.e., what does the company
* do?).
@@ -905,6 +945,7 @@ private constructor(
businessEntity,
controlPerson,
externalId,
+ naicsCode,
natureOfBusiness,
websiteUrl,
additionalProperties.toMutableMap(),
@@ -923,6 +964,7 @@ private constructor(
businessEntity().ifPresent { it.validate() }
controlPerson().ifPresent { it.validate() }
externalId()
+ naicsCode()
natureOfBusiness()
websiteUrl()
validated = true
@@ -952,6 +994,7 @@ private constructor(
(businessEntity.asKnown().getOrNull()?.validity() ?: 0) +
(controlPerson.asKnown().getOrNull()?.validity() ?: 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
+ (if (naicsCode.asKnown().isPresent) 1 else 0) +
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
(if (websiteUrl.asKnown().isPresent) 1 else 0)
@@ -1951,6 +1994,7 @@ private constructor(
businessEntity == other.businessEntity &&
controlPerson == other.controlPerson &&
externalId == other.externalId &&
+ naicsCode == other.naicsCode &&
natureOfBusiness == other.natureOfBusiness &&
websiteUrl == other.websiteUrl &&
additionalProperties == other.additionalProperties
@@ -1963,6 +2007,7 @@ private constructor(
businessEntity,
controlPerson,
externalId,
+ naicsCode,
natureOfBusiness,
websiteUrl,
additionalProperties,
@@ -1972,7 +2017,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "KybPatchRequest{beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessEntity=$businessEntity, controlPerson=$controlPerson, externalId=$externalId, natureOfBusiness=$natureOfBusiness, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
+ "KybPatchRequest{beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessEntity=$businessEntity, controlPerson=$controlPerson, externalId=$externalId, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
}
/** The KYC request payload for updating an account holder. */
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 9178f9da..2291db7d 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
@@ -225,6 +225,7 @@ private constructor(
private val exemptionType: JsonField,
private val externalId: JsonField,
private val individual: JsonField,
+ private val naicsCode: JsonField,
private val natureOfBusiness: JsonField,
private val phoneNumber: JsonField,
private val requiredDocuments: JsonField>,
@@ -270,6 +271,9 @@ private constructor(
@JsonProperty("individual")
@ExcludeMissing
individual: JsonField = JsonMissing.of(),
+ @JsonProperty("naics_code")
+ @ExcludeMissing
+ naicsCode: JsonField = JsonMissing.of(),
@JsonProperty("nature_of_business")
@ExcludeMissing
natureOfBusiness: JsonField = JsonMissing.of(),
@@ -305,6 +309,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
requiredDocuments,
@@ -437,6 +442,15 @@ private constructor(
*/
fun individual(): Optional = individual.getOptional("individual")
+ /**
+ * Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
+ * System (NAICS) code for the business.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun naicsCode(): Optional = naicsCode.getOptional("naics_code")
+
/**
* Only present when user_type == "BUSINESS". User-submitted description of the business.
*
@@ -492,8 +506,8 @@ private constructor(
* be present.
*
* If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will
- * be present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -626,6 +640,13 @@ private constructor(
@ExcludeMissing
fun _individual(): JsonField = individual
+ /**
+ * Returns the raw JSON value of [naicsCode].
+ *
+ * Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("naics_code") @ExcludeMissing fun _naicsCode(): JsonField = naicsCode
+
/**
* Returns the raw JSON value of [natureOfBusiness].
*
@@ -731,6 +752,7 @@ private constructor(
private var exemptionType: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
private var individual: JsonField = JsonMissing.of()
+ private var naicsCode: JsonField = JsonMissing.of()
private var natureOfBusiness: JsonField = JsonMissing.of()
private var phoneNumber: JsonField = JsonMissing.of()
private var requiredDocuments: JsonField>? = null
@@ -758,6 +780,7 @@ private constructor(
exemptionType = kybKycPatchResponse.exemptionType
externalId = kybKycPatchResponse.externalId
individual = kybKycPatchResponse.individual
+ naicsCode = kybKycPatchResponse.naicsCode
natureOfBusiness = kybKycPatchResponse.natureOfBusiness
phoneNumber = kybKycPatchResponse.phoneNumber
requiredDocuments = kybKycPatchResponse.requiredDocuments.map { it.toMutableList() }
@@ -1009,6 +1032,21 @@ private constructor(
this.individual = individual
}
+ /**
+ * Only present when user_type == "BUSINESS". 6-digit North American Industry
+ * Classification System (NAICS) code for the business.
+ */
+ fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
+
+ /**
+ * Sets [Builder.naicsCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.naicsCode] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun naicsCode(naicsCode: JsonField) = apply { this.naicsCode = naicsCode }
+
/**
* Only present when user_type == "BUSINESS". User-submitted description of the
* business.
@@ -1128,8 +1166,8 @@ private constructor(
* will be present.
*
* If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes
- * will be present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*/
fun userType(userType: UserType) = userType(JsonField.of(userType))
@@ -1207,6 +1245,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
(requiredDocuments ?: JsonMissing.of()).map { it.toImmutable() },
@@ -1238,6 +1277,7 @@ private constructor(
exemptionType().ifPresent { it.validate() }
externalId()
individual().ifPresent { it.validate() }
+ naicsCode()
natureOfBusiness()
phoneNumber()
requiredDocuments().ifPresent { it.forEach { it.validate() } }
@@ -1279,6 +1319,7 @@ private constructor(
(exemptionType.asKnown().getOrNull()?.validity() ?: 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
(individual.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (naicsCode.asKnown().isPresent) 1 else 0) +
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
(if (phoneNumber.asKnown().isPresent) 1 else 0) +
(requiredDocuments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -2719,8 +2760,8 @@ private constructor(
* be present.
*
* If the type is "BUSINESS" then the "business_entity", "control_person",
- * "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will
- * be present.
+ * "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
+ * attributes will be present.
*/
class UserType @JsonCreator private constructor(private val value: JsonField) :
Enum {
@@ -3713,6 +3754,7 @@ private constructor(
exemptionType == other.exemptionType &&
externalId == other.externalId &&
individual == other.individual &&
+ naicsCode == other.naicsCode &&
natureOfBusiness == other.natureOfBusiness &&
phoneNumber == other.phoneNumber &&
requiredDocuments == other.requiredDocuments &&
@@ -3738,6 +3780,7 @@ private constructor(
exemptionType,
externalId,
individual,
+ naicsCode,
natureOfBusiness,
phoneNumber,
requiredDocuments,
@@ -3753,7 +3796,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "KybKycPatchResponse{token=$token, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, created=$created, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
+ "KybKycPatchResponse{token=$token, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, created=$created, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
}
class PatchResponse
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 9a49ea1a..2c1485c4 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
@@ -262,6 +262,7 @@ private constructor(
private val updateRequest: JsonField,
private val eventType: JsonField,
private val externalId: JsonField,
+ private val naicsCode: JsonField,
private val natureOfBusiness: JsonField,
private val websiteUrl: JsonField,
private val additionalProperties: MutableMap,
@@ -279,6 +280,9 @@ private constructor(
@JsonProperty("external_id")
@ExcludeMissing
externalId: JsonField = JsonMissing.of(),
+ @JsonProperty("naics_code")
+ @ExcludeMissing
+ naicsCode: JsonField = JsonMissing.of(),
@JsonProperty("nature_of_business")
@ExcludeMissing
natureOfBusiness: JsonField = JsonMissing.of(),
@@ -290,6 +294,7 @@ private constructor(
updateRequest,
eventType,
externalId,
+ naicsCode,
natureOfBusiness,
websiteUrl,
mutableMapOf(),
@@ -327,6 +332,15 @@ private constructor(
*/
fun externalId(): Optional = externalId.getOptional("external_id")
+ /**
+ * 6-digit North American Industry Classification System (NAICS) code for the business. Only
+ * present if naics_code was included in the update request.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun naicsCode(): Optional = naicsCode.getOptional("naics_code")
+
/**
* Short description of the company's line of business (i.e., what does the company do?).
*
@@ -379,6 +393,13 @@ private constructor(
@ExcludeMissing
fun _externalId(): JsonField = externalId
+ /**
+ * Returns the raw JSON value of [naicsCode].
+ *
+ * Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("naics_code") @ExcludeMissing fun _naicsCode(): JsonField = naicsCode
+
/**
* Returns the raw JSON value of [natureOfBusiness].
*
@@ -431,6 +452,7 @@ private constructor(
private var updateRequest: JsonField? = null
private var eventType: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
+ private var naicsCode: JsonField = JsonMissing.of()
private var natureOfBusiness: JsonField = JsonMissing.of()
private var websiteUrl: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -441,6 +463,7 @@ private constructor(
updateRequest = kybPayload.updateRequest
eventType = kybPayload.eventType
externalId = kybPayload.externalId
+ naicsCode = kybPayload.naicsCode
natureOfBusiness = kybPayload.natureOfBusiness
websiteUrl = kybPayload.websiteUrl
additionalProperties = kybPayload.additionalProperties.toMutableMap()
@@ -499,6 +522,21 @@ private constructor(
*/
fun externalId(externalId: JsonField) = apply { this.externalId = externalId }
+ /**
+ * 6-digit North American Industry Classification System (NAICS) code for the business.
+ * Only present if naics_code was included in the update request.
+ */
+ fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
+
+ /**
+ * Sets [Builder.naicsCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.naicsCode] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun naicsCode(naicsCode: JsonField) = apply { this.naicsCode = naicsCode }
+
/**
* Short description of the company's line of business (i.e., what does the company
* do?).
@@ -567,6 +605,7 @@ private constructor(
checkRequired("updateRequest", updateRequest),
eventType,
externalId,
+ naicsCode,
natureOfBusiness,
websiteUrl,
additionalProperties.toMutableMap(),
@@ -584,6 +623,7 @@ private constructor(
updateRequest().validate()
eventType().ifPresent { it.validate() }
externalId()
+ naicsCode()
natureOfBusiness()
websiteUrl()
validated = true
@@ -609,6 +649,7 @@ private constructor(
(updateRequest.asKnown().getOrNull()?.validity() ?: 0) +
(eventType.asKnown().getOrNull()?.validity() ?: 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
+ (if (naicsCode.asKnown().isPresent) 1 else 0) +
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
(if (websiteUrl.asKnown().isPresent) 1 else 0)
@@ -1978,6 +2019,7 @@ private constructor(
updateRequest == other.updateRequest &&
eventType == other.eventType &&
externalId == other.externalId &&
+ naicsCode == other.naicsCode &&
natureOfBusiness == other.natureOfBusiness &&
websiteUrl == other.websiteUrl &&
additionalProperties == other.additionalProperties
@@ -1989,6 +2031,7 @@ private constructor(
updateRequest,
eventType,
externalId,
+ naicsCode,
natureOfBusiness,
websiteUrl,
additionalProperties,
@@ -1998,7 +2041,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "KybPayload{token=$token, updateRequest=$updateRequest, eventType=$eventType, externalId=$externalId, natureOfBusiness=$natureOfBusiness, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
+ "KybPayload{token=$token, updateRequest=$updateRequest, eventType=$eventType, externalId=$externalId, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
}
/** KYC payload for an updated account holder. */
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPage.kt
new file mode 100644
index 00000000..80a97926
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPage.kt
@@ -0,0 +1,193 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.AutoPager
+import com.lithic.api.core.Page
+import com.lithic.api.core.checkRequired
+import com.lithic.api.services.blocking.authRules.V2Service
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** @see V2Service.listResults */
+class AuthRuleV2ListResultsPage
+private constructor(
+ private val service: V2Service,
+ private val params: AuthRuleV2ListResultsParams,
+ private val response: AuthRuleV2ListResultsPageResponse,
+) : Page {
+
+ /**
+ * Delegates to [AuthRuleV2ListResultsPageResponse], but gracefully handles missing data.
+ *
+ * @see AuthRuleV2ListResultsPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [AuthRuleV2ListResultsPageResponse], but gracefully handles missing data.
+ *
+ * @see AuthRuleV2ListResultsPageResponse.hasMore
+ */
+ fun hasMore(): Optional = response._hasMore().getOptional("has_more")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty()
+
+ fun nextPageParams(): AuthRuleV2ListResultsParams =
+ if (params.endingBefore().isPresent) {
+ params
+ .toBuilder()
+ .endingBefore(
+ items()
+ .first()
+ .accept(
+ object : V2ListResultsResponse.Visitor> {
+ override fun visitAuthorizationResult(
+ authorizationResult: V2ListResultsResponse.AuthorizationResult
+ ): Optional =
+ authorizationResult._token().getOptional("token")
+
+ override fun visitAuthentication3dsResult(
+ authentication3dsResult:
+ V2ListResultsResponse.Authentication3dsResult
+ ): Optional =
+ authentication3dsResult._token().getOptional("token")
+
+ override fun visitTokenizationResult(
+ tokenizationResult: V2ListResultsResponse.TokenizationResult
+ ): Optional =
+ tokenizationResult._token().getOptional("token")
+
+ override fun visitAchResult(
+ achResult: V2ListResultsResponse.AchResult
+ ): Optional = achResult._token().getOptional("token")
+ }
+ )
+ )
+ .build()
+ } else {
+ params
+ .toBuilder()
+ .startingAfter(
+ items()
+ .last()
+ .accept(
+ object : V2ListResultsResponse.Visitor> {
+ override fun visitAuthorizationResult(
+ authorizationResult: V2ListResultsResponse.AuthorizationResult
+ ): Optional =
+ authorizationResult._token().getOptional("token")
+
+ override fun visitAuthentication3dsResult(
+ authentication3dsResult:
+ V2ListResultsResponse.Authentication3dsResult
+ ): Optional =
+ authentication3dsResult._token().getOptional("token")
+
+ override fun visitTokenizationResult(
+ tokenizationResult: V2ListResultsResponse.TokenizationResult
+ ): Optional =
+ tokenizationResult._token().getOptional("token")
+
+ override fun visitAchResult(
+ achResult: V2ListResultsResponse.AchResult
+ ): Optional = achResult._token().getOptional("token")
+ }
+ )
+ )
+ .build()
+ }
+
+ override fun nextPage(): AuthRuleV2ListResultsPage = service.listResults(nextPageParams())
+
+ fun autoPager(): AutoPager = AutoPager.from(this)
+
+ /** The parameters that were used to request this page. */
+ fun params(): AuthRuleV2ListResultsParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): AuthRuleV2ListResultsPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AuthRuleV2ListResultsPage].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AuthRuleV2ListResultsPage]. */
+ class Builder internal constructor() {
+
+ private var service: V2Service? = null
+ private var params: AuthRuleV2ListResultsParams? = null
+ private var response: AuthRuleV2ListResultsPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(authRuleV2ListResultsPage: AuthRuleV2ListResultsPage) = apply {
+ service = authRuleV2ListResultsPage.service
+ params = authRuleV2ListResultsPage.params
+ response = authRuleV2ListResultsPage.response
+ }
+
+ fun service(service: V2Service) = apply { this.service = service }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: AuthRuleV2ListResultsParams) = apply { this.params = params }
+
+ /** The response that this page was parsed from. */
+ fun response(response: AuthRuleV2ListResultsPageResponse) = apply {
+ this.response = response
+ }
+
+ /**
+ * Returns an immutable instance of [AuthRuleV2ListResultsPage].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AuthRuleV2ListResultsPage =
+ AuthRuleV2ListResultsPage(
+ checkRequired("service", service),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthRuleV2ListResultsPage &&
+ service == other.service &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, params, response)
+
+ override fun toString() =
+ "AuthRuleV2ListResultsPage{service=$service, params=$params, response=$response}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageAsync.kt
new file mode 100644
index 00000000..bf7822cf
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageAsync.kt
@@ -0,0 +1,209 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.AutoPagerAsync
+import com.lithic.api.core.PageAsync
+import com.lithic.api.core.checkRequired
+import com.lithic.api.services.async.authRules.V2ServiceAsync
+import java.util.Objects
+import java.util.Optional
+import java.util.concurrent.CompletableFuture
+import java.util.concurrent.Executor
+import kotlin.jvm.optionals.getOrNull
+
+/** @see V2ServiceAsync.listResults */
+class AuthRuleV2ListResultsPageAsync
+private constructor(
+ private val service: V2ServiceAsync,
+ private val streamHandlerExecutor: Executor,
+ private val params: AuthRuleV2ListResultsParams,
+ private val response: AuthRuleV2ListResultsPageResponse,
+) : PageAsync {
+
+ /**
+ * Delegates to [AuthRuleV2ListResultsPageResponse], but gracefully handles missing data.
+ *
+ * @see AuthRuleV2ListResultsPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [AuthRuleV2ListResultsPageResponse], but gracefully handles missing data.
+ *
+ * @see AuthRuleV2ListResultsPageResponse.hasMore
+ */
+ fun hasMore(): Optional = response._hasMore().getOptional("has_more")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty()
+
+ fun nextPageParams(): AuthRuleV2ListResultsParams =
+ if (params.endingBefore().isPresent) {
+ params
+ .toBuilder()
+ .endingBefore(
+ items()
+ .first()
+ .accept(
+ object : V2ListResultsResponse.Visitor> {
+ override fun visitAuthorizationResult(
+ authorizationResult: V2ListResultsResponse.AuthorizationResult
+ ): Optional =
+ authorizationResult._token().getOptional("token")
+
+ override fun visitAuthentication3dsResult(
+ authentication3dsResult:
+ V2ListResultsResponse.Authentication3dsResult
+ ): Optional =
+ authentication3dsResult._token().getOptional("token")
+
+ override fun visitTokenizationResult(
+ tokenizationResult: V2ListResultsResponse.TokenizationResult
+ ): Optional =
+ tokenizationResult._token().getOptional("token")
+
+ override fun visitAchResult(
+ achResult: V2ListResultsResponse.AchResult
+ ): Optional = achResult._token().getOptional("token")
+ }
+ )
+ )
+ .build()
+ } else {
+ params
+ .toBuilder()
+ .startingAfter(
+ items()
+ .last()
+ .accept(
+ object : V2ListResultsResponse.Visitor> {
+ override fun visitAuthorizationResult(
+ authorizationResult: V2ListResultsResponse.AuthorizationResult
+ ): Optional =
+ authorizationResult._token().getOptional("token")
+
+ override fun visitAuthentication3dsResult(
+ authentication3dsResult:
+ V2ListResultsResponse.Authentication3dsResult
+ ): Optional =
+ authentication3dsResult._token().getOptional("token")
+
+ override fun visitTokenizationResult(
+ tokenizationResult: V2ListResultsResponse.TokenizationResult
+ ): Optional =
+ tokenizationResult._token().getOptional("token")
+
+ override fun visitAchResult(
+ achResult: V2ListResultsResponse.AchResult
+ ): Optional = achResult._token().getOptional("token")
+ }
+ )
+ )
+ .build()
+ }
+
+ override fun nextPage(): CompletableFuture =
+ service.listResults(nextPageParams())
+
+ fun autoPager(): AutoPagerAsync =
+ AutoPagerAsync.from(this, streamHandlerExecutor)
+
+ /** The parameters that were used to request this page. */
+ fun params(): AuthRuleV2ListResultsParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): AuthRuleV2ListResultsPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [AuthRuleV2ListResultsPageAsync].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AuthRuleV2ListResultsPageAsync]. */
+ class Builder internal constructor() {
+
+ private var service: V2ServiceAsync? = null
+ private var streamHandlerExecutor: Executor? = null
+ private var params: AuthRuleV2ListResultsParams? = null
+ private var response: AuthRuleV2ListResultsPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(authRuleV2ListResultsPageAsync: AuthRuleV2ListResultsPageAsync) = apply {
+ service = authRuleV2ListResultsPageAsync.service
+ streamHandlerExecutor = authRuleV2ListResultsPageAsync.streamHandlerExecutor
+ params = authRuleV2ListResultsPageAsync.params
+ response = authRuleV2ListResultsPageAsync.response
+ }
+
+ fun service(service: V2ServiceAsync) = apply { this.service = service }
+
+ fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
+ this.streamHandlerExecutor = streamHandlerExecutor
+ }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: AuthRuleV2ListResultsParams) = apply { this.params = params }
+
+ /** The response that this page was parsed from. */
+ fun response(response: AuthRuleV2ListResultsPageResponse) = apply {
+ this.response = response
+ }
+
+ /**
+ * Returns an immutable instance of [AuthRuleV2ListResultsPageAsync].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AuthRuleV2ListResultsPageAsync =
+ AuthRuleV2ListResultsPageAsync(
+ checkRequired("service", service),
+ checkRequired("streamHandlerExecutor", streamHandlerExecutor),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthRuleV2ListResultsPageAsync &&
+ service == other.service &&
+ streamHandlerExecutor == other.streamHandlerExecutor &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response)
+
+ override fun toString() =
+ "AuthRuleV2ListResultsPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
+}
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
new file mode 100644
index 00000000..4276fd48
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponse.kt
@@ -0,0 +1,258 @@
+// 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.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.checkKnown
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.toImmutable
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import kotlin.jvm.optionals.getOrNull
+
+class AuthRuleV2ListResultsPageResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val data: JsonField>,
+ private val hasMore: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("data")
+ @ExcludeMissing
+ data: JsonField> = JsonMissing.of(),
+ @JsonProperty("has_more") @ExcludeMissing hasMore: JsonField = JsonMissing.of(),
+ ) : this(data, hasMore, mutableMapOf())
+
+ /**
+ * @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 data(): List = data.getRequired("data")
+
+ /**
+ * Indicates whether there are more results to be retrieved by paging through the results.
+ *
+ * @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 hasMore(): Boolean = hasMore.getRequired("has_more")
+
+ /**
+ * Returns the raw JSON value of [data].
+ *
+ * Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data
+
+ /**
+ * Returns the raw JSON value of [hasMore].
+ *
+ * Unlike [hasMore], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("has_more") @ExcludeMissing fun _hasMore(): JsonField = hasMore
+
+ @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
+ * [AuthRuleV2ListResultsPageResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * .hasMore()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AuthRuleV2ListResultsPageResponse]. */
+ class Builder internal constructor() {
+
+ private var data: JsonField>? = null
+ private var hasMore: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(authRuleV2ListResultsPageResponse: AuthRuleV2ListResultsPageResponse) =
+ apply {
+ data = authRuleV2ListResultsPageResponse.data.map { it.toMutableList() }
+ hasMore = authRuleV2ListResultsPageResponse.hasMore
+ additionalProperties =
+ authRuleV2ListResultsPageResponse.additionalProperties.toMutableMap()
+ }
+
+ fun data(data: List) = data(JsonField.of(data))
+
+ /**
+ * Sets [Builder.data] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.data] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun data(data: JsonField>) = apply {
+ this.data = data.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [V2ListResultsResponse] to [Builder.data].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addData(data: V2ListResultsResponse) = apply {
+ this.data =
+ (this.data ?: JsonField.of(mutableListOf())).also {
+ checkKnown("data", it).add(data)
+ }
+ }
+
+ /**
+ * Alias for calling [addData] with
+ * `V2ListResultsResponse.ofAuthorizationResult(authorizationResult)`.
+ */
+ fun addData(authorizationResult: V2ListResultsResponse.AuthorizationResult) =
+ addData(V2ListResultsResponse.ofAuthorizationResult(authorizationResult))
+
+ /**
+ * Alias for calling [addData] with
+ * `V2ListResultsResponse.ofAuthentication3dsResult(authentication3dsResult)`.
+ */
+ fun addData(authentication3dsResult: V2ListResultsResponse.Authentication3dsResult) =
+ addData(V2ListResultsResponse.ofAuthentication3dsResult(authentication3dsResult))
+
+ /**
+ * Alias for calling [addData] with
+ * `V2ListResultsResponse.ofTokenizationResult(tokenizationResult)`.
+ */
+ fun addData(tokenizationResult: V2ListResultsResponse.TokenizationResult) =
+ addData(V2ListResultsResponse.ofTokenizationResult(tokenizationResult))
+
+ /** Alias for calling [addData] with `V2ListResultsResponse.ofAchResult(achResult)`. */
+ fun addData(achResult: V2ListResultsResponse.AchResult) =
+ addData(V2ListResultsResponse.ofAchResult(achResult))
+
+ /**
+ * Indicates whether there are more results to be retrieved by paging through the results.
+ */
+ fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore))
+
+ /**
+ * Sets [Builder.hasMore] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hasMore] with a well-typed [Boolean] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun hasMore(hasMore: JsonField) = apply { this.hasMore = hasMore }
+
+ 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 [AuthRuleV2ListResultsPageResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * .hasMore()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AuthRuleV2ListResultsPageResponse =
+ AuthRuleV2ListResultsPageResponse(
+ checkRequired("data", data).map { it.toImmutable() },
+ checkRequired("hasMore", hasMore),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AuthRuleV2ListResultsPageResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ data().forEach { it.validate() }
+ hasMore()
+ 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 =
+ (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (hasMore.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthRuleV2ListResultsPageResponse &&
+ data == other.data &&
+ hasMore == other.hasMore &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(data, hasMore, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AuthRuleV2ListResultsPageResponse{data=$data, hasMore=$hasMore, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsParams.kt
new file mode 100644
index 00000000..99101e4b
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListResultsParams.kt
@@ -0,0 +1,323 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.Params
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Lists Auth Rule evaluation results.
+ *
+ * **Limitations:**
+ * - Results are available for the past 3 months only
+ * - At least one filter (`event_token` or `auth_rule_token`) must be provided
+ * - When filtering by `event_token`, pagination is not supported
+ */
+class AuthRuleV2ListResultsParams
+private constructor(
+ private val authRuleToken: String?,
+ private val endingBefore: String?,
+ private val eventToken: String?,
+ private val hasActions: Boolean?,
+ private val pageSize: Long?,
+ private val startingAfter: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /** Filter by Auth Rule token */
+ fun authRuleToken(): Optional = Optional.ofNullable(authRuleToken)
+
+ /**
+ * A cursor representing an item's token before which a page of results should end. Used to
+ * retrieve the previous page of results before this item.
+ */
+ fun endingBefore(): Optional = Optional.ofNullable(endingBefore)
+
+ /** Filter by event token */
+ fun eventToken(): Optional = Optional.ofNullable(eventToken)
+
+ /**
+ * Filter by whether the rule evaluation produced any actions. When not provided, all results
+ * are returned.
+ */
+ fun hasActions(): Optional = Optional.ofNullable(hasActions)
+
+ /** Page size (for pagination). */
+ fun pageSize(): Optional = Optional.ofNullable(pageSize)
+
+ /**
+ * A cursor representing an item's token after which a page of results should begin. Used to
+ * retrieve the next page of results after this item.
+ */
+ fun startingAfter(): Optional = Optional.ofNullable(startingAfter)
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): AuthRuleV2ListResultsParams = builder().build()
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AuthRuleV2ListResultsParams].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AuthRuleV2ListResultsParams]. */
+ class Builder internal constructor() {
+
+ private var authRuleToken: String? = null
+ private var endingBefore: String? = null
+ private var eventToken: String? = null
+ private var hasActions: Boolean? = null
+ private var pageSize: Long? = null
+ private var startingAfter: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(authRuleV2ListResultsParams: AuthRuleV2ListResultsParams) = apply {
+ authRuleToken = authRuleV2ListResultsParams.authRuleToken
+ endingBefore = authRuleV2ListResultsParams.endingBefore
+ eventToken = authRuleV2ListResultsParams.eventToken
+ hasActions = authRuleV2ListResultsParams.hasActions
+ pageSize = authRuleV2ListResultsParams.pageSize
+ startingAfter = authRuleV2ListResultsParams.startingAfter
+ additionalHeaders = authRuleV2ListResultsParams.additionalHeaders.toBuilder()
+ additionalQueryParams = authRuleV2ListResultsParams.additionalQueryParams.toBuilder()
+ }
+
+ /** Filter by Auth Rule token */
+ fun authRuleToken(authRuleToken: String?) = apply { this.authRuleToken = authRuleToken }
+
+ /** Alias for calling [Builder.authRuleToken] with `authRuleToken.orElse(null)`. */
+ fun authRuleToken(authRuleToken: Optional) =
+ authRuleToken(authRuleToken.getOrNull())
+
+ /**
+ * A cursor representing an item's token before which a page of results should end. Used to
+ * retrieve the previous page of results before this item.
+ */
+ fun endingBefore(endingBefore: String?) = apply { this.endingBefore = endingBefore }
+
+ /** Alias for calling [Builder.endingBefore] with `endingBefore.orElse(null)`. */
+ fun endingBefore(endingBefore: Optional) = endingBefore(endingBefore.getOrNull())
+
+ /** Filter by event token */
+ fun eventToken(eventToken: String?) = apply { this.eventToken = eventToken }
+
+ /** Alias for calling [Builder.eventToken] with `eventToken.orElse(null)`. */
+ fun eventToken(eventToken: Optional) = eventToken(eventToken.getOrNull())
+
+ /**
+ * Filter by whether the rule evaluation produced any actions. When not provided, all
+ * results are returned.
+ */
+ fun hasActions(hasActions: Boolean?) = apply { this.hasActions = hasActions }
+
+ /**
+ * Alias for [Builder.hasActions].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun hasActions(hasActions: Boolean) = hasActions(hasActions as Boolean?)
+
+ /** Alias for calling [Builder.hasActions] with `hasActions.orElse(null)`. */
+ fun hasActions(hasActions: Optional) = hasActions(hasActions.getOrNull())
+
+ /** Page size (for pagination). */
+ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize }
+
+ /**
+ * Alias for [Builder.pageSize].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun pageSize(pageSize: Long) = pageSize(pageSize as Long?)
+
+ /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */
+ fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull())
+
+ /**
+ * A cursor representing an item's token after which a page of results should begin. Used to
+ * retrieve the next page of results after this item.
+ */
+ fun startingAfter(startingAfter: String?) = apply { this.startingAfter = startingAfter }
+
+ /** Alias for calling [Builder.startingAfter] with `startingAfter.orElse(null)`. */
+ fun startingAfter(startingAfter: Optional) =
+ startingAfter(startingAfter.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [AuthRuleV2ListResultsParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): AuthRuleV2ListResultsParams =
+ AuthRuleV2ListResultsParams(
+ authRuleToken,
+ endingBefore,
+ eventToken,
+ hasActions,
+ pageSize,
+ startingAfter,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams =
+ QueryParams.builder()
+ .apply {
+ authRuleToken?.let { put("auth_rule_token", it) }
+ endingBefore?.let { put("ending_before", it) }
+ eventToken?.let { put("event_token", it) }
+ hasActions?.let { put("has_actions", it.toString()) }
+ pageSize?.let { put("page_size", it.toString()) }
+ startingAfter?.let { put("starting_after", it) }
+ putAll(additionalQueryParams)
+ }
+ .build()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthRuleV2ListResultsParams &&
+ authRuleToken == other.authRuleToken &&
+ endingBefore == other.endingBefore &&
+ eventToken == other.eventToken &&
+ hasActions == other.hasActions &&
+ pageSize == other.pageSize &&
+ startingAfter == other.startingAfter &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(
+ authRuleToken,
+ endingBefore,
+ eventToken,
+ hasActions,
+ pageSize,
+ startingAfter,
+ additionalHeaders,
+ additionalQueryParams,
+ )
+
+ override fun toString() =
+ "AuthRuleV2ListResultsParams{authRuleToken=$authRuleToken, endingBefore=$endingBefore, eventToken=$eventToken, hasActions=$hasActions, pageSize=$pageSize, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
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 5c137b6e..b6127076 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
@@ -95,6 +95,14 @@ private constructor(
*/
fun externalId(): Optional = body.externalId()
+ /**
+ * Token of an existing hold to settle when this transfer is initiated
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun holdToken(): Optional = body.holdToken()
+
/**
* Optional descriptor for the transfer.
*
@@ -169,6 +177,13 @@ private constructor(
*/
fun _externalId(): JsonField = body._externalId()
+ /**
+ * Returns the raw JSON value of [holdToken].
+ *
+ * Unlike [holdToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _holdToken(): JsonField = body._holdToken()
+
/**
* Returns the raw JSON value of [memo].
*
@@ -351,6 +366,18 @@ private constructor(
*/
fun externalId(externalId: JsonField) = apply { body.externalId(externalId) }
+ /** Token of an existing hold to settle when this transfer is initiated */
+ fun holdToken(holdToken: String) = apply { body.holdToken(holdToken) }
+
+ /**
+ * Sets [Builder.holdToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.holdToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun holdToken(holdToken: JsonField) = apply { body.holdToken(holdToken) }
+
/** Optional descriptor for the transfer. */
fun memo(memo: String) = apply { body.memo(memo) }
@@ -537,6 +564,7 @@ private constructor(
private val type: JsonField,
private val token: JsonField,
private val externalId: JsonField,
+ private val holdToken: JsonField,
private val memo: JsonField,
private val onClosedAccount: JsonField,
private val additionalProperties: MutableMap,
@@ -562,6 +590,9 @@ private constructor(
@JsonProperty("external_id")
@ExcludeMissing
externalId: JsonField = JsonMissing.of(),
+ @JsonProperty("hold_token")
+ @ExcludeMissing
+ holdToken: JsonField = JsonMissing.of(),
@JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(),
@JsonProperty("on_closed_account")
@ExcludeMissing
@@ -575,6 +606,7 @@ private constructor(
type,
token,
externalId,
+ holdToken,
memo,
onClosedAccount,
mutableMapOf(),
@@ -648,6 +680,14 @@ private constructor(
*/
fun externalId(): Optional = externalId.getOptional("external_id")
+ /**
+ * Token of an existing hold to settle when this transfer is initiated
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun holdToken(): Optional = holdToken.getOptional("hold_token")
+
/**
* Optional descriptor for the transfer.
*
@@ -731,6 +771,13 @@ private constructor(
@ExcludeMissing
fun _externalId(): JsonField = externalId
+ /**
+ * Returns the raw JSON value of [holdToken].
+ *
+ * Unlike [holdToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("hold_token") @ExcludeMissing fun _holdToken(): JsonField = holdToken
+
/**
* Returns the raw JSON value of [memo].
*
@@ -790,6 +837,7 @@ private constructor(
private var type: JsonField? = null
private var token: JsonField = JsonMissing.of()
private var externalId: JsonField = JsonMissing.of()
+ private var holdToken: JsonField = JsonMissing.of()
private var memo: JsonField = JsonMissing.of()
private var onClosedAccount: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -804,6 +852,7 @@ private constructor(
type = createBookTransferRequest.type
token = createBookTransferRequest.token
externalId = createBookTransferRequest.externalId
+ holdToken = createBookTransferRequest.holdToken
memo = createBookTransferRequest.memo
onClosedAccount = createBookTransferRequest.onClosedAccount
additionalProperties = createBookTransferRequest.additionalProperties.toMutableMap()
@@ -924,6 +973,18 @@ private constructor(
*/
fun externalId(externalId: JsonField) = apply { this.externalId = externalId }
+ /** Token of an existing hold to settle when this transfer is initiated */
+ fun holdToken(holdToken: String) = holdToken(JsonField.of(holdToken))
+
+ /**
+ * Sets [Builder.holdToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.holdToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun holdToken(holdToken: JsonField) = apply { this.holdToken = holdToken }
+
/** Optional descriptor for the transfer. */
fun memo(memo: String) = memo(JsonField.of(memo))
@@ -997,6 +1058,7 @@ private constructor(
checkRequired("type", type),
token,
externalId,
+ holdToken,
memo,
onClosedAccount,
additionalProperties.toMutableMap(),
@@ -1018,6 +1080,7 @@ private constructor(
type().validate()
token()
externalId()
+ holdToken()
memo()
onClosedAccount().ifPresent { it.validate() }
validated = true
@@ -1047,6 +1110,7 @@ private constructor(
(type.asKnown().getOrNull()?.validity() ?: 0) +
(if (token.asKnown().isPresent) 1 else 0) +
(if (externalId.asKnown().isPresent) 1 else 0) +
+ (if (holdToken.asKnown().isPresent) 1 else 0) +
(if (memo.asKnown().isPresent) 1 else 0) +
(onClosedAccount.asKnown().getOrNull()?.validity() ?: 0)
@@ -1064,6 +1128,7 @@ private constructor(
type == other.type &&
token == other.token &&
externalId == other.externalId &&
+ holdToken == other.holdToken &&
memo == other.memo &&
onClosedAccount == other.onClosedAccount &&
additionalProperties == other.additionalProperties
@@ -1079,6 +1144,7 @@ private constructor(
type,
token,
externalId,
+ holdToken,
memo,
onClosedAccount,
additionalProperties,
@@ -1088,7 +1154,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CreateBookTransferRequest{amount=$amount, category=$category, fromFinancialAccountToken=$fromFinancialAccountToken, subtype=$subtype, toFinancialAccountToken=$toFinancialAccountToken, type=$type, token=$token, externalId=$externalId, memo=$memo, onClosedAccount=$onClosedAccount, additionalProperties=$additionalProperties}"
+ "CreateBookTransferRequest{amount=$amount, category=$category, fromFinancialAccountToken=$fromFinancialAccountToken, subtype=$subtype, toFinancialAccountToken=$toFinancialAccountToken, type=$type, token=$token, externalId=$externalId, holdToken=$holdToken, memo=$memo, onClosedAccount=$onClosedAccount, additionalProperties=$additionalProperties}"
}
class BookTransferCategory
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 758a8889..8fcd14ef 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
@@ -27,6 +27,7 @@ private constructor(
private val token: JsonField,
private val acquirerFee: JsonField,
private val amount: JsonField,
+ private val amounts: JsonField,
private val authorizationAmount: JsonField,
private val avs: JsonField