diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3ca49358e..c37434e9f 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.109.0"
+ ".": "0.110.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index f728fc48c..61c0e26a0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 169
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6432801dcf017d9234739b9f6153a8cfecd91255af4765f24ba5209f3e320b5c.yml
-openapi_spec_hash: c2cfee2f044ba15d15b5bfdbd37280c0
-config_hash: 8ac73ccdb428816c89c84802c794a3f8
+configured_endpoints: 168
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-2cfd81dfd3ad2c5a4e98161e54dbac5ddee125c058f9163f29aad4632cadf08d.yml
+openapi_spec_hash: 400a2563ad969fba47b3eb0f02372b1e
+config_hash: f5a16e702bac54729afed6e50b0de3ff
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f56c9c95f..1c53b9354 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,31 @@
# Changelog
+## 0.110.0 (2025-11-10)
+
+Full Changelog: [v0.109.0...v0.110.0](https://github.com/lithic-com/lithic-java/compare/v0.109.0...v0.110.0)
+
+### Features
+
+* **api:** add payment_details ([6040598](https://github.com/lithic-com/lithic-java/commit/6040598e95a76273ab4f3ed790a7fbe28605ad4c))
+* **api:** deprecate auth rule apply endpoint and fix several schemas ([b21d55c](https://github.com/lithic-com/lithic-java/commit/b21d55ce251d33366456db9f99bb4c4ac2cbc9fc))
+* **api:** new fields in Statements APIs ([ea05274](https://github.com/lithic-com/lithic-java/commit/ea052742fedfd9e39df7f080d3530caf8cc3e515))
+
+
+### Bug Fixes
+
+* **api:** fix oneOf -> anyOf in account holder update ([6040598](https://github.com/lithic-com/lithic-java/commit/6040598e95a76273ab4f3ed790a7fbe28605ad4c))
+* **api:** fixing spec for Tokenizations and Enhanced data ([ea05274](https://github.com/lithic-com/lithic-java/commit/ea052742fedfd9e39df7f080d3530caf8cc3e515))
+
+
+### Chores
+
+* **api:** adds support for new ACH_RECEIPT_RELEASED event ([a2bbd13](https://github.com/lithic-com/lithic-java/commit/a2bbd1301f29e85cdec582a799ef91255f35ddfa))
+
+
+### Documentation
+
+* **client:** update readme timeout snippet ([7757427](https://github.com/lithic-com/lithic-java/commit/77574272ea9690f4822524663854b13be0b4a5f1))
+
## 0.109.0 (2025-10-23)
Full Changelog: [v0.108.0...v0.109.0](https://github.com/lithic-com/lithic-java/compare/v0.108.0...v0.109.0)
diff --git a/README.md b/README.md
index 55f8ed5a9..0f8293173 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.109.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.109.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.110.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.110.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.109.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.110.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.109.0")
+implementation("com.lithic.api:lithic-java:0.110.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.109.0")
com.lithic.api
lithic-java
- 0.109.0
+ 0.110.0
```
@@ -416,11 +416,9 @@ Requests time out after 1 minute by default.
To set a custom timeout, configure the method call using the `timeout` method:
```java
-import com.lithic.api.models.Card;
+import com.lithic.api.models.CardListPage;
-Card card = client.cards().create(
- params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()
-);
+CardListPage page = client.cards().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
```
Or configure the default for all method calls at the client level:
diff --git a/build.gradle.kts b/build.gradle.kts
index 0a4bbd131..816a8aa9b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.109.0" // x-release-please-version
+ version = "0.110.0" // x-release-please-version
}
subprojects {
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 5175793d0..cb3b40b2d 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
@@ -1679,6 +1679,8 @@ private constructor(
@JvmField val ACH_RECEIPT_PROCESSED = of("ACH_RECEIPT_PROCESSED")
+ @JvmField val ACH_RECEIPT_RELEASED = of("ACH_RECEIPT_RELEASED")
+
@JvmField val ACH_RECEIPT_SETTLED = of("ACH_RECEIPT_SETTLED")
@JvmField val ACH_RETURN_INITIATED = of("ACH_RETURN_INITIATED")
@@ -1817,6 +1819,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED,
ACH_ORIGINATION_SETTLED,
ACH_RECEIPT_PROCESSED,
+ ACH_RECEIPT_RELEASED,
ACH_RECEIPT_SETTLED,
ACH_RETURN_INITIATED,
ACH_RETURN_PROCESSED,
@@ -1901,6 +1904,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED,
ACH_ORIGINATION_SETTLED,
ACH_RECEIPT_PROCESSED,
+ ACH_RECEIPT_RELEASED,
ACH_RECEIPT_SETTLED,
ACH_RETURN_INITIATED,
ACH_RETURN_PROCESSED,
@@ -1987,6 +1991,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED -> Value.ACH_ORIGINATION_REVIEWED
ACH_ORIGINATION_SETTLED -> Value.ACH_ORIGINATION_SETTLED
ACH_RECEIPT_PROCESSED -> Value.ACH_RECEIPT_PROCESSED
+ ACH_RECEIPT_RELEASED -> Value.ACH_RECEIPT_RELEASED
ACH_RECEIPT_SETTLED -> Value.ACH_RECEIPT_SETTLED
ACH_RETURN_INITIATED -> Value.ACH_RETURN_INITIATED
ACH_RETURN_PROCESSED -> Value.ACH_RETURN_PROCESSED
@@ -2071,6 +2076,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED -> Known.ACH_ORIGINATION_REVIEWED
ACH_ORIGINATION_SETTLED -> Known.ACH_ORIGINATION_SETTLED
ACH_RECEIPT_PROCESSED -> Known.ACH_RECEIPT_PROCESSED
+ ACH_RECEIPT_RELEASED -> Known.ACH_RECEIPT_RELEASED
ACH_RECEIPT_SETTLED -> Known.ACH_RECEIPT_SETTLED
ACH_RETURN_INITIATED -> Known.ACH_RETURN_INITIATED
ACH_RETURN_PROCESSED -> Known.ACH_RETURN_PROCESSED
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 ebf79985d..9535a0c5c 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
@@ -1701,6 +1701,8 @@ private constructor(
@JvmField val ACH_RECEIPT_PROCESSED = of("ACH_RECEIPT_PROCESSED")
+ @JvmField val ACH_RECEIPT_RELEASED = of("ACH_RECEIPT_RELEASED")
+
@JvmField val ACH_RECEIPT_SETTLED = of("ACH_RECEIPT_SETTLED")
@JvmField val ACH_RETURN_INITIATED = of("ACH_RETURN_INITIATED")
@@ -1839,6 +1841,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED,
ACH_ORIGINATION_SETTLED,
ACH_RECEIPT_PROCESSED,
+ ACH_RECEIPT_RELEASED,
ACH_RECEIPT_SETTLED,
ACH_RETURN_INITIATED,
ACH_RETURN_PROCESSED,
@@ -1923,6 +1926,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED,
ACH_ORIGINATION_SETTLED,
ACH_RECEIPT_PROCESSED,
+ ACH_RECEIPT_RELEASED,
ACH_RECEIPT_SETTLED,
ACH_RETURN_INITIATED,
ACH_RETURN_PROCESSED,
@@ -2009,6 +2013,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED -> Value.ACH_ORIGINATION_REVIEWED
ACH_ORIGINATION_SETTLED -> Value.ACH_ORIGINATION_SETTLED
ACH_RECEIPT_PROCESSED -> Value.ACH_RECEIPT_PROCESSED
+ ACH_RECEIPT_RELEASED -> Value.ACH_RECEIPT_RELEASED
ACH_RECEIPT_SETTLED -> Value.ACH_RECEIPT_SETTLED
ACH_RETURN_INITIATED -> Value.ACH_RETURN_INITIATED
ACH_RETURN_PROCESSED -> Value.ACH_RETURN_PROCESSED
@@ -2093,6 +2098,7 @@ private constructor(
ACH_ORIGINATION_REVIEWED -> Known.ACH_ORIGINATION_REVIEWED
ACH_ORIGINATION_SETTLED -> Known.ACH_ORIGINATION_SETTLED
ACH_RECEIPT_PROCESSED -> Known.ACH_RECEIPT_PROCESSED
+ ACH_RECEIPT_RELEASED -> Known.ACH_RECEIPT_RELEASED
ACH_RECEIPT_SETTLED -> Known.ACH_RECEIPT_SETTLED
ACH_RETURN_INITIATED -> Known.ACH_RETURN_INITIATED
ACH_RETURN_PROCESSED -> Known.ACH_RETURN_PROCESSED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt
index f1a266837..2a9e0c441 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt
@@ -678,8 +678,15 @@ private constructor(
* businesses. Pass the account_token of the enrolled business associated with the
* AUTHORIZED_USER in this field.
*/
- fun businessAccountToken(businessAccountToken: String) =
- businessAccountToken(JsonField.of(businessAccountToken))
+ fun businessAccountToken(businessAccountToken: String?) =
+ businessAccountToken(JsonField.ofNullable(businessAccountToken))
+
+ /**
+ * Alias for calling [Builder.businessAccountToken] with
+ * `businessAccountToken.orElse(null)`.
+ */
+ fun businessAccountToken(businessAccountToken: Optional) =
+ businessAccountToken(businessAccountToken.getOrNull())
/**
* Sets [Builder.businessAccountToken] to an arbitrary JSON value.
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt
index 68ca91703..9178f9da8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt
@@ -866,8 +866,15 @@ private constructor(
* users of businesses. Pass the account_token of the enrolled business associated with
* the AUTHORIZED_USER in this field.
*/
- fun businessAccountToken(businessAccountToken: String) =
- businessAccountToken(JsonField.of(businessAccountToken))
+ fun businessAccountToken(businessAccountToken: String?) =
+ businessAccountToken(JsonField.ofNullable(businessAccountToken))
+
+ /**
+ * Alias for calling [Builder.businessAccountToken] with
+ * `businessAccountToken.orElse(null)`.
+ */
+ fun businessAccountToken(businessAccountToken: Optional) =
+ businessAccountToken(businessAccountToken.getOrNull())
/**
* Sets [Builder.businessAccountToken] to an arbitrary JSON value.
@@ -3994,8 +4001,15 @@ private constructor(
fun address(address: JsonField) = apply { this.address = address }
/** The token for the business account that the account holder is associated with */
- fun businessAccountToken(businessAccountToken: String) =
- businessAccountToken(JsonField.of(businessAccountToken))
+ fun businessAccountToken(businessAccountToken: String?) =
+ businessAccountToken(JsonField.ofNullable(businessAccountToken))
+
+ /**
+ * Alias for calling [Builder.businessAccountToken] with
+ * `businessAccountToken.orElse(null)`.
+ */
+ fun businessAccountToken(businessAccountToken: Optional) =
+ businessAccountToken(businessAccountToken.getOrNull())
/**
* Sets [Builder.businessAccountToken] to an arbitrary JSON value.
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ApplyParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ApplyParams.kt
deleted file mode 100644
index a20c0cc78..000000000
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ApplyParams.kt
+++ /dev/null
@@ -1,1179 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.lithic.api.models
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import com.fasterxml.jackson.core.JsonGenerator
-import com.fasterxml.jackson.core.ObjectCodec
-import com.fasterxml.jackson.databind.JsonNode
-import com.fasterxml.jackson.databind.SerializerProvider
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize
-import com.fasterxml.jackson.databind.annotation.JsonSerialize
-import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
-import com.lithic.api.core.BaseDeserializer
-import com.lithic.api.core.BaseSerializer
-import com.lithic.api.core.ExcludeMissing
-import com.lithic.api.core.JsonField
-import com.lithic.api.core.JsonMissing
-import com.lithic.api.core.JsonValue
-import com.lithic.api.core.Params
-import com.lithic.api.core.allMaxBy
-import com.lithic.api.core.checkKnown
-import com.lithic.api.core.checkRequired
-import com.lithic.api.core.getOrThrow
-import com.lithic.api.core.http.Headers
-import com.lithic.api.core.http.QueryParams
-import com.lithic.api.core.toImmutable
-import com.lithic.api.errors.LithicInvalidDataException
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/**
- * Associates a V2 Auth rule with a card program, the provided account(s) or card(s).
- *
- * Prefer using the `PATCH` method for this operation.
- */
-@Deprecated("deprecated")
-class AuthRuleV2ApplyParams
-private constructor(
- private val authRuleToken: String?,
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- fun authRuleToken(): Optional = Optional.ofNullable(authRuleToken)
-
- fun body(): Body = body
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [AuthRuleV2ApplyParams].
- *
- * The following fields are required:
- * ```java
- * .body()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [AuthRuleV2ApplyParams]. */
- class Builder internal constructor() {
-
- private var authRuleToken: String? = null
- private var body: Body? = null
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(authRuleV2ApplyParams: AuthRuleV2ApplyParams) = apply {
- authRuleToken = authRuleV2ApplyParams.authRuleToken
- body = authRuleV2ApplyParams.body
- additionalHeaders = authRuleV2ApplyParams.additionalHeaders.toBuilder()
- additionalQueryParams = authRuleV2ApplyParams.additionalQueryParams.toBuilder()
- }
-
- fun authRuleToken(authRuleToken: String?) = apply { this.authRuleToken = authRuleToken }
-
- /** Alias for calling [Builder.authRuleToken] with `authRuleToken.orElse(null)`. */
- fun authRuleToken(authRuleToken: Optional) =
- authRuleToken(authRuleToken.getOrNull())
-
- fun body(body: Body) = apply { this.body = body }
-
- /**
- * Alias for calling [body] with
- * `Body.ofApplyAuthRuleRequestAccountTokens(applyAuthRuleRequestAccountTokens)`.
- */
- fun body(applyAuthRuleRequestAccountTokens: Body.ApplyAuthRuleRequestAccountTokens) =
- body(Body.ofApplyAuthRuleRequestAccountTokens(applyAuthRuleRequestAccountTokens))
-
- /**
- * Alias for calling [body] with
- * `Body.ofApplyAuthRuleRequestCardTokens(applyAuthRuleRequestCardTokens)`.
- */
- fun body(applyAuthRuleRequestCardTokens: Body.ApplyAuthRuleRequestCardTokens) =
- body(Body.ofApplyAuthRuleRequestCardTokens(applyAuthRuleRequestCardTokens))
-
- /**
- * Alias for calling [body] with
- * `Body.ofApplyAuthRuleRequestProgramLevel(applyAuthRuleRequestProgramLevel)`.
- */
- fun body(applyAuthRuleRequestProgramLevel: Body.ApplyAuthRuleRequestProgramLevel) =
- body(Body.ofApplyAuthRuleRequestProgramLevel(applyAuthRuleRequestProgramLevel))
-
- fun additionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun additionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun putAdditionalHeader(name: String, value: String) = apply {
- additionalHeaders.put(name, value)
- }
-
- fun putAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.put(name, values)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun replaceAdditionalHeaders(name: String, value: String) = apply {
- additionalHeaders.replace(name, value)
- }
-
- fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.replace(name, values)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
-
- fun removeAllAdditionalHeaders(names: Set) = apply {
- additionalHeaders.removeAll(names)
- }
-
- fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun additionalQueryParams(additionalQueryParams: Map>) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun putAdditionalQueryParam(key: String, value: String) = apply {
- additionalQueryParams.put(key, value)
- }
-
- fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.put(key, values)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun replaceAdditionalQueryParams(key: String, value: String) = apply {
- additionalQueryParams.replace(key, value)
- }
-
- fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.replace(key, values)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
-
- fun removeAllAdditionalQueryParams(keys: Set) = apply {
- additionalQueryParams.removeAll(keys)
- }
-
- /**
- * Returns an immutable instance of [AuthRuleV2ApplyParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .body()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): AuthRuleV2ApplyParams =
- AuthRuleV2ApplyParams(
- authRuleToken,
- checkRequired("body", body),
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _body(): Body = body
-
- fun _pathParam(index: Int): String =
- when (index) {
- 0 -> authRuleToken ?: ""
- else -> ""
- }
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams = additionalQueryParams
-
- @JsonDeserialize(using = Body.Deserializer::class)
- @JsonSerialize(using = Body.Serializer::class)
- class Body
- private constructor(
- private val applyAuthRuleRequestAccountTokens: ApplyAuthRuleRequestAccountTokens? = null,
- private val applyAuthRuleRequestCardTokens: ApplyAuthRuleRequestCardTokens? = null,
- private val applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel? = null,
- private val _json: JsonValue? = null,
- ) {
-
- fun applyAuthRuleRequestAccountTokens(): Optional =
- Optional.ofNullable(applyAuthRuleRequestAccountTokens)
-
- fun applyAuthRuleRequestCardTokens(): Optional =
- Optional.ofNullable(applyAuthRuleRequestCardTokens)
-
- fun applyAuthRuleRequestProgramLevel(): Optional =
- Optional.ofNullable(applyAuthRuleRequestProgramLevel)
-
- fun isApplyAuthRuleRequestAccountTokens(): Boolean =
- applyAuthRuleRequestAccountTokens != null
-
- fun isApplyAuthRuleRequestCardTokens(): Boolean = applyAuthRuleRequestCardTokens != null
-
- fun isApplyAuthRuleRequestProgramLevel(): Boolean = applyAuthRuleRequestProgramLevel != null
-
- fun asApplyAuthRuleRequestAccountTokens(): ApplyAuthRuleRequestAccountTokens =
- applyAuthRuleRequestAccountTokens.getOrThrow("applyAuthRuleRequestAccountTokens")
-
- fun asApplyAuthRuleRequestCardTokens(): ApplyAuthRuleRequestCardTokens =
- applyAuthRuleRequestCardTokens.getOrThrow("applyAuthRuleRequestCardTokens")
-
- fun asApplyAuthRuleRequestProgramLevel(): ApplyAuthRuleRequestProgramLevel =
- applyAuthRuleRequestProgramLevel.getOrThrow("applyAuthRuleRequestProgramLevel")
-
- fun _json(): Optional = Optional.ofNullable(_json)
-
- fun accept(visitor: Visitor): T =
- when {
- applyAuthRuleRequestAccountTokens != null ->
- visitor.visitApplyAuthRuleRequestAccountTokens(
- applyAuthRuleRequestAccountTokens
- )
- applyAuthRuleRequestCardTokens != null ->
- visitor.visitApplyAuthRuleRequestCardTokens(applyAuthRuleRequestCardTokens)
- applyAuthRuleRequestProgramLevel != null ->
- visitor.visitApplyAuthRuleRequestProgramLevel(applyAuthRuleRequestProgramLevel)
- else -> visitor.unknown(_json)
- }
-
- private var validated: Boolean = false
-
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- accept(
- object : Visitor {
- override fun visitApplyAuthRuleRequestAccountTokens(
- applyAuthRuleRequestAccountTokens: ApplyAuthRuleRequestAccountTokens
- ) {
- applyAuthRuleRequestAccountTokens.validate()
- }
-
- override fun visitApplyAuthRuleRequestCardTokens(
- applyAuthRuleRequestCardTokens: ApplyAuthRuleRequestCardTokens
- ) {
- applyAuthRuleRequestCardTokens.validate()
- }
-
- override fun visitApplyAuthRuleRequestProgramLevel(
- applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel
- ) {
- applyAuthRuleRequestProgramLevel.validate()
- }
- }
- )
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- accept(
- object : Visitor {
- override fun visitApplyAuthRuleRequestAccountTokens(
- applyAuthRuleRequestAccountTokens: ApplyAuthRuleRequestAccountTokens
- ) = applyAuthRuleRequestAccountTokens.validity()
-
- override fun visitApplyAuthRuleRequestCardTokens(
- applyAuthRuleRequestCardTokens: ApplyAuthRuleRequestCardTokens
- ) = applyAuthRuleRequestCardTokens.validity()
-
- override fun visitApplyAuthRuleRequestProgramLevel(
- applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel
- ) = applyAuthRuleRequestProgramLevel.validity()
-
- override fun unknown(json: JsonValue?) = 0
- }
- )
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- applyAuthRuleRequestAccountTokens == other.applyAuthRuleRequestAccountTokens &&
- applyAuthRuleRequestCardTokens == other.applyAuthRuleRequestCardTokens &&
- applyAuthRuleRequestProgramLevel == other.applyAuthRuleRequestProgramLevel
- }
-
- override fun hashCode(): Int =
- Objects.hash(
- applyAuthRuleRequestAccountTokens,
- applyAuthRuleRequestCardTokens,
- applyAuthRuleRequestProgramLevel,
- )
-
- override fun toString(): String =
- when {
- applyAuthRuleRequestAccountTokens != null ->
- "Body{applyAuthRuleRequestAccountTokens=$applyAuthRuleRequestAccountTokens}"
- applyAuthRuleRequestCardTokens != null ->
- "Body{applyAuthRuleRequestCardTokens=$applyAuthRuleRequestCardTokens}"
- applyAuthRuleRequestProgramLevel != null ->
- "Body{applyAuthRuleRequestProgramLevel=$applyAuthRuleRequestProgramLevel}"
- _json != null -> "Body{_unknown=$_json}"
- else -> throw IllegalStateException("Invalid Body")
- }
-
- companion object {
-
- @JvmStatic
- fun ofApplyAuthRuleRequestAccountTokens(
- applyAuthRuleRequestAccountTokens: ApplyAuthRuleRequestAccountTokens
- ) = Body(applyAuthRuleRequestAccountTokens = applyAuthRuleRequestAccountTokens)
-
- @JvmStatic
- fun ofApplyAuthRuleRequestCardTokens(
- applyAuthRuleRequestCardTokens: ApplyAuthRuleRequestCardTokens
- ) = Body(applyAuthRuleRequestCardTokens = applyAuthRuleRequestCardTokens)
-
- @JvmStatic
- fun ofApplyAuthRuleRequestProgramLevel(
- applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel
- ) = Body(applyAuthRuleRequestProgramLevel = applyAuthRuleRequestProgramLevel)
- }
-
- /** An interface that defines how to map each variant of [Body] to a value of type [T]. */
- interface Visitor {
-
- fun visitApplyAuthRuleRequestAccountTokens(
- applyAuthRuleRequestAccountTokens: ApplyAuthRuleRequestAccountTokens
- ): T
-
- fun visitApplyAuthRuleRequestCardTokens(
- applyAuthRuleRequestCardTokens: ApplyAuthRuleRequestCardTokens
- ): T
-
- fun visitApplyAuthRuleRequestProgramLevel(
- applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel
- ): T
-
- /**
- * Maps an unknown variant of [Body] to a value of type [T].
- *
- * An instance of [Body] can contain an unknown variant if it was deserialized from data
- * that doesn't match any known variant. For example, if the SDK is on an older version
- * than the API, then the API may respond with new variants that the SDK is unaware of.
- *
- * @throws LithicInvalidDataException in the default implementation.
- */
- fun unknown(json: JsonValue?): T {
- throw LithicInvalidDataException("Unknown Body: $json")
- }
- }
-
- internal class Deserializer : BaseDeserializer(Body::class) {
-
- override fun ObjectCodec.deserialize(node: JsonNode): Body {
- val json = JsonValue.fromJsonNode(node)
-
- val bestMatches =
- sequenceOf(
- tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let {
- Body(applyAuthRuleRequestAccountTokens = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())
- ?.let { Body(applyAuthRuleRequestCardTokens = it, _json = json) },
- tryDeserialize(node, jacksonTypeRef())
- ?.let { Body(applyAuthRuleRequestProgramLevel = it, _json = json) },
- )
- .filterNotNull()
- .allMaxBy { it.validity() }
- .toList()
- return when (bestMatches.size) {
- // This can happen if what we're deserializing is completely incompatible with
- // all the possible variants (e.g. deserializing from boolean).
- 0 -> Body(_json = json)
- 1 -> bestMatches.single()
- // If there's more than one match with the highest validity, then use the first
- // completely valid match, or simply the first match if none are completely
- // valid.
- else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first()
- }
- }
- }
-
- internal class Serializer : BaseSerializer(Body::class) {
-
- override fun serialize(
- value: Body,
- generator: JsonGenerator,
- provider: SerializerProvider,
- ) {
- when {
- value.applyAuthRuleRequestAccountTokens != null ->
- generator.writeObject(value.applyAuthRuleRequestAccountTokens)
- value.applyAuthRuleRequestCardTokens != null ->
- generator.writeObject(value.applyAuthRuleRequestCardTokens)
- value.applyAuthRuleRequestProgramLevel != null ->
- generator.writeObject(value.applyAuthRuleRequestProgramLevel)
- value._json != null -> generator.writeObject(value._json)
- else -> throw IllegalStateException("Invalid Body")
- }
- }
- }
-
- class ApplyAuthRuleRequestAccountTokens
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val accountTokens: JsonField>,
- private val businessAccountTokens: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("account_tokens")
- @ExcludeMissing
- accountTokens: JsonField> = JsonMissing.of(),
- @JsonProperty("business_account_tokens")
- @ExcludeMissing
- businessAccountTokens: JsonField> = JsonMissing.of(),
- ) : this(accountTokens, businessAccountTokens, mutableMapOf())
-
- /**
- * Account tokens to which the Auth Rule applies.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun accountTokens(): Optional> =
- accountTokens.getOptional("account_tokens")
-
- /**
- * Business Account tokens to which the Auth Rule applies.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun businessAccountTokens(): Optional> =
- businessAccountTokens.getOptional("business_account_tokens")
-
- /**
- * Returns the raw JSON value of [accountTokens].
- *
- * Unlike [accountTokens], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("account_tokens")
- @ExcludeMissing
- fun _accountTokens(): JsonField> = accountTokens
-
- /**
- * Returns the raw JSON value of [businessAccountTokens].
- *
- * Unlike [businessAccountTokens], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("business_account_tokens")
- @ExcludeMissing
- fun _businessAccountTokens(): JsonField> = businessAccountTokens
-
- @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
- * [ApplyAuthRuleRequestAccountTokens].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [ApplyAuthRuleRequestAccountTokens]. */
- class Builder internal constructor() {
-
- private var accountTokens: JsonField>? = null
- private var businessAccountTokens: JsonField>? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- applyAuthRuleRequestAccountTokens: ApplyAuthRuleRequestAccountTokens
- ) = apply {
- accountTokens =
- applyAuthRuleRequestAccountTokens.accountTokens.map { it.toMutableList() }
- businessAccountTokens =
- applyAuthRuleRequestAccountTokens.businessAccountTokens.map {
- it.toMutableList()
- }
- additionalProperties =
- applyAuthRuleRequestAccountTokens.additionalProperties.toMutableMap()
- }
-
- /** Account tokens to which the Auth Rule applies. */
- fun accountTokens(accountTokens: List) =
- accountTokens(JsonField.of(accountTokens))
-
- /**
- * Sets [Builder.accountTokens] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountTokens] with a well-typed `List`
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun accountTokens(accountTokens: JsonField>) = apply {
- this.accountTokens = accountTokens.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [String] to [accountTokens].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addAccountToken(accountToken: String) = apply {
- accountTokens =
- (accountTokens ?: JsonField.of(mutableListOf())).also {
- checkKnown("accountTokens", it).add(accountToken)
- }
- }
-
- /** Business Account tokens to which the Auth Rule applies. */
- fun businessAccountTokens(businessAccountTokens: List) =
- businessAccountTokens(JsonField.of(businessAccountTokens))
-
- /**
- * Sets [Builder.businessAccountTokens] to an arbitrary JSON value.
- *
- * You should usually call [Builder.businessAccountTokens] with a well-typed
- * `List` value instead. This method is primarily for setting the field to
- * an undocumented or not yet supported value.
- */
- fun businessAccountTokens(businessAccountTokens: JsonField>) = apply {
- this.businessAccountTokens = businessAccountTokens.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [String] to [businessAccountTokens].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addBusinessAccountToken(businessAccountToken: String) = apply {
- businessAccountTokens =
- (businessAccountTokens ?: JsonField.of(mutableListOf())).also {
- checkKnown("businessAccountTokens", it).add(businessAccountToken)
- }
- }
-
- 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 [ApplyAuthRuleRequestAccountTokens].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): ApplyAuthRuleRequestAccountTokens =
- ApplyAuthRuleRequestAccountTokens(
- (accountTokens ?: JsonMissing.of()).map { it.toImmutable() },
- (businessAccountTokens ?: JsonMissing.of()).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): ApplyAuthRuleRequestAccountTokens = apply {
- if (validated) {
- return@apply
- }
-
- accountTokens()
- businessAccountTokens()
- 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 =
- (accountTokens.asKnown().getOrNull()?.size ?: 0) +
- (businessAccountTokens.asKnown().getOrNull()?.size ?: 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is ApplyAuthRuleRequestAccountTokens &&
- accountTokens == other.accountTokens &&
- businessAccountTokens == other.businessAccountTokens &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(accountTokens, businessAccountTokens, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "ApplyAuthRuleRequestAccountTokens{accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, additionalProperties=$additionalProperties}"
- }
-
- class ApplyAuthRuleRequestCardTokens
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val cardTokens: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("card_tokens")
- @ExcludeMissing
- cardTokens: JsonField> = JsonMissing.of()
- ) : this(cardTokens, mutableMapOf())
-
- /**
- * Card tokens to which the Auth Rule applies.
- *
- * @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 cardTokens(): List = cardTokens.getRequired("card_tokens")
-
- /**
- * Returns the raw JSON value of [cardTokens].
- *
- * Unlike [cardTokens], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("card_tokens")
- @ExcludeMissing
- fun _cardTokens(): JsonField> = cardTokens
-
- @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
- * [ApplyAuthRuleRequestCardTokens].
- *
- * The following fields are required:
- * ```java
- * .cardTokens()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [ApplyAuthRuleRequestCardTokens]. */
- class Builder internal constructor() {
-
- private var cardTokens: JsonField>? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(applyAuthRuleRequestCardTokens: ApplyAuthRuleRequestCardTokens) =
- apply {
- cardTokens =
- applyAuthRuleRequestCardTokens.cardTokens.map { it.toMutableList() }
- additionalProperties =
- applyAuthRuleRequestCardTokens.additionalProperties.toMutableMap()
- }
-
- /** Card tokens to which the Auth Rule applies. */
- fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens))
-
- /**
- * Sets [Builder.cardTokens] to an arbitrary JSON value.
- *
- * You should usually call [Builder.cardTokens] with a well-typed `List`
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun cardTokens(cardTokens: JsonField>) = apply {
- this.cardTokens = cardTokens.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [String] to [cardTokens].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addCardToken(cardToken: String) = apply {
- cardTokens =
- (cardTokens ?: JsonField.of(mutableListOf())).also {
- checkKnown("cardTokens", it).add(cardToken)
- }
- }
-
- 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 [ApplyAuthRuleRequestCardTokens].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .cardTokens()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): ApplyAuthRuleRequestCardTokens =
- ApplyAuthRuleRequestCardTokens(
- checkRequired("cardTokens", cardTokens).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): ApplyAuthRuleRequestCardTokens = apply {
- if (validated) {
- return@apply
- }
-
- cardTokens()
- 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 = (cardTokens.asKnown().getOrNull()?.size ?: 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is ApplyAuthRuleRequestCardTokens &&
- cardTokens == other.cardTokens &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(cardTokens, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "ApplyAuthRuleRequestCardTokens{cardTokens=$cardTokens, additionalProperties=$additionalProperties}"
- }
-
- class ApplyAuthRuleRequestProgramLevel
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val programLevel: JsonField,
- private val excludedCardTokens: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("program_level")
- @ExcludeMissing
- programLevel: JsonField = JsonMissing.of(),
- @JsonProperty("excluded_card_tokens")
- @ExcludeMissing
- excludedCardTokens: JsonField> = JsonMissing.of(),
- ) : this(programLevel, excludedCardTokens, mutableMapOf())
-
- /**
- * Whether the Auth Rule applies to all authorizations on the card program.
- *
- * @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 programLevel(): Boolean = programLevel.getRequired("program_level")
-
- /**
- * Card tokens to which the Auth Rule does not apply.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun excludedCardTokens(): Optional> =
- excludedCardTokens.getOptional("excluded_card_tokens")
-
- /**
- * Returns the raw JSON value of [programLevel].
- *
- * Unlike [programLevel], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("program_level")
- @ExcludeMissing
- fun _programLevel(): JsonField = programLevel
-
- /**
- * Returns the raw JSON value of [excludedCardTokens].
- *
- * Unlike [excludedCardTokens], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("excluded_card_tokens")
- @ExcludeMissing
- fun _excludedCardTokens(): JsonField> = excludedCardTokens
-
- @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
- * [ApplyAuthRuleRequestProgramLevel].
- *
- * The following fields are required:
- * ```java
- * .programLevel()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [ApplyAuthRuleRequestProgramLevel]. */
- class Builder internal constructor() {
-
- private var programLevel: JsonField? = null
- private var excludedCardTokens: JsonField>? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel
- ) = apply {
- programLevel = applyAuthRuleRequestProgramLevel.programLevel
- excludedCardTokens =
- applyAuthRuleRequestProgramLevel.excludedCardTokens.map {
- it.toMutableList()
- }
- additionalProperties =
- applyAuthRuleRequestProgramLevel.additionalProperties.toMutableMap()
- }
-
- /** Whether the Auth Rule applies to all authorizations on the card program. */
- fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel))
-
- /**
- * Sets [Builder.programLevel] to an arbitrary JSON value.
- *
- * You should usually call [Builder.programLevel] with a well-typed [Boolean] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun programLevel(programLevel: JsonField) = apply {
- this.programLevel = programLevel
- }
-
- /** Card tokens to which the Auth Rule does not apply. */
- fun excludedCardTokens(excludedCardTokens: List) =
- excludedCardTokens(JsonField.of(excludedCardTokens))
-
- /**
- * Sets [Builder.excludedCardTokens] to an arbitrary JSON value.
- *
- * You should usually call [Builder.excludedCardTokens] with a well-typed
- * `List` value instead. This method is primarily for setting the field to
- * an undocumented or not yet supported value.
- */
- fun excludedCardTokens(excludedCardTokens: JsonField>) = apply {
- this.excludedCardTokens = excludedCardTokens.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [String] to [excludedCardTokens].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addExcludedCardToken(excludedCardToken: String) = apply {
- excludedCardTokens =
- (excludedCardTokens ?: JsonField.of(mutableListOf())).also {
- checkKnown("excludedCardTokens", it).add(excludedCardToken)
- }
- }
-
- 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 [ApplyAuthRuleRequestProgramLevel].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .programLevel()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): ApplyAuthRuleRequestProgramLevel =
- ApplyAuthRuleRequestProgramLevel(
- checkRequired("programLevel", programLevel),
- (excludedCardTokens ?: JsonMissing.of()).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): ApplyAuthRuleRequestProgramLevel = apply {
- if (validated) {
- return@apply
- }
-
- programLevel()
- excludedCardTokens()
- 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 (programLevel.asKnown().isPresent) 1 else 0) +
- (excludedCardTokens.asKnown().getOrNull()?.size ?: 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is ApplyAuthRuleRequestProgramLevel &&
- programLevel == other.programLevel &&
- excludedCardTokens == other.excludedCardTokens &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(programLevel, excludedCardTokens, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "ApplyAuthRuleRequestProgramLevel{programLevel=$programLevel, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}"
- }
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is AuthRuleV2ApplyParams &&
- authRuleToken == other.authRuleToken &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int =
- Objects.hash(authRuleToken, body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "AuthRuleV2ApplyParams{authRuleToken=$authRuleToken, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt
index d261530e4..e3b8e21b5 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt
@@ -998,7 +998,7 @@ private constructor(
private val token: JsonField,
private val amount: JsonField,
private val created: JsonField,
- private val detailedResults: JsonField,
+ private val detailedResults: JsonField>,
private val memo: JsonField,
private val result: JsonField,
private val subtype: JsonField,
@@ -1015,7 +1015,7 @@ private constructor(
created: JsonField = JsonMissing.of(),
@JsonProperty("detailed_results")
@ExcludeMissing
- detailedResults: JsonField = JsonMissing.of(),
+ detailedResults: JsonField> = JsonMissing.of(),
@JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(),
@JsonProperty("result") @ExcludeMissing result: JsonField = JsonMissing.of(),
@JsonProperty("subtype") @ExcludeMissing subtype: JsonField = JsonMissing.of(),
@@ -1063,7 +1063,7 @@ private constructor(
* @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 detailedResults(): BookTransferDetailedResults =
+ fun detailedResults(): List =
detailedResults.getRequired("detailed_results")
/**
@@ -1128,7 +1128,7 @@ private constructor(
*/
@JsonProperty("detailed_results")
@ExcludeMissing
- fun _detailedResults(): JsonField = detailedResults
+ fun _detailedResults(): JsonField> = detailedResults
/**
* Returns the raw JSON value of [memo].
@@ -1196,7 +1196,7 @@ private constructor(
private var token: JsonField? = null
private var amount: JsonField? = null
private var created: JsonField? = null
- private var detailedResults: JsonField? = null
+ private var detailedResults: JsonField>? = null
private var memo: JsonField? = null
private var result: JsonField? = null
private var subtype: JsonField? = null
@@ -1208,7 +1208,7 @@ private constructor(
token = bookTransferEvent.token
amount = bookTransferEvent.amount
created = bookTransferEvent.created
- detailedResults = bookTransferEvent.detailedResults
+ detailedResults = bookTransferEvent.detailedResults.map { it.toMutableList() }
memo = bookTransferEvent.memo
result = bookTransferEvent.result
subtype = bookTransferEvent.subtype
@@ -1255,18 +1255,31 @@ private constructor(
*/
fun created(created: JsonField) = apply { this.created = created }
- fun detailedResults(detailedResults: BookTransferDetailedResults) =
+ fun detailedResults(detailedResults: List) =
detailedResults(JsonField.of(detailedResults))
/**
* Sets [Builder.detailedResults] to an arbitrary JSON value.
*
* You should usually call [Builder.detailedResults] with a well-typed
- * [BookTransferDetailedResults] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
+ * `List` value instead. This method is primarily for
+ * setting the field to an undocumented or not yet supported value.
*/
- fun detailedResults(detailedResults: JsonField) = apply {
- this.detailedResults = detailedResults
+ fun detailedResults(detailedResults: JsonField>) =
+ apply {
+ this.detailedResults = detailedResults.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [BookTransferDetailedResults] to [detailedResults].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addDetailedResult(detailedResult: BookTransferDetailedResults) = apply {
+ detailedResults =
+ (detailedResults ?: JsonField.of(mutableListOf())).also {
+ checkKnown("detailedResults", it).add(detailedResult)
+ }
}
/** Memo for the transfer. */
@@ -1363,7 +1376,7 @@ private constructor(
checkRequired("token", token),
checkRequired("amount", amount),
checkRequired("created", created),
- checkRequired("detailedResults", detailedResults),
+ checkRequired("detailedResults", detailedResults).map { it.toImmutable() },
checkRequired("memo", memo),
checkRequired("result", result),
checkRequired("subtype", subtype),
@@ -1382,7 +1395,7 @@ private constructor(
token()
amount()
created()
- detailedResults().validate()
+ detailedResults().forEach { it.validate() }
memo()
result().validate()
subtype()
@@ -1409,7 +1422,7 @@ private constructor(
(if (token.asKnown().isPresent) 1 else 0) +
(if (amount.asKnown().isPresent) 1 else 0) +
(if (created.asKnown().isPresent) 1 else 0) +
- (detailedResults.asKnown().getOrNull()?.validity() ?: 0) +
+ (detailedResults.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (memo.asKnown().isPresent) 1 else 0) +
(result.asKnown().getOrNull()?.validity() ?: 0) +
(if (subtype.asKnown().isPresent) 1 else 0) +
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt
index d98b38266..e331a51d3 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt
@@ -6,13 +6,24 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
+import com.fasterxml.jackson.core.JsonGenerator
+import com.fasterxml.jackson.core.ObjectCodec
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.annotation.JsonSerialize
+import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
+import com.lithic.api.core.BaseDeserializer
+import com.lithic.api.core.BaseSerializer
import com.lithic.api.core.Enum
import com.lithic.api.core.ExcludeMissing
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
+import com.lithic.api.core.allMaxBy
import com.lithic.api.core.checkKnown
import com.lithic.api.core.checkRequired
+import com.lithic.api.core.getOrThrow
import com.lithic.api.core.toImmutable
import com.lithic.api.errors.LithicInvalidDataException
import java.time.OffsetDateTime
@@ -21,103 +32,75 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
-/** Dispute. */
+/** The Dispute object tracks the progression of a dispute throughout its lifecycle. */
class Dispute
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val token: JsonField,
- private val amount: JsonField,
- private val arbitrationDate: JsonField,
+ private val accountToken: JsonField,
+ private val cardToken: JsonField,
+ private val caseId: JsonField,
private val created: JsonField,
- private val customerFiledDate: JsonField,
- private val customerNote: JsonField,
- private val networkClaimIds: JsonField>,
- private val networkFiledDate: JsonField,
- private val networkReasonCode: JsonField,
- private val prearbitrationDate: JsonField,
- private val primaryClaimId: JsonField,
- private val reason: JsonField,
- private val representmentDate: JsonField,
- private val resolutionDate: JsonField,
- private val resolutionNote: JsonField,
- private val resolutionReason: JsonField,
+ private val currency: JsonField,
+ private val disposition: JsonField,
+ private val events: JsonField>,
+ private val liabilityAllocation: JsonField,
+ private val merchant: JsonField,
+ private val network: JsonField,
private val status: JsonField,
- private val transactionToken: JsonField,
+ private val transactionSeries: JsonField,
+ private val updated: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
@JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
- @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
- @JsonProperty("arbitration_date")
+ @JsonProperty("account_token")
@ExcludeMissing
- arbitrationDate: JsonField = JsonMissing.of(),
+ accountToken: JsonField = JsonMissing.of(),
+ @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(),
+ @JsonProperty("case_id") @ExcludeMissing caseId: JsonField = JsonMissing.of(),
@JsonProperty("created")
@ExcludeMissing
created: JsonField = JsonMissing.of(),
- @JsonProperty("customer_filed_date")
+ @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(),
+ @JsonProperty("disposition")
@ExcludeMissing
- customerFiledDate: JsonField = JsonMissing.of(),
- @JsonProperty("customer_note")
+ disposition: JsonField = JsonMissing.of(),
+ @JsonProperty("events") @ExcludeMissing events: JsonField> = JsonMissing.of(),
+ @JsonProperty("liability_allocation")
@ExcludeMissing
- customerNote: JsonField = JsonMissing.of(),
- @JsonProperty("network_claim_ids")
- @ExcludeMissing
- networkClaimIds: JsonField> = JsonMissing.of(),
- @JsonProperty("network_filed_date")
- @ExcludeMissing
- networkFiledDate: JsonField = JsonMissing.of(),
- @JsonProperty("network_reason_code")
- @ExcludeMissing
- networkReasonCode: JsonField = JsonMissing.of(),
- @JsonProperty("prearbitration_date")
- @ExcludeMissing
- prearbitrationDate: JsonField = JsonMissing.of(),
- @JsonProperty("primary_claim_id")
- @ExcludeMissing
- primaryClaimId: JsonField = JsonMissing.of(),
- @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(),
- @JsonProperty("representment_date")
- @ExcludeMissing
- representmentDate: JsonField = JsonMissing.of(),
- @JsonProperty("resolution_date")
- @ExcludeMissing
- resolutionDate: JsonField = JsonMissing.of(),
- @JsonProperty("resolution_note")
- @ExcludeMissing
- resolutionNote: JsonField = JsonMissing.of(),
- @JsonProperty("resolution_reason")
- @ExcludeMissing
- resolutionReason: JsonField = JsonMissing.of(),
+ liabilityAllocation: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant") @ExcludeMissing merchant: JsonField = JsonMissing.of(),
+ @JsonProperty("network") @ExcludeMissing network: JsonField = JsonMissing.of(),
@JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
- @JsonProperty("transaction_token")
+ @JsonProperty("transaction_series")
+ @ExcludeMissing
+ transactionSeries: JsonField = JsonMissing.of(),
+ @JsonProperty("updated")
@ExcludeMissing
- transactionToken: JsonField = JsonMissing.of(),
+ updated: JsonField = JsonMissing.of(),
) : this(
token,
- amount,
- arbitrationDate,
+ accountToken,
+ cardToken,
+ caseId,
created,
- customerFiledDate,
- customerNote,
- networkClaimIds,
- networkFiledDate,
- networkReasonCode,
- prearbitrationDate,
- primaryClaimId,
- reason,
- representmentDate,
- resolutionDate,
- resolutionNote,
- resolutionReason,
+ currency,
+ disposition,
+ events,
+ liabilityAllocation,
+ merchant,
+ network,
status,
- transactionToken,
+ transactionSeries,
+ updated,
mutableMapOf(),
)
/**
- * Globally unique identifier.
+ * Token assigned by Lithic for the dispute, in UUID format.
*
* @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).
@@ -125,187 +108,109 @@ private constructor(
fun token(): String = token.getRequired("token")
/**
- * Amount under dispute. May be different from the original transaction amount.
+ * Token for the account associated with the dispute, in UUID format.
*
* @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 amount(): Long = amount.getRequired("amount")
-
- /**
- * Date dispute entered arbitration.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun arbitrationDate(): Optional =
- arbitrationDate.getOptional("arbitration_date")
+ fun accountToken(): String = accountToken.getRequired("account_token")
/**
- * Timestamp of when first Dispute was reported.
+ * Token for the card used in the dispute, in UUID format.
*
* @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 created(): OffsetDateTime = created.getRequired("created")
-
- /**
- * Date that the dispute was filed by the customer making the dispute.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun customerFiledDate(): Optional =
- customerFiledDate.getOptional("customer_filed_date")
-
- /**
- * End customer description of the reason for the dispute.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun customerNote(): Optional = customerNote.getOptional("customer_note")
+ fun cardToken(): String = cardToken.getRequired("card_token")
/**
- * Unique identifiers for the dispute from the network.
+ * Identifier assigned by the network for this dispute.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun networkClaimIds(): Optional> = networkClaimIds.getOptional("network_claim_ids")
+ fun caseId(): Optional = caseId.getOptional("case_id")
/**
- * Date that the dispute was submitted to the network.
+ * When the dispute was created.
*
- * @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 networkFiledDate(): Optional =
- networkFiledDate.getOptional("network_filed_date")
+ fun created(): OffsetDateTime = created.getRequired("created")
/**
- * Network reason code used to file the dispute.
+ * Three-letter ISO 4217 currency code.
*
- * @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 networkReasonCode(): Optional = networkReasonCode.getOptional("network_reason_code")
+ fun currency(): String = currency.getRequired("currency")
/**
- * Date dispute entered pre-arbitration.
+ * Dispute resolution outcome
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun prearbitrationDate(): Optional =
- prearbitrationDate.getOptional("prearbitration_date")
+ fun disposition(): Optional = disposition.getOptional("disposition")
/**
- * Unique identifier for the dispute from the network. If there are multiple, this will be the
- * first claim id set by the network
+ * Chronological list of events that have occurred in the dispute lifecycle
*
- * @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 primaryClaimId(): Optional = primaryClaimId.getOptional("primary_claim_id")
+ fun events(): List = events.getRequired("events")
/**
- * Dispute reason:
- * * `ATM_CASH_MISDISPENSE`: ATM cash misdispense.
- * * `CANCELLED`: Transaction was cancelled by the customer.
- * * `DUPLICATED`: The transaction was a duplicate.
- * * `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present.
- * * `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present.
- * * `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable merchant activity.
- * * `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as described.
- * * `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received.
- * * `INCORRECT_AMOUNT`: The transaction amount was incorrect.
- * * `MISSING_AUTH`: The transaction was missing authorization.
- * * `OTHER`: Other reason.
- * * `PROCESSING_ERROR`: Processing error.
- * * `REFUND_NOT_PROCESSED`: The refund was not processed.
- * * `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not cancelled.
+ * Current breakdown of how liability is allocated for the disputed amount
*
* @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 reason(): Reason = reason.getRequired("reason")
+ fun liabilityAllocation(): LiabilityAllocation =
+ liabilityAllocation.getRequired("liability_allocation")
/**
- * Date the representment was received.
- *
- * @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 representmentDate(): Optional =
- representmentDate.getOptional("representment_date")
+ fun merchant(): Merchant = merchant.getRequired("merchant")
/**
- * Date that the dispute was resolved.
+ * Card network handling the dispute.
*
- * @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 resolutionDate(): Optional = resolutionDate.getOptional("resolution_date")
+ fun network(): Network = network.getRequired("network")
/**
- * Note by Dispute team on the case resolution.
+ * Current status of the dispute.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun resolutionNote(): Optional = resolutionNote.getOptional("resolution_note")
+ fun status(): Optional = status.getOptional("status")
/**
- * Reason for the dispute resolution:
- * * `CASE_LOST`: This case was lost at final arbitration.
- * * `NETWORK_REJECTED`: Network rejected.
- * * `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS.
- * * `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold.
- * * `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless.
- * * `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid.
- * * `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks.
- * * `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other.
- * * `PAST_FILING_DATE`: Past filing date.
- * * `PREARBITRATION_REJECTED`: Prearbitration rejected.
- * * `PROCESSOR_REJECTED_OTHER`: Processor rejected, other.
- * * `REFUNDED`: Refunded.
- * * `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback.
- * * `WITHDRAWN`: Withdrawn.
- * * `WON_ARBITRATION`: Won arbitration.
- * * `WON_FIRST_CHARGEBACK`: Won first chargeback.
- * * `WON_PREARBITRATION`: Won prearbitration.
+ * Contains identifiers for the transaction and specific event within being disputed; null if no
+ * transaction can be identified
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun resolutionReason(): Optional =
- resolutionReason.getOptional("resolution_reason")
-
- /**
- * Status types:
- * * `NEW` - New dispute case is opened.
- * * `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more information.
- * * `SUBMITTED` - Dispute is submitted to the card network.
- * * `REPRESENTMENT` - Case has entered second presentment.
- * * `PREARBITRATION` - Case has entered prearbitration.
- * * `ARBITRATION` - Case has entered arbitration.
- * * `CASE_WON` - Case was won and credit will be issued.
- * * `CASE_CLOSED` - Case was lost or withdrawn.
- *
- * @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 status(): Status = status.getRequired("status")
+ fun transactionSeries(): Optional =
+ transactionSeries.getOptional("transaction_series")
/**
- * The transaction that is being disputed. A transaction can only be disputed once but may have
- * multiple dispute cases.
+ * When the dispute was last 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 transactionToken(): String = transactionToken.getRequired("transaction_token")
+ fun updated(): OffsetDateTime = updated.getRequired("updated")
/**
* Returns the raw JSON value of [token].
@@ -315,156 +220,105 @@ private constructor(
@JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token
/**
- * Returns the raw JSON value of [amount].
- *
- * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
-
- /**
- * Returns the raw JSON value of [arbitrationDate].
+ * Returns the raw JSON value of [accountToken].
*
- * Unlike [arbitrationDate], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [accountToken], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("arbitration_date")
+ @JsonProperty("account_token")
@ExcludeMissing
- fun _arbitrationDate(): JsonField = arbitrationDate
+ fun _accountToken(): JsonField = accountToken
/**
- * Returns the raw JSON value of [created].
+ * Returns the raw JSON value of [cardToken].
*
- * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [cardToken], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created
+ @JsonProperty("card_token") @ExcludeMissing fun _cardToken(): JsonField = cardToken
/**
- * Returns the raw JSON value of [customerFiledDate].
+ * Returns the raw JSON value of [caseId].
*
- * Unlike [customerFiledDate], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [caseId], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("customer_filed_date")
- @ExcludeMissing
- fun _customerFiledDate(): JsonField = customerFiledDate
+ @JsonProperty("case_id") @ExcludeMissing fun _caseId(): JsonField = caseId
/**
- * Returns the raw JSON value of [customerNote].
+ * Returns the raw JSON value of [created].
*
- * Unlike [customerNote], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("customer_note")
- @ExcludeMissing
- fun _customerNote(): JsonField = customerNote
+ @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created
/**
- * Returns the raw JSON value of [networkClaimIds].
+ * Returns the raw JSON value of [currency].
*
- * Unlike [networkClaimIds], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("network_claim_ids")
- @ExcludeMissing
- fun _networkClaimIds(): JsonField> = networkClaimIds
+ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
/**
- * Returns the raw JSON value of [networkFiledDate].
+ * Returns the raw JSON value of [disposition].
*
- * Unlike [networkFiledDate], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [disposition], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("network_filed_date")
+ @JsonProperty("disposition")
@ExcludeMissing
- fun _networkFiledDate(): JsonField = networkFiledDate
+ fun _disposition(): JsonField = disposition
/**
- * Returns the raw JSON value of [networkReasonCode].
+ * Returns the raw JSON value of [events].
*
- * Unlike [networkReasonCode], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [events], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("network_reason_code")
- @ExcludeMissing
- fun _networkReasonCode(): JsonField = networkReasonCode
+ @JsonProperty("events") @ExcludeMissing fun _events(): JsonField> = events
/**
- * Returns the raw JSON value of [prearbitrationDate].
+ * Returns the raw JSON value of [liabilityAllocation].
*
- * Unlike [prearbitrationDate], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [liabilityAllocation], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("prearbitration_date")
- @ExcludeMissing
- fun _prearbitrationDate(): JsonField = prearbitrationDate
-
- /**
- * Returns the raw JSON value of [primaryClaimId].
- *
- * Unlike [primaryClaimId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("primary_claim_id")
+ @JsonProperty("liability_allocation")
@ExcludeMissing
- fun _primaryClaimId(): JsonField = primaryClaimId
-
- /**
- * Returns the raw JSON value of [reason].
- *
- * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason
+ fun _liabilityAllocation(): JsonField = liabilityAllocation
/**
- * Returns the raw JSON value of [representmentDate].
+ * Returns the raw JSON value of [merchant].
*
- * Unlike [representmentDate], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [merchant], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("representment_date")
- @ExcludeMissing
- fun _representmentDate(): JsonField = representmentDate
+ @JsonProperty("merchant") @ExcludeMissing fun _merchant(): JsonField = merchant
/**
- * Returns the raw JSON value of [resolutionDate].
+ * Returns the raw JSON value of [network].
*
- * Unlike [resolutionDate], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [network], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("resolution_date")
- @ExcludeMissing
- fun _resolutionDate(): JsonField = resolutionDate
+ @JsonProperty("network") @ExcludeMissing fun _network(): JsonField = network
/**
- * Returns the raw JSON value of [resolutionNote].
+ * Returns the raw JSON value of [status].
*
- * Unlike [resolutionNote], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("resolution_note")
- @ExcludeMissing
- fun _resolutionNote(): JsonField = resolutionNote
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
/**
- * Returns the raw JSON value of [resolutionReason].
+ * Returns the raw JSON value of [transactionSeries].
*
- * Unlike [resolutionReason], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [transactionSeries], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("resolution_reason")
+ @JsonProperty("transaction_series")
@ExcludeMissing
- fun _resolutionReason(): JsonField = resolutionReason
-
- /**
- * Returns the raw JSON value of [status].
- *
- * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+ fun _transactionSeries(): JsonField = transactionSeries
/**
- * Returns the raw JSON value of [transactionToken].
+ * Returns the raw JSON value of [updated].
*
- * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [updated], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("transaction_token")
- @ExcludeMissing
- fun _transactionToken(): JsonField = transactionToken
+ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -486,23 +340,19 @@ private constructor(
* The following fields are required:
* ```java
* .token()
- * .amount()
- * .arbitrationDate()
+ * .accountToken()
+ * .cardToken()
+ * .caseId()
* .created()
- * .customerFiledDate()
- * .customerNote()
- * .networkClaimIds()
- * .networkFiledDate()
- * .networkReasonCode()
- * .prearbitrationDate()
- * .primaryClaimId()
- * .reason()
- * .representmentDate()
- * .resolutionDate()
- * .resolutionNote()
- * .resolutionReason()
+ * .currency()
+ * .disposition()
+ * .events()
+ * .liabilityAllocation()
+ * .merchant()
+ * .network()
* .status()
- * .transactionToken()
+ * .transactionSeries()
+ * .updated()
* ```
*/
@JvmStatic fun builder() = Builder()
@@ -512,49 +362,41 @@ private constructor(
class Builder internal constructor() {
private var token: JsonField? = null
- private var amount: JsonField? = null
- private var arbitrationDate: JsonField? = null
+ private var accountToken: JsonField? = null
+ private var cardToken: JsonField? = null
+ private var caseId: JsonField? = null
private var created: JsonField? = null
- private var customerFiledDate: JsonField? = null
- private var customerNote: JsonField? = null
- private var networkClaimIds: JsonField>? = null
- private var networkFiledDate: JsonField? = null
- private var networkReasonCode: JsonField? = null
- private var prearbitrationDate: JsonField? = null
- private var primaryClaimId: JsonField? = null
- private var reason: JsonField? = null
- private var representmentDate: JsonField? = null
- private var resolutionDate: JsonField? = null
- private var resolutionNote: JsonField? = null
- private var resolutionReason: JsonField? = null
+ private var currency: JsonField? = null
+ private var disposition: JsonField? = null
+ private var events: JsonField>? = null
+ private var liabilityAllocation: JsonField? = null
+ private var merchant: JsonField? = null
+ private var network: JsonField? = null
private var status: JsonField? = null
- private var transactionToken: JsonField? = null
+ private var transactionSeries: JsonField? = null
+ private var updated: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(dispute: Dispute) = apply {
token = dispute.token
- amount = dispute.amount
- arbitrationDate = dispute.arbitrationDate
+ accountToken = dispute.accountToken
+ cardToken = dispute.cardToken
+ caseId = dispute.caseId
created = dispute.created
- customerFiledDate = dispute.customerFiledDate
- customerNote = dispute.customerNote
- networkClaimIds = dispute.networkClaimIds.map { it.toMutableList() }
- networkFiledDate = dispute.networkFiledDate
- networkReasonCode = dispute.networkReasonCode
- prearbitrationDate = dispute.prearbitrationDate
- primaryClaimId = dispute.primaryClaimId
- reason = dispute.reason
- representmentDate = dispute.representmentDate
- resolutionDate = dispute.resolutionDate
- resolutionNote = dispute.resolutionNote
- resolutionReason = dispute.resolutionReason
+ currency = dispute.currency
+ disposition = dispute.disposition
+ events = dispute.events.map { it.toMutableList() }
+ liabilityAllocation = dispute.liabilityAllocation
+ merchant = dispute.merchant
+ network = dispute.network
status = dispute.status
- transactionToken = dispute.transactionToken
+ transactionSeries = dispute.transactionSeries
+ updated = dispute.updated
additionalProperties = dispute.additionalProperties.toMutableMap()
}
- /** Globally unique identifier. */
+ /** Token assigned by Lithic for the dispute, in UUID format. */
fun token(token: String) = token(JsonField.of(token))
/**
@@ -565,37 +407,47 @@ private constructor(
*/
fun token(token: JsonField) = apply { this.token = token }
- /** Amount under dispute. May be different from the original transaction amount. */
- fun amount(amount: Long) = amount(JsonField.of(amount))
+ /** Token for the account associated with the dispute, in UUID format. */
+ fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken))
/**
- * Sets [Builder.amount] to an arbitrary JSON value.
+ * Sets [Builder.accountToken] to an arbitrary JSON value.
*
- * You should usually call [Builder.amount] with a well-typed [Long] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
+ * You should usually call [Builder.accountToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun accountToken(accountToken: JsonField) = apply {
+ this.accountToken = accountToken
+ }
+
+ /** Token for the card used in the dispute, in UUID format. */
+ 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 amount(amount: JsonField