diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c6e0ed7db..620a05d92 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,10 +20,10 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Set up Java
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: temurin
java-version: |
@@ -40,14 +40,17 @@ jobs:
build:
timeout-minutes: 15
name: build
+ permissions:
+ contents: read
+ id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/lithic-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Set up Java
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: temurin
java-version: |
@@ -61,16 +64,31 @@ jobs:
- name: Build SDK
run: ./scripts/build
+ - name: Get GitHub OIDC Token
+ if: github.repository == 'stainless-sdks/lithic-java'
+ id: github-oidc
+ uses: actions/github-script@v8
+ with:
+ script: core.setOutput('github_token', await core.getIDToken());
+
+ - name: Build and upload Maven artifacts
+ if: github.repository == 'stainless-sdks/lithic-java'
+ env:
+ URL: https://pkg.stainless.com/s
+ AUTH: ${{ steps.github-oidc.outputs.github_token }}
+ SHA: ${{ github.sha }}
+ PROJECT: lithic-java
+ run: ./scripts/upload-artifacts
test:
timeout-minutes: 15
name: test
runs-on: ${{ github.repository == 'stainless-sdks/lithic-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Set up Java
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: temurin
java-version: |
diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index cd7b92eec..68a62dbb2 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Set up Java
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: temurin
java-version: |
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index 445c0f6f3..8cee17619 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'lithic-com/lithic-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Check release environment
run: |
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index d3dc9f51b..988e843fd 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.115.0"
+ ".": "0.116.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index ddb484b7e..0080147fb 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-4ecc06edca2cfad4eaf11573611e89823fda5f56370bac5cd02a498a6b277d09.yml
-openapi_spec_hash: 8f4a30bec4348cbde85b1e65bef9189a
-config_hash: 9dddee5f7af579864599849cb28a0770
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ce2adff9b644ed4562b5342a4a43d0b40c98d43b4e063b4626f4ca5d342f1b92.yml
+openapi_spec_hash: fbc84b866ce96457261ac58b4e75c71d
+config_hash: 31d71922d7838f34ae0875c9b8026d99
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c879280ae..fb6fe40fe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,59 @@
# Changelog
+## 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)
+
+### Features
+
+* **api:** Add card.updated event ([08c0ec5](https://github.com/lithic-com/lithic-java/commit/08c0ec5b07c9904a446496fbef297c3958b33adf))
+* **api:** Add idempotency key to cards POST and PATCH endpoints ([e4de24f](https://github.com/lithic-com/lithic-java/commit/e4de24f1c5a533c8d8074fac447d64236d276dc4))
+* **api:** Add merchant location fields to simulator endpoints ([261c721](https://github.com/lithic-com/lithic-java/commit/261c7217cb9db99c252fbc73033b135289f3b71b))
+* **api:** Add tags field to card transactions ([746ee7f](https://github.com/lithic-com/lithic-java/commit/746ee7fd9f55ea61a20c2d14f2486036b7d6211a))
+* **api:** make filter optional for Spend Velocity Auth Rules ([6122ecc](https://github.com/lithic-com/lithic-java/commit/6122eccf30d48db7aaba2fd6f8e94bf76fc7ceb4))
+* **client:** send `X-Stainless-Kotlin-Version` header ([aa06e8d](https://github.com/lithic-com/lithic-java/commit/aa06e8dc2309292773fbd45a3f655709f3bdf550))
+
+
+### Bug Fixes
+
+* **api:** Correct field name from ach_hold__period to ach_hold_period ([e9f3ae9](https://github.com/lithic-com/lithic-java/commit/e9f3ae9d5e5797a6458138d27e3b7a21fee0e9bd))
+* **api:** mark AppleWebPushProvisioningResponse fields required ([464fcae](https://github.com/lithic-com/lithic-java/commit/464fcaeefe3040303874976e8746601fb1d2cb0b))
+* **api:** rename WIRE_DRAWDOWN_REQUEST to WIRE_INBOUND_DRAWDOWN_REQUEST ([6122ecc](https://github.com/lithic-com/lithic-java/commit/6122eccf30d48db7aaba2fd6f8e94bf76fc7ceb4))
+* **client:** disallow coercion from float to int ([126f812](https://github.com/lithic-com/lithic-java/commit/126f8126438b97c2cc516aba5d85bf4abbe08352))
+* **client:** fully respect max retries ([bd0a9da](https://github.com/lithic-com/lithic-java/commit/bd0a9da6fc8e2d9b4ed83a0c16b9e9afd5ceb42a))
+* **client:** preserve time zone in lenient date-time parsing ([b82b025](https://github.com/lithic-com/lithic-java/commit/b82b025bc29fc0454d1db1f790185309548cb4f0))
+* **client:** send retry count header for max retries 0 ([bd0a9da](https://github.com/lithic-com/lithic-java/commit/bd0a9da6fc8e2d9b4ed83a0c16b9e9afd5ceb42a))
+* date time deserialization leniency ([ad467a4](https://github.com/lithic-com/lithic-java/commit/ad467a4ae4e51a2dfd5e9b7be5800ae9d4ca56fc))
+* deserialization order ([0e39fef](https://github.com/lithic-com/lithic-java/commit/0e39fefef9ef8651a56b5689e24e7965be4fbcbf))
+
+
+### Chores
+
+* Add spec linter for YAML and folded style multiline strings ([b437e45](https://github.com/lithic-com/lithic-java/commit/b437e45c988dfb6b2844b2d02ca397b2688d3521))
+* **ci:** upgrade `actions/github-script` ([ccebfa3](https://github.com/lithic-com/lithic-java/commit/ccebfa38275538c52ef8c62041351abc1ec68c27))
+* **ci:** upgrade `actions/setup-java` ([4e7e0b2](https://github.com/lithic-com/lithic-java/commit/4e7e0b23375dcad5eda7626fd6f5dc83d774f4b7))
+* configure new SDK language ([3dc7d3f](https://github.com/lithic-com/lithic-java/commit/3dc7d3f2903edec88f307dfa5d17e6b5f377e3f0))
+* fix build error ([d9046f9](https://github.com/lithic-com/lithic-java/commit/d9046f9a5eca4e5d4b8964c70a1c2144941d9b6a))
+* fix build error ([ee7c05b](https://github.com/lithic-com/lithic-java/commit/ee7c05b2ab02d8cef3e3283ef2b4a1007d997e95))
+* fix test ([29f6004](https://github.com/lithic-com/lithic-java/commit/29f6004a8cbba567f64ce4f0f681d4d5c7ef94f3))
+* **internal:** clean up maven repo artifact script and add html documentation to repo root ([7838ba8](https://github.com/lithic-com/lithic-java/commit/7838ba8e1c5a14df27507a5aa6b7fb6444531a98))
+* **internal:** codegen related update ([4373405](https://github.com/lithic-com/lithic-java/commit/437340526d2b30ef5f07989118dfef51360dfa0c))
+* **internal:** codegen related update ([6b3f7ee](https://github.com/lithic-com/lithic-java/commit/6b3f7ee38b9f387e28cce9d19d5fec3a6718cfbf))
+* **internal:** correct cache invalidation for `SKIP_MOCK_TESTS` ([ad49965](https://github.com/lithic-com/lithic-java/commit/ad49965c5aad1d8d310cd5fc47a15557d2aa1aa6))
+* **internal:** depend on packages directly in example ([bd0a9da](https://github.com/lithic-com/lithic-java/commit/bd0a9da6fc8e2d9b4ed83a0c16b9e9afd5ceb42a))
+* **internal:** improve maven repo docs ([737c025](https://github.com/lithic-com/lithic-java/commit/737c025a59820d23176d4e45c50f9ab0781a791c))
+* **internal:** support uploading Maven repo artifacts to stainless package server ([da51092](https://github.com/lithic-com/lithic-java/commit/da510920d18bdd6b4e2a655755e9fe21f145bf9f))
+* **internal:** update `actions/checkout` version ([6764fb4](https://github.com/lithic-com/lithic-java/commit/6764fb4c842d48cffa5a6742f4c0a9ef132e0329))
+* **internal:** update maven repo doc to include authentication ([00cccfb](https://github.com/lithic-com/lithic-java/commit/00cccfb7f68e4216728dd54d98f1de1deaab35ed))
+* Rework event type generation to support spec splitting ([bb604fb](https://github.com/lithic-com/lithic-java/commit/bb604fbee3a368cfbe5c4e132f5974b691121255))
+* test on Jackson 2.14.0 to avoid encountering FasterXML/jackson-databind[#3240](https://github.com/lithic-com/lithic-java/issues/3240) in tests ([ad467a4](https://github.com/lithic-com/lithic-java/commit/ad467a4ae4e51a2dfd5e9b7be5800ae9d4ca56fc))
+
+
+### Documentation
+
+* add comment for arbitrary value fields ([da7b625](https://github.com/lithic-com/lithic-java/commit/da7b625d33dd3b68d657fbe34fd41e0b6f0aa564))
+* Remove deprecated tag from MERCHANT_LOCKED card type ([5bf8022](https://github.com/lithic-com/lithic-java/commit/5bf802286350906c6b6c27de3987bcce86a0090c))
+
## 0.115.0 (2026-01-08)
Full Changelog: [v0.114.0...v0.115.0](https://github.com/lithic-com/lithic-java/compare/v0.114.0...v0.115.0)
diff --git a/README.md b/README.md
index 234c6d0f2..7829b8532 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.115.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.115.0)
+[](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)
@@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc
-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.115.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.116.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.115.0")
+implementation("com.lithic.api:lithic-java:0.116.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.115.0")
com.lithic.api
lithic-java
- 0.115.0
+ 0.116.0
```
@@ -416,6 +416,8 @@ If the SDK threw an exception, but you're _certain_ the version is compatible, t
> [!CAUTION]
> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.
+Also note that there are bugs in older Jackson versions that can affect the SDK. We don't work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.
+
## Network options
### Retries
diff --git a/build.gradle.kts b/build.gradle.kts
index 1c30b48af..72a101ec2 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.115.0" // x-release-please-version
+ version = "0.116.0" // x-release-please-version
}
subprojects {
diff --git a/buildSrc/src/main/kotlin/lithic.kotlin.gradle.kts b/buildSrc/src/main/kotlin/lithic.kotlin.gradle.kts
index 911f27dd7..e09a84b24 100644
--- a/buildSrc/src/main/kotlin/lithic.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/lithic.kotlin.gradle.kts
@@ -33,6 +33,9 @@ kotlin {
tasks.withType().configureEach {
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
+
+ // `SKIP_MOCK_TESTS` affects which tests run so it must be added as input for proper cache invalidation.
+ inputs.property("skipMockTests", System.getenv("SKIP_MOCK_TESTS")).optional(true)
}
val ktfmt by configurations.creating
diff --git a/buildSrc/src/main/kotlin/lithic.publish.gradle.kts b/buildSrc/src/main/kotlin/lithic.publish.gradle.kts
index e5ca4e7e8..bda852fea 100644
--- a/buildSrc/src/main/kotlin/lithic.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/lithic.publish.gradle.kts
@@ -7,6 +7,17 @@ plugins {
id("com.vanniktech.maven.publish")
}
+publishing {
+ repositories {
+ if (project.hasProperty("publishLocal")) {
+ maven {
+ name = "LocalFileSystem"
+ url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo")
+ }
+ }
+ }
+}
+
repositories {
gradlePluginPortal()
mavenCentral()
@@ -17,8 +28,10 @@ extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
configure {
- signAllPublications()
- publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
+ if (!project.hasProperty("publishLocal")) {
+ signAllPublications()
+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
+ }
coordinates(project.group.toString(), project.name, project.version.toString())
configure(
diff --git a/examples/.keep b/examples/.keep
deleted file mode 100644
index d8c73e937..000000000
--- a/examples/.keep
+++ /dev/null
@@ -1,4 +0,0 @@
-File generated from our OpenAPI spec by Stainless.
-
-This directory can be used to store example files demonstrating usage of this SDK.
-It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
\ No newline at end of file
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 1eb00e26b..ac00e64a5 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
@@ -18,6 +18,7 @@ import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
+import java.util.concurrent.ExecutorService
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
@@ -46,11 +47,31 @@ class LithicOkHttpClient private constructor() {
class Builder internal constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
+ private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
+ /**
+ * The executor service to use for running HTTP requests.
+ *
+ * Defaults to OkHttp's
+ * [default executor service](https://github.com/square/okhttp/blob/ace792f443b2ffb17974f5c0d1cecdf589309f26/okhttp/src/commonJvmAndroid/kotlin/okhttp3/Dispatcher.kt#L98-L104).
+ *
+ * This class takes ownership of the executor service and shuts it down when closed.
+ */
+ fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
+ this.dispatcherExecutorService = dispatcherExecutorService
+ }
+
+ /**
+ * Alias for calling [Builder.dispatcherExecutorService] with
+ * `dispatcherExecutorService.orElse(null)`.
+ */
+ fun dispatcherExecutorService(dispatcherExecutorService: Optional) =
+ dispatcherExecutorService(dispatcherExecutorService.getOrNull())
+
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
@@ -323,6 +344,7 @@ class LithicOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
.hostnameVerifier(hostnameVerifier)
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 0f0acb3ed..aebe796ed 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
@@ -18,6 +18,7 @@ import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
+import java.util.concurrent.ExecutorService
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
@@ -46,11 +47,31 @@ class LithicOkHttpClientAsync private constructor() {
class Builder internal constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
+ private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
+ /**
+ * The executor service to use for running HTTP requests.
+ *
+ * Defaults to OkHttp's
+ * [default executor service](https://github.com/square/okhttp/blob/ace792f443b2ffb17974f5c0d1cecdf589309f26/okhttp/src/commonJvmAndroid/kotlin/okhttp3/Dispatcher.kt#L98-L104).
+ *
+ * This class takes ownership of the executor service and shuts it down when closed.
+ */
+ fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
+ this.dispatcherExecutorService = dispatcherExecutorService
+ }
+
+ /**
+ * Alias for calling [Builder.dispatcherExecutorService] with
+ * `dispatcherExecutorService.orElse(null)`.
+ */
+ fun dispatcherExecutorService(dispatcherExecutorService: Optional) =
+ dispatcherExecutorService(dispatcherExecutorService.getOrNull())
+
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
@@ -323,6 +344,7 @@ class LithicOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
.hostnameVerifier(hostnameVerifier)
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 1b37107b8..02e255154 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
@@ -15,11 +15,13 @@ import java.net.Proxy
import java.time.Duration
import java.util.concurrent.CancellationException
import java.util.concurrent.CompletableFuture
+import java.util.concurrent.ExecutorService
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import okhttp3.Call
import okhttp3.Callback
+import okhttp3.Dispatcher
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaType
@@ -198,6 +200,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
+ private var dispatcherExecutorService: ExecutorService? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -208,6 +211,10 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
+ fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
+ this.dispatcherExecutorService = dispatcherExecutorService
+ }
+
fun sslSocketFactory(sslSocketFactory: SSLSocketFactory?) = apply {
this.sslSocketFactory = sslSocketFactory
}
@@ -223,12 +230,16 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
fun build(): OkHttpClient =
OkHttpClient(
okhttp3.OkHttpClient.Builder()
+ // `RetryingHttpClient` handles retries if the user enabled them.
+ .retryOnConnectionFailure(false)
.connectTimeout(timeout.connect())
.readTimeout(timeout.read())
.writeTimeout(timeout.write())
.callTimeout(timeout.request())
.proxy(proxy)
.apply {
+ dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }
+
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 477ecb78f..151c17eb0 100644
--- a/lithic-java-core/build.gradle.kts
+++ b/lithic-java-core/build.gradle.kts
@@ -5,14 +5,16 @@ plugins {
configurations.all {
resolutionStrategy {
- // Compile and test against a lower Jackson version to ensure we're compatible with it.
- // We publish with a higher version (see below) to ensure users depend on a secure version by default.
- force("com.fasterxml.jackson.core:jackson-core:2.13.4")
- force("com.fasterxml.jackson.core:jackson-databind:2.13.4")
- force("com.fasterxml.jackson.core:jackson-annotations:2.13.4")
- force("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.4")
- force("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4")
- force("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4")
+ // Compile and test against a lower Jackson version to ensure we're compatible with it. Note that
+ // we generally support 2.13.4, but test against 2.14.0 because 2.13.4 has some annoying (but
+ // niche) bugs (users should upgrade if they encounter them). We publish with a higher version
+ // (see below) to ensure users depend on a secure version by default.
+ force("com.fasterxml.jackson.core:jackson-core:2.14.0")
+ force("com.fasterxml.jackson.core:jackson-databind:2.14.0")
+ force("com.fasterxml.jackson.core:jackson-annotations:2.14.0")
+ force("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.0")
+ force("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.0")
+ force("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0")
}
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt
index 0db2163ff..87d897b8b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt
@@ -475,6 +475,7 @@ private constructor(
headers.put("X-Stainless-Package-Version", getPackageVersion())
headers.put("X-Stainless-Runtime", "JRE")
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
+ headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString())
apiKey.let {
if (!it.isEmpty()) {
headers.put("Authorization", it)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt
index 1154cadf6..c40847243 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt
@@ -25,7 +25,7 @@ import java.time.DateTimeException
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.OffsetDateTime
-import java.time.ZonedDateTime
+import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoField
@@ -37,7 +37,6 @@ fun jsonMapper(): JsonMapper =
.addModule(
SimpleModule()
.addSerializer(InputStreamSerializer)
- .addDeserializer(LocalDateTime::class.java, LenientLocalDateTimeDeserializer())
.addDeserializer(OffsetDateTime::class.java, LenientOffsetDateTimeDeserializer())
)
.withCoercionConfig(LogicalType.Boolean) {
@@ -49,6 +48,7 @@ fun jsonMapper(): JsonMapper =
}
.withCoercionConfig(LogicalType.Integer) {
it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
.setCoercion(CoercionInputShape.String, CoercionAction.Fail)
.setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
.setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
@@ -66,6 +66,12 @@ fun jsonMapper(): JsonMapper =
.setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
.setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
}
+ .withCoercionConfig(LogicalType.DateTime) {
+ it.setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
.withCoercionConfig(LogicalType.Array) {
it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
.setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
@@ -126,10 +132,10 @@ private object InputStreamSerializer : BaseSerializer(InputStream::
}
/**
- * A deserializer that can deserialize [LocalDateTime] from datetimes, dates, and zoned datetimes.
+ * A deserializer that can deserialize [OffsetDateTime] from datetimes, dates, and zoned datetimes.
*/
-private class LenientLocalDateTimeDeserializer :
- StdDeserializer(LocalDateTime::class.java) {
+private class LenientOffsetDateTimeDeserializer :
+ StdDeserializer(OffsetDateTime::class.java) {
companion object {
@@ -143,7 +149,7 @@ private class LenientLocalDateTimeDeserializer :
override fun logicalType(): LogicalType = LogicalType.DateTime
- override fun deserialize(p: JsonParser, context: DeserializationContext?): LocalDateTime {
+ override fun deserialize(p: JsonParser, context: DeserializationContext): OffsetDateTime {
val exceptions = mutableListOf()
for (formatter in DATE_TIME_FORMATTERS) {
@@ -152,44 +158,19 @@ private class LenientLocalDateTimeDeserializer :
return when {
!temporal.isSupported(ChronoField.HOUR_OF_DAY) ->
- LocalDate.from(temporal).atStartOfDay()
+ LocalDate.from(temporal)
+ .atStartOfDay()
+ .atZone(ZoneId.of("UTC"))
+ .toOffsetDateTime()
!temporal.isSupported(ChronoField.OFFSET_SECONDS) ->
- LocalDateTime.from(temporal)
- else -> ZonedDateTime.from(temporal).toLocalDateTime()
+ LocalDateTime.from(temporal).atZone(ZoneId.of("UTC")).toOffsetDateTime()
+ else -> OffsetDateTime.from(temporal)
}
} catch (e: DateTimeException) {
exceptions.add(e)
}
}
- throw JsonParseException(p, "Cannot parse `LocalDateTime` from value: ${p.text}").apply {
- exceptions.forEach { addSuppressed(it) }
- }
- }
-}
-
-/**
- * A deserializer that can deserialize [OffsetDateTime], assuming UTC when a timezone isn't given.
- */
-private class LenientOffsetDateTimeDeserializer :
- StdDeserializer(OffsetDateTime::class.java) {
- override fun logicalType(): LogicalType = LogicalType.DateTime
-
- override fun deserialize(p: JsonParser, context: DeserializationContext?): OffsetDateTime {
- val exceptions = mutableListOf()
-
- try {
- return OffsetDateTime.parse(p.text)
- } catch (e: DateTimeException) {
- exceptions.add(e)
- }
-
- try {
- return OffsetDateTime.parse(p.text + 'Z')
- } catch (e: DateTimeException) {
- exceptions.add(e)
- }
-
throw JsonParseException(p, "Cannot parse `OffsetDateTime` from value: ${p.text}").apply {
exceptions.forEach { addSuppressed(it) }
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt
index e9c964004..5d2ac94fa 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt
@@ -31,10 +31,6 @@ private constructor(
) : HttpClient {
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
- if (!isRetryable(request) || maxRetries <= 0) {
- return httpClient.execute(request, requestOptions)
- }
-
var modifiedRequest = maybeAddIdempotencyHeader(request)
// Don't send the current retry count in the headers if the caller set their own value.
@@ -48,6 +44,10 @@ private constructor(
modifiedRequest = setRetryCountHeader(modifiedRequest, retries)
}
+ if (!isRetryable(modifiedRequest)) {
+ return httpClient.execute(modifiedRequest, requestOptions)
+ }
+
val response =
try {
val response = httpClient.execute(modifiedRequest, requestOptions)
@@ -75,10 +75,6 @@ private constructor(
request: HttpRequest,
requestOptions: RequestOptions,
): CompletableFuture {
- if (!isRetryable(request) || maxRetries <= 0) {
- return httpClient.executeAsync(request, requestOptions)
- }
-
val modifiedRequest = maybeAddIdempotencyHeader(request)
// Don't send the current retry count in the headers if the caller set their own value.
@@ -94,8 +90,12 @@ private constructor(
val requestWithRetryCount =
if (shouldSendRetryCount) setRetryCountHeader(request, retries) else request
- return httpClient
- .executeAsync(requestWithRetryCount, requestOptions)
+ val responseFuture = httpClient.executeAsync(requestWithRetryCount, requestOptions)
+ if (!isRetryable(requestWithRetryCount)) {
+ return responseFuture
+ }
+
+ return responseFuture
.handleAsync(
fun(
response: HttpResponse?,
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
index 24b758684..93a1516f1 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
@@ -1732,6 +1732,7 @@ private constructor(
private val result: JsonField,
private val settledAmount: JsonField,
private val status: JsonField,
+ private val tags: JsonField,
private val tokenInfo: JsonField,
private val updated: JsonField,
private val events: JsonField>,
@@ -1802,6 +1803,9 @@ private constructor(
@JsonProperty("status")
@ExcludeMissing
status: JsonField = JsonMissing.of(),
+ @JsonProperty("tags")
+ @ExcludeMissing
+ tags: JsonField = JsonMissing.of(),
@JsonProperty("token_info")
@ExcludeMissing
tokenInfo: JsonField = JsonMissing.of(),
@@ -1836,6 +1840,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -1868,6 +1873,7 @@ private constructor(
.result(result)
.settledAmount(settledAmount)
.status(status)
+ .tags(tags)
.tokenInfo(tokenInfo)
.updated(updated)
.events(events)
@@ -2066,6 +2072,15 @@ private constructor(
*/
fun status(): Transaction.Status = status.getRequired("status")
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
+ * with a resource for your own purposes.
+ *
+ * @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 tags(): Transaction.Tags = tags.getRequired("tags")
+
/**
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -2308,6 +2323,13 @@ private constructor(
@ExcludeMissing
fun _status(): JsonField = status
+ /**
+ * Returns the raw JSON value of [tags].
+ *
+ * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags
+
/**
* Returns the raw JSON value of [tokenInfo].
*
@@ -2382,6 +2404,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* .family()
@@ -2416,6 +2439,7 @@ private constructor(
private var result: JsonField? = null
private var settledAmount: JsonField? = null
private var status: JsonField? = null
+ private var tags: JsonField? = null
private var tokenInfo: JsonField? = null
private var updated: JsonField? = null
private var events: JsonField>? = null
@@ -2447,6 +2471,7 @@ private constructor(
result = cardTransaction.result
settledAmount = cardTransaction.settledAmount
status = cardTransaction.status
+ tags = cardTransaction.tags
tokenInfo = cardTransaction.tokenInfo
updated = cardTransaction.updated
events = cardTransaction.events.map { it.toMutableList() }
@@ -2902,6 +2927,21 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
+ * with a resource for your own purposes.
+ */
+ fun tags(tags: Transaction.Tags) = tags(JsonField.of(tags))
+
+ /**
+ * Sets [Builder.tags] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tags] with a well-typed [Transaction.Tags] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun tags(tags: JsonField) = apply { this.tags = tags }
+
fun tokenInfo(tokenInfo: TokenInfo?) = tokenInfo(JsonField.ofNullable(tokenInfo))
/** Alias for calling [Builder.tokenInfo] with `tokenInfo.orElse(null)`. */
@@ -3014,6 +3054,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* .family()
@@ -3046,6 +3087,7 @@ private constructor(
checkRequired("result", result),
checkRequired("settledAmount", settledAmount),
checkRequired("status", status),
+ checkRequired("tags", tags),
checkRequired("tokenInfo", tokenInfo),
checkRequired("updated", updated),
(events ?: JsonMissing.of()).map { it.toImmutable() },
@@ -3084,6 +3126,7 @@ private constructor(
result().validate()
settledAmount()
status().validate()
+ tags().validate()
tokenInfo().ifPresent { it.validate() }
updated()
events().ifPresent { it.forEach { it.validate() } }
@@ -3130,6 +3173,7 @@ private constructor(
(result.asKnown().getOrNull()?.validity() ?: 0) +
(if (settledAmount.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
+ (tags.asKnown().getOrNull()?.validity() ?: 0) +
(tokenInfo.asKnown().getOrNull()?.validity() ?: 0) +
(if (updated.asKnown().isPresent) 1 else 0) +
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -3446,6 +3490,7 @@ private constructor(
result == other.result &&
settledAmount == other.settledAmount &&
status == other.status &&
+ tags == other.tags &&
tokenInfo == other.tokenInfo &&
updated == other.updated &&
events == other.events &&
@@ -3478,6 +3523,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -3489,6 +3535,6 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
+ "CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tags=$tags, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
}
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
index fd6f20446..8691ebef3 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
@@ -1754,6 +1754,7 @@ private constructor(
private val result: JsonField,
private val settledAmount: JsonField,
private val status: JsonField,
+ private val tags: JsonField,
private val tokenInfo: JsonField,
private val updated: JsonField,
private val events: JsonField>,
@@ -1824,6 +1825,9 @@ private constructor(
@JsonProperty("status")
@ExcludeMissing
status: JsonField = JsonMissing.of(),
+ @JsonProperty("tags")
+ @ExcludeMissing
+ tags: JsonField = JsonMissing.of(),
@JsonProperty("token_info")
@ExcludeMissing
tokenInfo: JsonField = JsonMissing.of(),
@@ -1858,6 +1862,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -1890,6 +1895,7 @@ private constructor(
.result(result)
.settledAmount(settledAmount)
.status(status)
+ .tags(tags)
.tokenInfo(tokenInfo)
.updated(updated)
.events(events)
@@ -2088,6 +2094,15 @@ private constructor(
*/
fun status(): Transaction.Status = status.getRequired("status")
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
+ * with a resource for your own purposes.
+ *
+ * @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 tags(): Transaction.Tags = tags.getRequired("tags")
+
/**
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -2330,6 +2345,13 @@ private constructor(
@ExcludeMissing
fun _status(): JsonField = status
+ /**
+ * Returns the raw JSON value of [tags].
+ *
+ * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags
+
/**
* Returns the raw JSON value of [tokenInfo].
*
@@ -2404,6 +2426,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* .family()
@@ -2438,6 +2461,7 @@ private constructor(
private var result: JsonField? = null
private var settledAmount: JsonField? = null
private var status: JsonField? = null
+ private var tags: JsonField? = null
private var tokenInfo: JsonField? = null
private var updated: JsonField? = null
private var events: JsonField>? = null
@@ -2469,6 +2493,7 @@ private constructor(
result = cardTransaction.result
settledAmount = cardTransaction.settledAmount
status = cardTransaction.status
+ tags = cardTransaction.tags
tokenInfo = cardTransaction.tokenInfo
updated = cardTransaction.updated
events = cardTransaction.events.map { it.toMutableList() }
@@ -2924,6 +2949,21 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
+ * with a resource for your own purposes.
+ */
+ fun tags(tags: Transaction.Tags) = tags(JsonField.of(tags))
+
+ /**
+ * Sets [Builder.tags] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tags] with a well-typed [Transaction.Tags] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun tags(tags: JsonField) = apply { this.tags = tags }
+
fun tokenInfo(tokenInfo: TokenInfo?) = tokenInfo(JsonField.ofNullable(tokenInfo))
/** Alias for calling [Builder.tokenInfo] with `tokenInfo.orElse(null)`. */
@@ -3036,6 +3076,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* .family()
@@ -3068,6 +3109,7 @@ private constructor(
checkRequired("result", result),
checkRequired("settledAmount", settledAmount),
checkRequired("status", status),
+ checkRequired("tags", tags),
checkRequired("tokenInfo", tokenInfo),
checkRequired("updated", updated),
(events ?: JsonMissing.of()).map { it.toImmutable() },
@@ -3106,6 +3148,7 @@ private constructor(
result().validate()
settledAmount()
status().validate()
+ tags().validate()
tokenInfo().ifPresent { it.validate() }
updated()
events().ifPresent { it.forEach { it.validate() } }
@@ -3152,6 +3195,7 @@ private constructor(
(result.asKnown().getOrNull()?.validity() ?: 0) +
(if (settledAmount.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
+ (tags.asKnown().getOrNull()?.validity() ?: 0) +
(tokenInfo.asKnown().getOrNull()?.validity() ?: 0) +
(if (updated.asKnown().isPresent) 1 else 0) +
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -3468,6 +3512,7 @@ private constructor(
result == other.result &&
settledAmount == other.settledAmount &&
status == other.status &&
+ tags == other.tags &&
tokenInfo == other.tokenInfo &&
updated == other.updated &&
events == other.events &&
@@ -3500,6 +3545,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -3511,6 +3557,6 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
+ "CardTransaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tags=$tags, tokenInfo=$tokenInfo, updated=$updated, events=$events, family=$family, additionalProperties=$additionalProperties}"
}
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
index 086c5724d..605ca9af2 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt
@@ -279,10 +279,10 @@ private constructor(
* wallet like Apple Pay or Google Pay (if the card program is digital wallet-enabled). *
* `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, credit,
* ATM, PIN debit, chip/EMV, NFC and magstripe functionality. * `SINGLE_USE` - Card is closed
- * upon first successful authorization. * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to
- * the first merchant that successfully authorizes the card. * `UNLOCKED` - *[Deprecated]*
- * Similar behavior to VIRTUAL cards, please use VIRTUAL instead. * `DIGITAL_WALLET` -
- * *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
+ * upon first successful authorization. * `MERCHANT_LOCKED` - Card is locked to the first
+ * merchant that successfully authorizes the card. * `UNLOCKED` - *[Deprecated]* Similar
+ * behavior to VIRTUAL cards, please use VIRTUAL instead. * `DIGITAL_WALLET` - *[Deprecated]*
+ * Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
*
* @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).
@@ -936,8 +936,8 @@ private constructor(
* wallet-enabled). * `PHYSICAL` - Manufactured and sent to the cardholder. We offer white
* label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. *
* `SINGLE_USE` - Card is closed upon first successful authorization. * `MERCHANT_LOCKED` -
- * *[Deprecated]* Card is locked to the first merchant that successfully authorizes the
- * card. * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
+ * Card is locked to the first merchant that successfully authorizes the card. *
+ * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead. * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please
* use VIRTUAL instead.
*/
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt
index 46e3f2d7e..7de48325a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt
@@ -103,7 +103,14 @@ private constructor(
*/
fun customerProductId(): Optional = customerProductId.getOptional("customer_product_id")
- /** Shipping address for all cards in this bulk order */
+ /**
+ * Shipping address for all cards in this bulk order
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = cardBulkOrder.shippingAddress().convert(MyClass.class);
+ * ```
+ */
@JsonProperty("shipping_address")
@ExcludeMissing
fun _shippingAddress(): JsonValue = shippingAddress
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt
index d285b23c5..98a6abe3f 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt
@@ -43,7 +43,14 @@ private constructor(
*/
fun customerProductId(): String = body.customerProductId()
- /** Shipping address for all cards in this bulk order */
+ /**
+ * Shipping address for all cards in this bulk order
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = cardBulkOrderCreateParams.shippingAddress().convert(MyClass.class);
+ * ```
+ */
fun _shippingAddress(): JsonValue = body._shippingAddress()
/**
@@ -340,7 +347,14 @@ private constructor(
*/
fun customerProductId(): String = customerProductId.getRequired("customer_product_id")
- /** Shipping address for all cards in this bulk order */
+ /**
+ * Shipping address for all cards in this bulk order
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = createBulkOrderRequest.shippingAddress().convert(MyClass.class);
+ * ```
+ */
@JsonProperty("shipping_address")
@ExcludeMissing
fun _shippingAddress(): JsonValue = shippingAddress
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt
index dfb0bfaa2..552485e71 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt
@@ -27,11 +27,14 @@ import kotlin.jvm.optionals.getOrNull
*/
class CardCreateParams
private constructor(
+ private val idempotencyKey: String?,
private val body: Body,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
) : Params {
+ fun idempotencyKey(): Optional = Optional.ofNullable(idempotencyKey)
+
/**
* Card types:
* * `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet like
@@ -40,8 +43,8 @@ private constructor(
* credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at
* [lithic.com/contact](https://lithic.com/contact) for more information.
* * `SINGLE_USE` - Card is closed upon first successful authorization.
- * * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to the first merchant that successfully
- * authorizes the card.
+ * * `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully authorizes the
+ * card.
* * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
* * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead.
@@ -437,17 +440,25 @@ private constructor(
/** A builder for [CardCreateParams]. */
class Builder internal constructor() {
+ private var idempotencyKey: String? = null
private var body: Body.Builder = Body.builder()
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@JvmSynthetic
internal fun from(cardCreateParams: CardCreateParams) = apply {
+ idempotencyKey = cardCreateParams.idempotencyKey
body = cardCreateParams.body.toBuilder()
additionalHeaders = cardCreateParams.additionalHeaders.toBuilder()
additionalQueryParams = cardCreateParams.additionalQueryParams.toBuilder()
}
+ fun idempotencyKey(idempotencyKey: String?) = apply { this.idempotencyKey = idempotencyKey }
+
+ /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */
+ fun idempotencyKey(idempotencyKey: Optional) =
+ idempotencyKey(idempotencyKey.getOrNull())
+
/**
* Sets the entire request body.
*
@@ -470,8 +481,8 @@ private constructor(
* credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at
* [lithic.com/contact](https://lithic.com/contact) for more information.
* * `SINGLE_USE` - Card is closed upon first successful authorization.
- * * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to the first merchant that
- * successfully authorizes the card.
+ * * `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully authorizes
+ * the card.
* * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead.
* * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
@@ -974,12 +985,23 @@ private constructor(
* @throws IllegalStateException if any required field is unset.
*/
fun build(): CardCreateParams =
- CardCreateParams(body.build(), additionalHeaders.build(), additionalQueryParams.build())
+ CardCreateParams(
+ idempotencyKey,
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
}
fun _body(): Body = body
- override fun _headers(): Headers = additionalHeaders
+ override fun _headers(): Headers =
+ Headers.builder()
+ .apply {
+ idempotencyKey?.let { put("Idempotency-Key", it) }
+ putAll(additionalHeaders)
+ }
+ .build()
override fun _queryParams(): QueryParams = additionalQueryParams
@@ -1091,8 +1113,8 @@ private constructor(
* credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at
* [lithic.com/contact](https://lithic.com/contact) for more information.
* * `SINGLE_USE` - Card is closed upon first successful authorization.
- * * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to the first merchant that
- * successfully authorizes the card.
+ * * `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully authorizes
+ * the card.
* * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead.
* * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
@@ -1586,8 +1608,8 @@ private constructor(
* branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach
* out at [lithic.com/contact](https://lithic.com/contact) for more information.
* * `SINGLE_USE` - Card is closed upon first successful authorization.
- * * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to the first merchant that
- * successfully authorizes the card.
+ * * `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully
+ * authorizes the card.
* * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead.
* * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use
@@ -2164,8 +2186,8 @@ private constructor(
* credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at
* [lithic.com/contact](https://lithic.com/contact) for more information.
* * `SINGLE_USE` - Card is closed upon first successful authorization.
- * * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to the first merchant that successfully
- * authorizes the card.
+ * * `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully authorizes the
+ * card.
* * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
* * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead.
@@ -2835,13 +2857,15 @@ private constructor(
}
return other is CardCreateParams &&
+ idempotencyKey == other.idempotencyKey &&
body == other.body &&
additionalHeaders == other.additionalHeaders &&
additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
+ override fun hashCode(): Int =
+ Objects.hash(idempotencyKey, body, additionalHeaders, additionalQueryParams)
override fun toString() =
- "CardCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+ "CardCreateParams{idempotencyKey=$idempotencyKey, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt
index bdbfb8a85..8382e238f 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProvisionResponse.kt
@@ -364,7 +364,7 @@ private constructor(
.toList()
return when (bestMatches.size) {
// This can happen if what we're deserializing is completely incompatible with
- // all the possible variants (e.g. deserializing from array).
+ // all the possible variants (e.g. deserializing from boolean).
0 -> ProvisioningPayload(_json = json)
1 -> bestMatches.single()
// If there's more than one match with the highest validity, then use the first
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt
index 56b57bd5d..6b7fce493 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdatedWebhookEvent.kt
@@ -47,6 +47,7 @@ private constructor(
private val result: JsonField,
private val settledAmount: JsonField,
private val status: JsonField,
+ private val tags: JsonField,
private val tokenInfo: JsonField,
private val updated: JsonField,
private val events: JsonField>,
@@ -113,6 +114,7 @@ private constructor(
@JsonProperty("status")
@ExcludeMissing
status: JsonField = JsonMissing.of(),
+ @JsonProperty("tags") @ExcludeMissing tags: JsonField = JsonMissing.of(),
@JsonProperty("token_info")
@ExcludeMissing
tokenInfo: JsonField = JsonMissing.of(),
@@ -149,6 +151,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -181,6 +184,7 @@ private constructor(
.result(result)
.settledAmount(settledAmount)
.status(status)
+ .tags(tags)
.tokenInfo(tokenInfo)
.updated(updated)
.events(events)
@@ -378,6 +382,15 @@ private constructor(
*/
fun status(): Transaction.Status = status.getRequired("status")
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata with a
+ * resource for your own purposes.
+ *
+ * @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 tags(): Transaction.Tags = tags.getRequired("tags")
+
/**
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -612,6 +625,13 @@ private constructor(
*/
@JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+ /**
+ * Returns the raw JSON value of [tags].
+ *
+ * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags
+
/**
* Returns the raw JSON value of [tokenInfo].
*
@@ -685,6 +705,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* .eventType()
@@ -719,6 +740,7 @@ private constructor(
private var result: JsonField? = null
private var settledAmount: JsonField? = null
private var status: JsonField? = null
+ private var tags: JsonField? = null
private var tokenInfo: JsonField? = null
private var updated: JsonField? = null
private var events: JsonField>? = null
@@ -753,6 +775,7 @@ private constructor(
result = cardTransactionUpdatedWebhookEvent.result
settledAmount = cardTransactionUpdatedWebhookEvent.settledAmount
status = cardTransactionUpdatedWebhookEvent.status
+ tags = cardTransactionUpdatedWebhookEvent.tags
tokenInfo = cardTransactionUpdatedWebhookEvent.tokenInfo
updated = cardTransactionUpdatedWebhookEvent.updated
events = cardTransactionUpdatedWebhookEvent.events.map { it.toMutableList() }
@@ -1196,6 +1219,21 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
+ * with a resource for your own purposes.
+ */
+ fun tags(tags: Transaction.Tags) = tags(JsonField.of(tags))
+
+ /**
+ * Sets [Builder.tags] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tags] with a well-typed [Transaction.Tags] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun tags(tags: JsonField) = apply { this.tags = tags }
+
fun tokenInfo(tokenInfo: TokenInfo?) = tokenInfo(JsonField.ofNullable(tokenInfo))
/** Alias for calling [Builder.tokenInfo] with `tokenInfo.orElse(null)`. */
@@ -1308,6 +1346,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* .eventType()
@@ -1340,6 +1379,7 @@ private constructor(
checkRequired("result", result),
checkRequired("settledAmount", settledAmount),
checkRequired("status", status),
+ checkRequired("tags", tags),
checkRequired("tokenInfo", tokenInfo),
checkRequired("updated", updated),
(events ?: JsonMissing.of()).map { it.toImmutable() },
@@ -1378,6 +1418,7 @@ private constructor(
result().validate()
settledAmount()
status().validate()
+ tags().validate()
tokenInfo().ifPresent { it.validate() }
updated()
events().ifPresent { it.forEach { it.validate() } }
@@ -1423,6 +1464,7 @@ private constructor(
(result.asKnown().getOrNull()?.validity() ?: 0) +
(if (settledAmount.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
+ (tags.asKnown().getOrNull()?.validity() ?: 0) +
(tokenInfo.asKnown().getOrNull()?.validity() ?: 0) +
(if (updated.asKnown().isPresent) 1 else 0) +
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -1579,6 +1621,7 @@ private constructor(
result == other.result &&
settledAmount == other.settledAmount &&
status == other.status &&
+ tags == other.tags &&
tokenInfo == other.tokenInfo &&
updated == other.updated &&
events == other.events &&
@@ -1611,6 +1654,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -1622,5 +1666,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CardTransactionUpdatedWebhookEvent{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, eventType=$eventType, additionalProperties=$additionalProperties}"
+ "CardTransactionUpdatedWebhookEvent{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tags=$tags, tokenInfo=$tokenInfo, updated=$updated, events=$events, eventType=$eventType, additionalProperties=$additionalProperties}"
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt
new file mode 100644
index 000000000..ee5b33230
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardUpdatedWebhookEvent.kt
@@ -0,0 +1,404 @@
+// 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.Enum
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.checkRequired
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import kotlin.jvm.optionals.getOrNull
+
+class CardUpdatedWebhookEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val cardToken: JsonField,
+ private val eventType: JsonField,
+ private val previousFields: JsonValue,
+ private val state: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(),
+ @JsonProperty("event_type")
+ @ExcludeMissing
+ eventType: JsonField = JsonMissing.of(),
+ @JsonProperty("previous_fields")
+ @ExcludeMissing
+ previousFields: JsonValue = JsonMissing.of(),
+ @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
+ ) : this(cardToken, eventType, previousFields, state, mutableMapOf())
+
+ /**
+ * The token of the card that was updated.
+ *
+ * @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 cardToken(): String = cardToken.getRequired("card_token")
+
+ /**
+ * The type of event that occurred.
+ *
+ * @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 eventType(): EventType = eventType.getRequired("event_type")
+
+ /**
+ * The previous values of the fields that were updated.
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = cardUpdatedWebhookEvent.previousFields().convert(MyClass.class);
+ * ```
+ */
+ @JsonProperty("previous_fields")
+ @ExcludeMissing
+ fun _previousFields(): JsonValue = previousFields
+
+ /**
+ * The current state of the card.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun state(): String = state.getRequired("state")
+
+ /**
+ * Returns the raw JSON value of [cardToken].
+ *
+ * Unlike [cardToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("card_token") @ExcludeMissing fun _cardToken(): JsonField = cardToken
+
+ /**
+ * Returns the raw JSON value of [eventType].
+ *
+ * Unlike [eventType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("event_type") @ExcludeMissing fun _eventType(): JsonField = eventType
+
+ /**
+ * Returns the raw JSON value of [state].
+ *
+ * Unlike [state], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state
+
+ @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 [CardUpdatedWebhookEvent].
+ *
+ * The following fields are required:
+ * ```java
+ * .cardToken()
+ * .eventType()
+ * .previousFields()
+ * .state()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CardUpdatedWebhookEvent]. */
+ class Builder internal constructor() {
+
+ private var cardToken: JsonField? = null
+ private var eventType: JsonField? = null
+ private var previousFields: JsonValue? = null
+ private var state: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(cardUpdatedWebhookEvent: CardUpdatedWebhookEvent) = apply {
+ cardToken = cardUpdatedWebhookEvent.cardToken
+ eventType = cardUpdatedWebhookEvent.eventType
+ previousFields = cardUpdatedWebhookEvent.previousFields
+ state = cardUpdatedWebhookEvent.state
+ additionalProperties = cardUpdatedWebhookEvent.additionalProperties.toMutableMap()
+ }
+
+ /** The token of the card that was updated. */
+ fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken))
+
+ /**
+ * Sets [Builder.cardToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken }
+
+ /** The type of event that occurred. */
+ fun eventType(eventType: EventType) = eventType(JsonField.of(eventType))
+
+ /**
+ * Sets [Builder.eventType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.eventType] with a well-typed [EventType] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun eventType(eventType: JsonField) = apply { this.eventType = eventType }
+
+ /** The previous values of the fields that were updated. */
+ fun previousFields(previousFields: JsonValue) = apply {
+ this.previousFields = previousFields
+ }
+
+ /** The current state of the card. */
+ fun state(state: String) = state(JsonField.of(state))
+
+ /**
+ * Sets [Builder.state] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.state] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun state(state: JsonField) = apply { this.state = state }
+
+ 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 [CardUpdatedWebhookEvent].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .cardToken()
+ * .eventType()
+ * .previousFields()
+ * .state()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CardUpdatedWebhookEvent =
+ CardUpdatedWebhookEvent(
+ checkRequired("cardToken", cardToken),
+ checkRequired("eventType", eventType),
+ checkRequired("previousFields", previousFields),
+ checkRequired("state", state),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): CardUpdatedWebhookEvent = apply {
+ if (validated) {
+ return@apply
+ }
+
+ cardToken()
+ eventType().validate()
+ state()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (cardToken.asKnown().isPresent) 1 else 0) +
+ (eventType.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (state.asKnown().isPresent) 1 else 0)
+
+ /** The type of event that occurred. */
+ class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val CARD_UPDATED = of("card.updated")
+
+ @JvmStatic fun of(value: String) = EventType(JsonField.of(value))
+ }
+
+ /** An enum containing [EventType]'s known values. */
+ enum class Known {
+ CARD_UPDATED
+ }
+
+ /**
+ * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [EventType] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ CARD_UPDATED,
+ /**
+ * An enum member indicating that [EventType] was instantiated with an unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ CARD_UPDATED -> Value.CARD_UPDATED
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CARD_UPDATED -> Known.CARD_UPDATED
+ else -> throw LithicInvalidDataException("Unknown EventType: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ fun validate(): EventType = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is EventType && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CardUpdatedWebhookEvent &&
+ cardToken == other.cardToken &&
+ eventType == other.eventType &&
+ previousFields == other.previousFields &&
+ state == other.state &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(cardToken, eventType, previousFields, state, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "CardUpdatedWebhookEvent{cardToken=$cardToken, eventType=$eventType, previousFields=$previousFields, state=$state, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt
index 687d915ae..28fece954 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionResponse.kt
@@ -20,6 +20,7 @@ import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
import com.lithic.api.core.allMaxBy
+import com.lithic.api.core.checkRequired
import com.lithic.api.core.getOrThrow
import com.lithic.api.errors.LithicInvalidDataException
import java.util.Collections
@@ -256,18 +257,18 @@ private constructor(
/**
* JWS object required for handoff to Apple's script.
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
+ * @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 jws(): Optional = jws.getOptional("jws")
+ fun jws(): WebPushProvisioningResponseJws = jws.getRequired("jws")
/**
* A unique identifier for the JWS object.
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
+ * @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 state(): Optional = state.getOptional("state")
+ fun state(): String = state.getRequired("state")
/**
* Returns the raw JSON value of [jws].
@@ -302,6 +303,12 @@ private constructor(
/**
* Returns a mutable builder for constructing an instance of
* [AppleWebPushProvisioningResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .jws()
+ * .state()
+ * ```
*/
@JvmStatic fun builder() = Builder()
}
@@ -309,8 +316,8 @@ private constructor(
/** A builder for [AppleWebPushProvisioningResponse]. */
class Builder internal constructor() {
- private var jws: JsonField = JsonMissing.of()
- private var state: JsonField = JsonMissing.of()
+ private var jws: JsonField? = null
+ private var state: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -369,9 +376,21 @@ private constructor(
* Returns an immutable instance of [AppleWebPushProvisioningResponse].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .jws()
+ * .state()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
fun build(): AppleWebPushProvisioningResponse =
- AppleWebPushProvisioningResponse(jws, state, additionalProperties.toMutableMap())
+ AppleWebPushProvisioningResponse(
+ checkRequired("jws", jws),
+ checkRequired("state", state),
+ additionalProperties.toMutableMap(),
+ )
}
private var validated: Boolean = false
@@ -381,7 +400,7 @@ private constructor(
return@apply
}
- jws().ifPresent { it.validate() }
+ jws().validate()
state()
validated = true
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt
index 228c85045..dcaacaad2 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalValue.kt
@@ -219,35 +219,25 @@ private constructor(
val bestMatches =
sequenceOf(
- if (node.isNumber) {
- tryDeserialize(node, jacksonTypeRef())?.let {
- ConditionalValue(number = it, _json = json)
- }
- } else null,
- if (node.isArray) {
- tryDeserialize(node, jacksonTypeRef>())?.let {
- ConditionalValue(listOfStrings = it, _json = json)
- }
- } else null,
- // Try timestamp before generic string, since timestamps serialize as
- // strings
- if (node.isTextual) {
- tryDeserialize(node, jacksonTypeRef())?.let {
- ConditionalValue(timestamp = it, _json = json)
- }
- } else null,
- if (node.isTextual) {
- tryDeserialize(node, jacksonTypeRef())?.let {
- ConditionalValue(regex = it, _json = json)
- }
- } else null,
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ ConditionalValue(timestamp = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ ConditionalValue(regex = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ ConditionalValue(number = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef>())?.let {
+ ConditionalValue(listOfStrings = it, _json = json)
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
.toList()
return when (bestMatches.size) {
// This can happen if what we're deserializing is completely incompatible with all
- // the possible variants (e.g. deserializing from object).
+ // the possible variants (e.g. deserializing from boolean).
0 -> ConditionalValue(_json = json)
1 -> bestMatches.single()
// If there's more than one match with the highest validity, then use the first
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt
index 25fd19a25..59395bc22 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt
@@ -82,6 +82,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval request
* is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -280,6 +281,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval
* request is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -467,6 +469,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval request
* is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -584,6 +587,8 @@ private constructor(
@JvmField val CARD_SHIPPED = of("card.shipped")
+ @JvmField val CARD_UPDATED = of("card.updated")
+
@JvmField
val DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
of("digital_wallet.tokenization_approval_request")
@@ -690,6 +695,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -754,6 +760,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -823,6 +830,7 @@ private constructor(
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
+ CARD_UPDATED -> Value.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Value.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Value.DIGITAL_WALLET_TOKENIZATION_RESULT
@@ -896,6 +904,7 @@ private constructor(
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
+ CARD_UPDATED -> Known.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Known.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Known.DIGITAL_WALLET_TOKENIZATION_RESULT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt
index befbe9779..cd560478b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt
@@ -340,6 +340,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval request
* is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -457,6 +458,8 @@ private constructor(
@JvmField val CARD_SHIPPED = of("card.shipped")
+ @JvmField val CARD_UPDATED = of("card.updated")
+
@JvmField
val DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
of("digital_wallet.tokenization_approval_request")
@@ -563,6 +566,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -627,6 +631,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -696,6 +701,7 @@ private constructor(
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
+ CARD_UPDATED -> Value.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Value.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Value.DIGITAL_WALLET_TOKENIZATION_RESULT
@@ -769,6 +775,7 @@ private constructor(
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
+ CARD_UPDATED -> Known.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Known.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Known.DIGITAL_WALLET_TOKENIZATION_RESULT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt
index 15bf5914e..dac8945df 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt
@@ -342,6 +342,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval request
* is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -459,6 +460,8 @@ private constructor(
@JvmField val CARD_SHIPPED = of("card.shipped")
+ @JvmField val CARD_UPDATED = of("card.updated")
+
@JvmField
val DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
of("digital_wallet.tokenization_approval_request")
@@ -565,6 +568,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -629,6 +633,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -698,6 +703,7 @@ private constructor(
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
+ CARD_UPDATED -> Value.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Value.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Value.DIGITAL_WALLET_TOKENIZATION_RESULT
@@ -771,6 +777,7 @@ private constructor(
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
+ CARD_UPDATED -> Known.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Known.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Known.DIGITAL_WALLET_TOKENIZATION_RESULT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt
index 9f7a4530d..fb8b9362a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt
@@ -664,6 +664,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval request
* is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -781,6 +782,8 @@ private constructor(
@JvmField val CARD_SHIPPED = of("card.shipped")
+ @JvmField val CARD_UPDATED = of("card.updated")
+
@JvmField
val DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
of("digital_wallet.tokenization_approval_request")
@@ -887,6 +890,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -951,6 +955,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -1020,6 +1025,7 @@ private constructor(
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
+ CARD_UPDATED -> Value.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Value.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Value.DIGITAL_WALLET_TOKENIZATION_RESULT
@@ -1093,6 +1099,7 @@ private constructor(
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
+ CARD_UPDATED -> Known.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Known.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Known.DIGITAL_WALLET_TOKENIZATION_RESULT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt
index 77147dd4a..7781df703 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt
@@ -463,6 +463,8 @@ private constructor(
@JvmField val CARD_SHIPPED = of("card.shipped")
+ @JvmField val CARD_UPDATED = of("card.updated")
+
@JvmField
val DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
of("digital_wallet.tokenization_approval_request")
@@ -569,6 +571,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -633,6 +636,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -702,6 +706,7 @@ private constructor(
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
+ CARD_UPDATED -> Value.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Value.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Value.DIGITAL_WALLET_TOKENIZATION_RESULT
@@ -775,6 +780,7 @@ private constructor(
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
+ CARD_UPDATED -> Known.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Known.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Known.DIGITAL_WALLET_TOKENIZATION_RESULT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt
index 0b45c8ae7..d7b19ebf0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt
@@ -687,6 +687,7 @@ private constructor(
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
+ * - card.updated: Occurs when a card is updated.
* - digital_wallet.tokenization_approval_request: Occurs when a tokenization approval request
* is made. This event will be deprecated in the future. We recommend using
* `tokenization.approval_request` instead.
@@ -804,6 +805,8 @@ private constructor(
@JvmField val CARD_SHIPPED = of("card.shipped")
+ @JvmField val CARD_UPDATED = of("card.updated")
+
@JvmField
val DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
of("digital_wallet.tokenization_approval_request")
@@ -910,6 +913,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -974,6 +978,7 @@ private constructor(
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
+ CARD_UPDATED,
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST,
DIGITAL_WALLET_TOKENIZATION_RESULT,
DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE,
@@ -1043,6 +1048,7 @@ private constructor(
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
+ CARD_UPDATED -> Value.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Value.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Value.DIGITAL_WALLET_TOKENIZATION_RESULT
@@ -1116,6 +1122,7 @@ private constructor(
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
+ CARD_UPDATED -> Known.CARD_UPDATED
DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST ->
Known.DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST
DIGITAL_WALLET_TOKENIZATION_RESULT -> Known.DIGITAL_WALLET_TOKENIZATION_RESULT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt
index d82a2df00..36cb09116 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt
@@ -132,8 +132,9 @@ private constructor(
/**
* Pending amount of the transaction in the currency's smallest unit (e.g., cents), including
- * any acquirer fees. The value of this field will go to zero over time once the financial
- * transaction is settled.
+ * any acquirer fees.
+ *
+ * The value of this field will go to zero over time once the financial transaction is settled.
*
* @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).
@@ -423,8 +424,10 @@ private constructor(
/**
* Pending amount of the transaction in the currency's smallest unit (e.g., cents),
- * including any acquirer fees. The value of this field will go to zero over time once the
- * financial transaction is settled.
+ * including any acquirer fees.
+ *
+ * The value of this field will go to zero over time once the financial transaction is
+ * settled.
*/
fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount))
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt
index c9a3056f7..b736b2c5a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/NonPciCard.kt
@@ -243,10 +243,10 @@ private constructor(
* wallet like Apple Pay or Google Pay (if the card program is digital wallet-enabled). *
* `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, credit,
* ATM, PIN debit, chip/EMV, NFC and magstripe functionality. * `SINGLE_USE` - Card is closed
- * upon first successful authorization. * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to
- * the first merchant that successfully authorizes the card. * `UNLOCKED` - *[Deprecated]*
- * Similar behavior to VIRTUAL cards, please use VIRTUAL instead. * `DIGITAL_WALLET` -
- * *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
+ * upon first successful authorization. * `MERCHANT_LOCKED` - Card is locked to the first
+ * merchant that successfully authorizes the card. * `UNLOCKED` - *[Deprecated]* Similar
+ * behavior to VIRTUAL cards, please use VIRTUAL instead. * `DIGITAL_WALLET` - *[Deprecated]*
+ * Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
*
* @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).
@@ -854,8 +854,8 @@ private constructor(
* wallet-enabled). * `PHYSICAL` - Manufactured and sent to the cardholder. We offer white
* label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. *
* `SINGLE_USE` - Card is closed upon first successful authorization. * `MERCHANT_LOCKED` -
- * *[Deprecated]* Card is locked to the first merchant that successfully authorizes the
- * card. * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
+ * Card is locked to the first merchant that successfully authorizes the card. *
+ * `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL
* instead. * `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please
* use VIRTUAL instead.
*/
@@ -2279,10 +2279,10 @@ private constructor(
* wallet like Apple Pay or Google Pay (if the card program is digital wallet-enabled). *
* `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, credit,
* ATM, PIN debit, chip/EMV, NFC and magstripe functionality. * `SINGLE_USE` - Card is closed
- * upon first successful authorization. * `MERCHANT_LOCKED` - *[Deprecated]* Card is locked to
- * the first merchant that successfully authorizes the card. * `UNLOCKED` - *[Deprecated]*
- * Similar behavior to VIRTUAL cards, please use VIRTUAL instead. * `DIGITAL_WALLET` -
- * *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
+ * upon first successful authorization. * `MERCHANT_LOCKED` - Card is locked to the first
+ * merchant that successfully authorizes the card. * `UNLOCKED` - *[Deprecated]* Similar
+ * behavior to VIRTUAL cards, please use VIRTUAL instead. * `DIGITAL_WALLET` - *[Deprecated]*
+ * Similar behavior to VIRTUAL cards, please use VIRTUAL instead.
*/
class Type @JsonCreator private constructor(private val value: JsonField) : Enum {
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt
index ef5b9831d..9444b8ad1 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt
@@ -55,6 +55,7 @@ private constructor(
private val cardRenewed: CardRenewedWebhookEvent? = null,
private val cardReissued: CardReissuedWebhookEvent? = null,
private val cardShipped: CardShippedWebhookEvent? = null,
+ private val cardUpdated: CardUpdatedWebhookEvent? = null,
private val cardTransactionUpdated: CardTransactionUpdatedWebhookEvent? = null,
private val cardTransactionEnhancedDataCreated:
CardTransactionEnhancedDataCreatedWebhookEvent? =
@@ -164,6 +165,8 @@ private constructor(
fun cardShipped(): Optional = Optional.ofNullable(cardShipped)
+ fun cardUpdated(): Optional = Optional.ofNullable(cardUpdated)
+
fun cardTransactionUpdated(): Optional =
Optional.ofNullable(cardTransactionUpdated)
@@ -334,6 +337,8 @@ private constructor(
fun isCardShipped(): Boolean = cardShipped != null
+ fun isCardUpdated(): Boolean = cardUpdated != null
+
fun isCardTransactionUpdated(): Boolean = cardTransactionUpdated != null
fun isCardTransactionEnhancedDataCreated(): Boolean = cardTransactionEnhancedDataCreated != null
@@ -468,6 +473,8 @@ private constructor(
fun asCardShipped(): CardShippedWebhookEvent = cardShipped.getOrThrow("cardShipped")
+ fun asCardUpdated(): CardUpdatedWebhookEvent = cardUpdated.getOrThrow("cardUpdated")
+
fun asCardTransactionUpdated(): CardTransactionUpdatedWebhookEvent =
cardTransactionUpdated.getOrThrow("cardTransactionUpdated")
@@ -639,6 +646,7 @@ private constructor(
cardRenewed != null -> visitor.visitCardRenewed(cardRenewed)
cardReissued != null -> visitor.visitCardReissued(cardReissued)
cardShipped != null -> visitor.visitCardShipped(cardShipped)
+ cardUpdated != null -> visitor.visitCardUpdated(cardUpdated)
cardTransactionUpdated != null ->
visitor.visitCardTransactionUpdated(cardTransactionUpdated)
cardTransactionEnhancedDataCreated != null ->
@@ -818,6 +826,10 @@ private constructor(
cardShipped.validate()
}
+ override fun visitCardUpdated(cardUpdated: CardUpdatedWebhookEvent) {
+ cardUpdated.validate()
+ }
+
override fun visitCardTransactionUpdated(
cardTransactionUpdated: CardTransactionUpdatedWebhookEvent
) {
@@ -1138,6 +1150,9 @@ private constructor(
override fun visitCardShipped(cardShipped: CardShippedWebhookEvent) =
cardShipped.validity()
+ override fun visitCardUpdated(cardUpdated: CardUpdatedWebhookEvent) =
+ cardUpdated.validity()
+
override fun visitCardTransactionUpdated(
cardTransactionUpdated: CardTransactionUpdatedWebhookEvent
) = cardTransactionUpdated.validity()
@@ -1330,6 +1345,7 @@ private constructor(
cardRenewed == other.cardRenewed &&
cardReissued == other.cardReissued &&
cardShipped == other.cardShipped &&
+ cardUpdated == other.cardUpdated &&
cardTransactionUpdated == other.cardTransactionUpdated &&
cardTransactionEnhancedDataCreated == other.cardTransactionEnhancedDataCreated &&
cardTransactionEnhancedDataUpdated == other.cardTransactionEnhancedDataUpdated &&
@@ -1396,6 +1412,7 @@ private constructor(
cardRenewed,
cardReissued,
cardShipped,
+ cardUpdated,
cardTransactionUpdated,
cardTransactionEnhancedDataCreated,
cardTransactionEnhancedDataUpdated,
@@ -1465,6 +1482,7 @@ private constructor(
cardRenewed != null -> "ParsedWebhookEvent{cardRenewed=$cardRenewed}"
cardReissued != null -> "ParsedWebhookEvent{cardReissued=$cardReissued}"
cardShipped != null -> "ParsedWebhookEvent{cardShipped=$cardShipped}"
+ cardUpdated != null -> "ParsedWebhookEvent{cardUpdated=$cardUpdated}"
cardTransactionUpdated != null ->
"ParsedWebhookEvent{cardTransactionUpdated=$cardTransactionUpdated}"
cardTransactionEnhancedDataCreated != null ->
@@ -1626,6 +1644,10 @@ private constructor(
fun ofCardShipped(cardShipped: CardShippedWebhookEvent) =
ParsedWebhookEvent(cardShipped = cardShipped)
+ @JvmStatic
+ fun ofCardUpdated(cardUpdated: CardUpdatedWebhookEvent) =
+ ParsedWebhookEvent(cardUpdated = cardUpdated)
+
@JvmStatic
fun ofCardTransactionUpdated(cardTransactionUpdated: CardTransactionUpdatedWebhookEvent) =
ParsedWebhookEvent(cardTransactionUpdated = cardTransactionUpdated)
@@ -1916,6 +1938,8 @@ private constructor(
fun visitCardShipped(cardShipped: CardShippedWebhookEvent): T
+ fun visitCardUpdated(cardUpdated: CardUpdatedWebhookEvent): T
+
fun visitCardTransactionUpdated(
cardTransactionUpdated: CardTransactionUpdatedWebhookEvent
): T
@@ -2187,6 +2211,9 @@ private constructor(
tryDeserialize(node, jacksonTypeRef())?.let {
ParsedWebhookEvent(cardShipped = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ ParsedWebhookEvent(cardUpdated = it, _json = json)
+ },
tryDeserialize(node, jacksonTypeRef())
?.let { ParsedWebhookEvent(cardTransactionUpdated = it, _json = json) },
tryDeserialize(
@@ -2494,6 +2521,7 @@ private constructor(
value.cardRenewed != null -> generator.writeObject(value.cardRenewed)
value.cardReissued != null -> generator.writeObject(value.cardReissued)
value.cardShipped != null -> generator.writeObject(value.cardShipped)
+ value.cardUpdated != null -> generator.writeObject(value.cardUpdated)
value.cardTransactionUpdated != null ->
generator.writeObject(value.cardTransactionUpdated)
value.cardTransactionEnhancedDataCreated != null ->
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt
index 5927991a5..f10797765 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt
@@ -4769,7 +4769,7 @@ private constructor(
@JvmField val WIRE_OUTBOUND_ADMIN = of("WIRE_OUTBOUND_ADMIN")
- @JvmField val WIRE_DRAWDOWN_REQUEST = of("WIRE_DRAWDOWN_REQUEST")
+ @JvmField val WIRE_INBOUND_DRAWDOWN_REQUEST = of("WIRE_INBOUND_DRAWDOWN_REQUEST")
@JvmStatic fun of(value: String) = TransferType(JsonField.of(value))
}
@@ -4784,7 +4784,7 @@ private constructor(
WIRE_INBOUND_ADMIN,
WIRE_OUTBOUND_PAYMENT,
WIRE_OUTBOUND_ADMIN,
- WIRE_DRAWDOWN_REQUEST,
+ WIRE_INBOUND_DRAWDOWN_REQUEST,
}
/**
@@ -4805,7 +4805,7 @@ private constructor(
WIRE_INBOUND_ADMIN,
WIRE_OUTBOUND_PAYMENT,
WIRE_OUTBOUND_ADMIN,
- WIRE_DRAWDOWN_REQUEST,
+ WIRE_INBOUND_DRAWDOWN_REQUEST,
/**
* An enum member indicating that [TransferType] was instantiated with an unknown value.
*/
@@ -4829,7 +4829,7 @@ private constructor(
WIRE_INBOUND_ADMIN -> Value.WIRE_INBOUND_ADMIN
WIRE_OUTBOUND_PAYMENT -> Value.WIRE_OUTBOUND_PAYMENT
WIRE_OUTBOUND_ADMIN -> Value.WIRE_OUTBOUND_ADMIN
- WIRE_DRAWDOWN_REQUEST -> Value.WIRE_DRAWDOWN_REQUEST
+ WIRE_INBOUND_DRAWDOWN_REQUEST -> Value.WIRE_INBOUND_DRAWDOWN_REQUEST
else -> Value._UNKNOWN
}
@@ -4852,7 +4852,7 @@ private constructor(
WIRE_INBOUND_ADMIN -> Known.WIRE_INBOUND_ADMIN
WIRE_OUTBOUND_PAYMENT -> Known.WIRE_OUTBOUND_PAYMENT
WIRE_OUTBOUND_ADMIN -> Known.WIRE_OUTBOUND_ADMIN
- WIRE_DRAWDOWN_REQUEST -> Known.WIRE_DRAWDOWN_REQUEST
+ WIRE_INBOUND_DRAWDOWN_REQUEST -> Known.WIRE_INBOUND_DRAWDOWN_REQUEST
else -> throw LithicInvalidDataException("Unknown TransferType: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt
index 5c7703b56..1769e7802 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt
@@ -1097,7 +1097,7 @@ private constructor(
@JsonProperty("sec_code")
@ExcludeMissing
secCode: JsonField = JsonMissing.of(),
- @JsonProperty("ach_hold__period")
+ @JsonProperty("ach_hold_period")
@ExcludeMissing
achHoldPeriod: JsonField = JsonMissing.of(),
@JsonProperty("addenda") @ExcludeMissing addenda: JsonField = JsonMissing.of(),
@@ -1115,7 +1115,7 @@ private constructor(
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun achHoldPeriod(): Optional = achHoldPeriod.getOptional("ach_hold__period")
+ fun achHoldPeriod(): Optional = achHoldPeriod.getOptional("ach_hold_period")
/**
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -1136,7 +1136,7 @@ private constructor(
* Unlike [achHoldPeriod], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("ach_hold__period")
+ @JsonProperty("ach_hold_period")
@ExcludeMissing
fun _achHoldPeriod(): JsonField = achHoldPeriod
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt
index cbabdf772..5316d13ce 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementTotals.kt
@@ -130,13 +130,34 @@ private constructor(
*/
fun purchases(): Long = purchases.getRequired("purchases")
- /** Breakdown of credits */
+ /**
+ * Breakdown of credits
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = statementTotals.creditDetails().convert(MyClass.class);
+ * ```
+ */
@JsonProperty("credit_details") @ExcludeMissing fun _creditDetails(): JsonValue = creditDetails
- /** Breakdown of debits */
+ /**
+ * Breakdown of debits
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = statementTotals.debitDetails().convert(MyClass.class);
+ * ```
+ */
@JsonProperty("debit_details") @ExcludeMissing fun _debitDetails(): JsonValue = debitDetails
- /** Breakdown of payments */
+ /**
+ * Breakdown of payments
+ *
+ * This arbitrary value can be deserialized into a custom type using the `convert` method:
+ * ```java
+ * MyClass myObject = statementTotals.paymentDetails().convert(MyClass.class);
+ * ```
+ */
@JsonProperty("payment_details")
@ExcludeMissing
fun _paymentDetails(): JsonValue = paymentDetails
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt
index ca86c905e..1ccc1b31e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt
@@ -47,6 +47,7 @@ private constructor(
private val result: JsonField,
private val settledAmount: JsonField,
private val status: JsonField,
+ private val tags: JsonField,
private val tokenInfo: JsonField,
private val updated: JsonField,
private val events: JsonField>,
@@ -106,6 +107,7 @@ private constructor(
@ExcludeMissing
settledAmount: JsonField = JsonMissing.of(),
@JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("tags") @ExcludeMissing tags: JsonField = JsonMissing.of(),
@JsonProperty("token_info")
@ExcludeMissing
tokenInfo: JsonField = JsonMissing.of(),
@@ -139,6 +141,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -337,6 +340,15 @@ private constructor(
*/
fun status(): Status = status.getRequired("status")
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata with a
+ * resource for your own purposes.
+ *
+ * @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 tags(): Tags = tags.getRequired("tags")
+
/**
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -557,6 +569,13 @@ private constructor(
*/
@JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+ /**
+ * Returns the raw JSON value of [tags].
+ *
+ * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags
+
/**
* Returns the raw JSON value of [tokenInfo].
*
@@ -622,6 +641,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* ```
@@ -655,6 +675,7 @@ private constructor(
private var result: JsonField? = null
private var settledAmount: JsonField? = null
private var status: JsonField? = null
+ private var tags: JsonField? = null
private var tokenInfo: JsonField? = null
private var updated: JsonField? = null
private var events: JsonField>? = null
@@ -685,6 +706,7 @@ private constructor(
result = transaction.result
settledAmount = transaction.settledAmount
status = transaction.status
+ tags = transaction.tags
tokenInfo = transaction.tokenInfo
updated = transaction.updated
events = transaction.events.map { it.toMutableList() }
@@ -1120,6 +1142,20 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata
+ * with a resource for your own purposes.
+ */
+ fun tags(tags: Tags) = tags(JsonField.of(tags))
+
+ /**
+ * Sets [Builder.tags] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tags] with a well-typed [Tags] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun tags(tags: JsonField) = apply { this.tags = tags }
+
fun tokenInfo(tokenInfo: TokenInfo?) = tokenInfo(JsonField.ofNullable(tokenInfo))
/** Alias for calling [Builder.tokenInfo] with `tokenInfo.orElse(null)`. */
@@ -1220,6 +1256,7 @@ private constructor(
* .result()
* .settledAmount()
* .status()
+ * .tags()
* .tokenInfo()
* .updated()
* ```
@@ -1251,6 +1288,7 @@ private constructor(
checkRequired("result", result),
checkRequired("settledAmount", settledAmount),
checkRequired("status", status),
+ checkRequired("tags", tags),
checkRequired("tokenInfo", tokenInfo),
checkRequired("updated", updated),
(events ?: JsonMissing.of()).map { it.toImmutable() },
@@ -1288,6 +1326,7 @@ private constructor(
result().validate()
settledAmount()
status().validate()
+ tags().validate()
tokenInfo().ifPresent { it.validate() }
updated()
events().ifPresent { it.forEach { it.validate() } }
@@ -1332,6 +1371,7 @@ private constructor(
(result.asKnown().getOrNull()?.validity() ?: 0) +
(if (settledAmount.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
+ (tags.asKnown().getOrNull()?.validity() ?: 0) +
(tokenInfo.asKnown().getOrNull()?.validity() ?: 0) +
(if (updated.asKnown().isPresent) 1 else 0) +
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
@@ -5361,6 +5401,109 @@ private constructor(
override fun toString() = value.toString()
}
+ /**
+ * Key-value pairs for tagging resources. Tags allow you to associate arbitrary metadata with a
+ * resource for your own purposes.
+ */
+ class Tags
+ @JsonCreator
+ private constructor(
+ @com.fasterxml.jackson.annotation.JsonValue
+ private val additionalProperties: Map
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [Tags]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Tags]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(tags: Tags) = apply {
+ additionalProperties = tags.additionalProperties.toMutableMap()
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Tags].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Tags = Tags(additionalProperties.toImmutable())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Tags = apply {
+ if (validated) {
+ return@apply
+ }
+
+ 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 =
+ additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Tags && additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "Tags{additionalProperties=$additionalProperties}"
+ }
+
class TransactionEvent
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -11572,6 +11715,7 @@ private constructor(
result == other.result &&
settledAmount == other.settledAmount &&
status == other.status &&
+ tags == other.tags &&
tokenInfo == other.tokenInfo &&
updated == other.updated &&
events == other.events &&
@@ -11603,6 +11747,7 @@ private constructor(
result,
settledAmount,
status,
+ tags,
tokenInfo,
updated,
events,
@@ -11613,5 +11758,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Transaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, additionalProperties=$additionalProperties}"
+ "Transaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, financialAccountToken=$financialAccountToken, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tags=$tags, tokenInfo=$tokenInfo, updated=$updated, events=$events, additionalProperties=$additionalProperties}"
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt
index ab4e92d01..99ffddc82 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationParams.kt
@@ -73,6 +73,22 @@ private constructor(
*/
fun mcc(): Optional = body.mcc()
+ /**
+ * Merchant acceptor city
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCity(): Optional = body.merchantAcceptorCity()
+
+ /**
+ * Merchant acceptor country code (ISO 3166-1 alpha-3)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCountry(): Optional = body.merchantAcceptorCountry()
+
/**
* Unique identifier to identify the payment card acceptor.
*
@@ -81,6 +97,14 @@ private constructor(
*/
fun merchantAcceptorId(): Optional = body.merchantAcceptorId()
+ /**
+ * Merchant acceptor state/province (ISO 3166-2 subdivision code)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorState(): Optional = body.merchantAcceptorState()
+
/**
* Amount of the transaction to be simulated in currency specified in merchant_currency,
* including any acquirer fees.
@@ -163,6 +187,22 @@ private constructor(
*/
fun _mcc(): JsonField = body._mcc()
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCity].
+ *
+ * Unlike [merchantAcceptorCity], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _merchantAcceptorCity(): JsonField = body._merchantAcceptorCity()
+
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCountry].
+ *
+ * Unlike [merchantAcceptorCountry], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ fun _merchantAcceptorCountry(): JsonField = body._merchantAcceptorCountry()
+
/**
* Returns the raw JSON value of [merchantAcceptorId].
*
@@ -171,6 +211,14 @@ private constructor(
*/
fun _merchantAcceptorId(): JsonField = body._merchantAcceptorId()
+ /**
+ * Returns the raw JSON value of [merchantAcceptorState].
+ *
+ * Unlike [merchantAcceptorState], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _merchantAcceptorState(): JsonField = body._merchantAcceptorState()
+
/**
* Returns the raw JSON value of [merchantAmount].
*
@@ -260,7 +308,7 @@ private constructor(
* - [descriptor]
* - [pan]
* - [mcc]
- * - [merchantAcceptorId]
+ * - [merchantAcceptorCity]
* - etc.
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
@@ -319,6 +367,38 @@ private constructor(
*/
fun mcc(mcc: JsonField) = apply { body.mcc(mcc) }
+ /** Merchant acceptor city */
+ fun merchantAcceptorCity(merchantAcceptorCity: String) = apply {
+ body.merchantAcceptorCity(merchantAcceptorCity)
+ }
+
+ /**
+ * Sets [Builder.merchantAcceptorCity] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorCity] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantAcceptorCity(merchantAcceptorCity: JsonField) = apply {
+ body.merchantAcceptorCity(merchantAcceptorCity)
+ }
+
+ /** Merchant acceptor country code (ISO 3166-1 alpha-3) */
+ fun merchantAcceptorCountry(merchantAcceptorCountry: String) = apply {
+ body.merchantAcceptorCountry(merchantAcceptorCountry)
+ }
+
+ /**
+ * Sets [Builder.merchantAcceptorCountry] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorCountry] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun merchantAcceptorCountry(merchantAcceptorCountry: JsonField) = apply {
+ body.merchantAcceptorCountry(merchantAcceptorCountry)
+ }
+
/** Unique identifier to identify the payment card acceptor. */
fun merchantAcceptorId(merchantAcceptorId: String) = apply {
body.merchantAcceptorId(merchantAcceptorId)
@@ -335,6 +415,22 @@ private constructor(
body.merchantAcceptorId(merchantAcceptorId)
}
+ /** Merchant acceptor state/province (ISO 3166-2 subdivision code) */
+ fun merchantAcceptorState(merchantAcceptorState: String) = apply {
+ body.merchantAcceptorState(merchantAcceptorState)
+ }
+
+ /**
+ * Sets [Builder.merchantAcceptorState] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorState] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantAcceptorState(merchantAcceptorState: JsonField) = apply {
+ body.merchantAcceptorState(merchantAcceptorState)
+ }
+
/**
* Amount of the transaction to be simulated in currency specified in merchant_currency,
* including any acquirer fees.
@@ -578,7 +674,10 @@ private constructor(
private val descriptor: JsonField,
private val pan: JsonField,
private val mcc: JsonField,
+ private val merchantAcceptorCity: JsonField,
+ private val merchantAcceptorCountry: JsonField,
private val merchantAcceptorId: JsonField,
+ private val merchantAcceptorState: JsonField,
private val merchantAmount: JsonField,
private val merchantCurrency: JsonField,
private val partialApprovalCapable: JsonField,
@@ -595,9 +694,18 @@ private constructor(
descriptor: JsonField = JsonMissing.of(),
@JsonProperty("pan") @ExcludeMissing pan: JsonField = JsonMissing.of(),
@JsonProperty("mcc") @ExcludeMissing mcc: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_acceptor_city")
+ @ExcludeMissing
+ merchantAcceptorCity: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_acceptor_country")
+ @ExcludeMissing
+ merchantAcceptorCountry: JsonField = JsonMissing.of(),
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
merchantAcceptorId: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_acceptor_state")
+ @ExcludeMissing
+ merchantAcceptorState: JsonField = JsonMissing.of(),
@JsonProperty("merchant_amount")
@ExcludeMissing
merchantAmount: JsonField = JsonMissing.of(),
@@ -614,7 +722,10 @@ private constructor(
descriptor,
pan,
mcc,
+ merchantAcceptorCity,
+ merchantAcceptorCountry,
merchantAcceptorId,
+ merchantAcceptorState,
merchantAmount,
merchantCurrency,
partialApprovalCapable,
@@ -660,6 +771,24 @@ private constructor(
*/
fun mcc(): Optional = mcc.getOptional("mcc")
+ /**
+ * Merchant acceptor city
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCity(): Optional =
+ merchantAcceptorCity.getOptional("merchant_acceptor_city")
+
+ /**
+ * Merchant acceptor country code (ISO 3166-1 alpha-3)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCountry(): Optional =
+ merchantAcceptorCountry.getOptional("merchant_acceptor_country")
+
/**
* Unique identifier to identify the payment card acceptor.
*
@@ -669,6 +798,15 @@ private constructor(
fun merchantAcceptorId(): Optional =
merchantAcceptorId.getOptional("merchant_acceptor_id")
+ /**
+ * Merchant acceptor state/province (ISO 3166-2 subdivision code)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorState(): Optional =
+ merchantAcceptorState.getOptional("merchant_acceptor_state")
+
/**
* Amount of the transaction to be simulated in currency specified in merchant_currency,
* including any acquirer fees.
@@ -755,6 +893,26 @@ private constructor(
*/
@JsonProperty("mcc") @ExcludeMissing fun _mcc(): JsonField = mcc
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCity].
+ *
+ * Unlike [merchantAcceptorCity], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_city")
+ @ExcludeMissing
+ fun _merchantAcceptorCity(): JsonField = merchantAcceptorCity
+
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCountry].
+ *
+ * Unlike [merchantAcceptorCountry], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_country")
+ @ExcludeMissing
+ fun _merchantAcceptorCountry(): JsonField = merchantAcceptorCountry
+
/**
* Returns the raw JSON value of [merchantAcceptorId].
*
@@ -765,6 +923,16 @@ private constructor(
@ExcludeMissing
fun _merchantAcceptorId(): JsonField = merchantAcceptorId
+ /**
+ * Returns the raw JSON value of [merchantAcceptorState].
+ *
+ * Unlike [merchantAcceptorState], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_state")
+ @ExcludeMissing
+ fun _merchantAcceptorState(): JsonField = merchantAcceptorState
+
/**
* Returns the raw JSON value of [merchantAmount].
*
@@ -843,7 +1011,10 @@ private constructor(
private var descriptor: JsonField? = null
private var pan: JsonField? = null
private var mcc: JsonField = JsonMissing.of()
+ private var merchantAcceptorCity: JsonField = JsonMissing.of()
+ private var merchantAcceptorCountry: JsonField = JsonMissing.of()
private var merchantAcceptorId: JsonField = JsonMissing.of()
+ private var merchantAcceptorState: JsonField = JsonMissing.of()
private var merchantAmount: JsonField = JsonMissing.of()
private var merchantCurrency: JsonField = JsonMissing.of()
private var partialApprovalCapable: JsonField = JsonMissing.of()
@@ -857,7 +1028,10 @@ private constructor(
descriptor = body.descriptor
pan = body.pan
mcc = body.mcc
+ merchantAcceptorCity = body.merchantAcceptorCity
+ merchantAcceptorCountry = body.merchantAcceptorCountry
merchantAcceptorId = body.merchantAcceptorId
+ merchantAcceptorState = body.merchantAcceptorState
merchantAmount = body.merchantAmount
merchantCurrency = body.merchantCurrency
partialApprovalCapable = body.partialApprovalCapable
@@ -923,6 +1097,36 @@ private constructor(
*/
fun mcc(mcc: JsonField) = apply { this.mcc = mcc }
+ /** Merchant acceptor city */
+ fun merchantAcceptorCity(merchantAcceptorCity: String) =
+ merchantAcceptorCity(JsonField.of(merchantAcceptorCity))
+
+ /**
+ * Sets [Builder.merchantAcceptorCity] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorCity] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun merchantAcceptorCity(merchantAcceptorCity: JsonField) = apply {
+ this.merchantAcceptorCity = merchantAcceptorCity
+ }
+
+ /** Merchant acceptor country code (ISO 3166-1 alpha-3) */
+ fun merchantAcceptorCountry(merchantAcceptorCountry: String) =
+ merchantAcceptorCountry(JsonField.of(merchantAcceptorCountry))
+
+ /**
+ * Sets [Builder.merchantAcceptorCountry] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorCountry] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun merchantAcceptorCountry(merchantAcceptorCountry: JsonField) = apply {
+ this.merchantAcceptorCountry = merchantAcceptorCountry
+ }
+
/** Unique identifier to identify the payment card acceptor. */
fun merchantAcceptorId(merchantAcceptorId: String) =
merchantAcceptorId(JsonField.of(merchantAcceptorId))
@@ -938,6 +1142,21 @@ private constructor(
this.merchantAcceptorId = merchantAcceptorId
}
+ /** Merchant acceptor state/province (ISO 3166-2 subdivision code) */
+ fun merchantAcceptorState(merchantAcceptorState: String) =
+ merchantAcceptorState(JsonField.of(merchantAcceptorState))
+
+ /**
+ * Sets [Builder.merchantAcceptorState] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorState] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun merchantAcceptorState(merchantAcceptorState: JsonField) = apply {
+ this.merchantAcceptorState = merchantAcceptorState
+ }
+
/**
* Amount of the transaction to be simulated in currency specified in merchant_currency,
* including any acquirer fees.
@@ -1070,7 +1289,10 @@ private constructor(
checkRequired("descriptor", descriptor),
checkRequired("pan", pan),
mcc,
+ merchantAcceptorCity,
+ merchantAcceptorCountry,
merchantAcceptorId,
+ merchantAcceptorState,
merchantAmount,
merchantCurrency,
partialApprovalCapable,
@@ -1091,7 +1313,10 @@ private constructor(
descriptor()
pan()
mcc()
+ merchantAcceptorCity()
+ merchantAcceptorCountry()
merchantAcceptorId()
+ merchantAcceptorState()
merchantAmount()
merchantCurrency()
partialApprovalCapable()
@@ -1120,7 +1345,10 @@ private constructor(
(if (descriptor.asKnown().isPresent) 1 else 0) +
(if (pan.asKnown().isPresent) 1 else 0) +
(if (mcc.asKnown().isPresent) 1 else 0) +
+ (if (merchantAcceptorCity.asKnown().isPresent) 1 else 0) +
+ (if (merchantAcceptorCountry.asKnown().isPresent) 1 else 0) +
(if (merchantAcceptorId.asKnown().isPresent) 1 else 0) +
+ (if (merchantAcceptorState.asKnown().isPresent) 1 else 0) +
(if (merchantAmount.asKnown().isPresent) 1 else 0) +
(if (merchantCurrency.asKnown().isPresent) 1 else 0) +
(if (partialApprovalCapable.asKnown().isPresent) 1 else 0) +
@@ -1137,7 +1365,10 @@ private constructor(
descriptor == other.descriptor &&
pan == other.pan &&
mcc == other.mcc &&
+ merchantAcceptorCity == other.merchantAcceptorCity &&
+ merchantAcceptorCountry == other.merchantAcceptorCountry &&
merchantAcceptorId == other.merchantAcceptorId &&
+ merchantAcceptorState == other.merchantAcceptorState &&
merchantAmount == other.merchantAmount &&
merchantCurrency == other.merchantCurrency &&
partialApprovalCapable == other.partialApprovalCapable &&
@@ -1152,7 +1383,10 @@ private constructor(
descriptor,
pan,
mcc,
+ merchantAcceptorCity,
+ merchantAcceptorCountry,
merchantAcceptorId,
+ merchantAcceptorState,
merchantAmount,
merchantCurrency,
partialApprovalCapable,
@@ -1165,7 +1399,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Body{amount=$amount, descriptor=$descriptor, pan=$pan, mcc=$mcc, merchantAcceptorId=$merchantAcceptorId, merchantAmount=$merchantAmount, merchantCurrency=$merchantCurrency, partialApprovalCapable=$partialApprovalCapable, pin=$pin, status=$status, additionalProperties=$additionalProperties}"
+ "Body{amount=$amount, descriptor=$descriptor, pan=$pan, mcc=$mcc, merchantAcceptorCity=$merchantAcceptorCity, merchantAcceptorCountry=$merchantAcceptorCountry, merchantAcceptorId=$merchantAcceptorId, merchantAcceptorState=$merchantAcceptorState, merchantAmount=$merchantAmount, merchantCurrency=$merchantCurrency, partialApprovalCapable=$partialApprovalCapable, pin=$pin, status=$status, additionalProperties=$additionalProperties}"
}
/**
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt
index 6d906aed6..ffcdff033 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationAdviceParams.kt
@@ -66,6 +66,22 @@ private constructor(
*/
fun mcc(): Optional = body.mcc()
+ /**
+ * Merchant acceptor city
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCity(): Optional = body.merchantAcceptorCity()
+
+ /**
+ * Merchant acceptor country code (ISO 3166-1 alpha-3)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCountry(): Optional = body.merchantAcceptorCountry()
+
/**
* Unique identifier to identify the payment card acceptor.
*
@@ -74,6 +90,14 @@ private constructor(
*/
fun merchantAcceptorId(): Optional = body.merchantAcceptorId()
+ /**
+ * Merchant acceptor state/province (ISO 3166-2 subdivision code)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorState(): Optional = body.merchantAcceptorState()
+
/**
* Returns the raw JSON value of [amount].
*
@@ -102,6 +126,22 @@ private constructor(
*/
fun _mcc(): JsonField = body._mcc()
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCity].
+ *
+ * Unlike [merchantAcceptorCity], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _merchantAcceptorCity(): JsonField = body._merchantAcceptorCity()
+
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCountry].
+ *
+ * Unlike [merchantAcceptorCountry], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ fun _merchantAcceptorCountry(): JsonField = body._merchantAcceptorCountry()
+
/**
* Returns the raw JSON value of [merchantAcceptorId].
*
@@ -110,6 +150,14 @@ private constructor(
*/
fun _merchantAcceptorId(): JsonField = body._merchantAcceptorId()
+ /**
+ * Returns the raw JSON value of [merchantAcceptorState].
+ *
+ * Unlike [merchantAcceptorState], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _merchantAcceptorState(): JsonField = body._merchantAcceptorState()
+
fun _additionalBodyProperties(): Map = body._additionalProperties()
/** Additional headers to send with the request. */
@@ -164,7 +212,7 @@ private constructor(
* - [descriptor]
* - [pan]
* - [mcc]
- * - [merchantAcceptorId]
+ * - [merchantAcceptorCity]
* - etc.
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
@@ -222,6 +270,38 @@ private constructor(
*/
fun mcc(mcc: JsonField) = apply { body.mcc(mcc) }
+ /** Merchant acceptor city */
+ fun merchantAcceptorCity(merchantAcceptorCity: String) = apply {
+ body.merchantAcceptorCity(merchantAcceptorCity)
+ }
+
+ /**
+ * Sets [Builder.merchantAcceptorCity] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorCity] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantAcceptorCity(merchantAcceptorCity: JsonField) = apply {
+ body.merchantAcceptorCity(merchantAcceptorCity)
+ }
+
+ /** Merchant acceptor country code (ISO 3166-1 alpha-3) */
+ fun merchantAcceptorCountry(merchantAcceptorCountry: String) = apply {
+ body.merchantAcceptorCountry(merchantAcceptorCountry)
+ }
+
+ /**
+ * Sets [Builder.merchantAcceptorCountry] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorCountry] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun merchantAcceptorCountry(merchantAcceptorCountry: JsonField) = apply {
+ body.merchantAcceptorCountry(merchantAcceptorCountry)
+ }
+
/** Unique identifier to identify the payment card acceptor. */
fun merchantAcceptorId(merchantAcceptorId: String) = apply {
body.merchantAcceptorId(merchantAcceptorId)
@@ -238,6 +318,22 @@ private constructor(
body.merchantAcceptorId(merchantAcceptorId)
}
+ /** Merchant acceptor state/province (ISO 3166-2 subdivision code) */
+ fun merchantAcceptorState(merchantAcceptorState: String) = apply {
+ body.merchantAcceptorState(merchantAcceptorState)
+ }
+
+ /**
+ * Sets [Builder.merchantAcceptorState] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorState] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantAcceptorState(merchantAcceptorState: JsonField) = apply {
+ body.merchantAcceptorState(merchantAcceptorState)
+ }
+
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
body.additionalProperties(additionalBodyProperties)
}
@@ -390,7 +486,10 @@ private constructor(
private val descriptor: JsonField,
private val pan: JsonField,
private val mcc: JsonField,
+ private val merchantAcceptorCity: JsonField,
+ private val merchantAcceptorCountry: JsonField,
private val merchantAcceptorId: JsonField,
+ private val merchantAcceptorState: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -402,10 +501,29 @@ private constructor(
descriptor: JsonField = JsonMissing.of(),
@JsonProperty("pan") @ExcludeMissing pan: JsonField = JsonMissing.of(),
@JsonProperty("mcc") @ExcludeMissing mcc: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_acceptor_city")
+ @ExcludeMissing
+ merchantAcceptorCity: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_acceptor_country")
+ @ExcludeMissing
+ merchantAcceptorCountry: JsonField = JsonMissing.of(),
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
merchantAcceptorId: JsonField = JsonMissing.of(),
- ) : this(amount, descriptor, pan, mcc, merchantAcceptorId, mutableMapOf())
+ @JsonProperty("merchant_acceptor_state")
+ @ExcludeMissing
+ merchantAcceptorState: JsonField = JsonMissing.of(),
+ ) : this(
+ amount,
+ descriptor,
+ pan,
+ mcc,
+ merchantAcceptorCity,
+ merchantAcceptorCountry,
+ merchantAcceptorId,
+ merchantAcceptorState,
+ mutableMapOf(),
+ )
/**
* Amount (in cents). Any value entered will be converted into a negative amount in the
@@ -443,6 +561,24 @@ private constructor(
*/
fun mcc(): Optional = mcc.getOptional("mcc")
+ /**
+ * Merchant acceptor city
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCity(): Optional =
+ merchantAcceptorCity.getOptional("merchant_acceptor_city")
+
+ /**
+ * Merchant acceptor country code (ISO 3166-1 alpha-3)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorCountry(): Optional =
+ merchantAcceptorCountry.getOptional("merchant_acceptor_country")
+
/**
* Unique identifier to identify the payment card acceptor.
*
@@ -452,6 +588,15 @@ private constructor(
fun merchantAcceptorId(): Optional =
merchantAcceptorId.getOptional("merchant_acceptor_id")
+ /**
+ * Merchant acceptor state/province (ISO 3166-2 subdivision code)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun merchantAcceptorState(): Optional =
+ merchantAcceptorState.getOptional("merchant_acceptor_state")
+
/**
* Returns the raw JSON value of [amount].
*
@@ -482,6 +627,26 @@ private constructor(
*/
@JsonProperty("mcc") @ExcludeMissing fun _mcc(): JsonField = mcc
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCity].
+ *
+ * Unlike [merchantAcceptorCity], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_city")
+ @ExcludeMissing
+ fun _merchantAcceptorCity(): JsonField = merchantAcceptorCity
+
+ /**
+ * Returns the raw JSON value of [merchantAcceptorCountry].
+ *
+ * Unlike [merchantAcceptorCountry], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_country")
+ @ExcludeMissing
+ fun _merchantAcceptorCountry(): JsonField = merchantAcceptorCountry
+
/**
* Returns the raw JSON value of [merchantAcceptorId].
*
@@ -492,6 +657,16 @@ private constructor(
@ExcludeMissing
fun _merchantAcceptorId(): JsonField = merchantAcceptorId
+ /**
+ * Returns the raw JSON value of [merchantAcceptorState].
+ *
+ * Unlike [merchantAcceptorState], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_state")
+ @ExcludeMissing
+ fun _merchantAcceptorState(): JsonField = merchantAcceptorState
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -526,7 +701,10 @@ private constructor(
private var descriptor: JsonField? = null
private var pan: JsonField