diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 2969a756f..820b5c1ae 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.111.0"
+ ".": "0.112.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index a080bc222..9462bec8d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 168
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c3f6c23018d70fd1b259b21cfd377b5d905872f0d3c5ce2cdb8013f4b6daa338.yml
-openapi_spec_hash: b551344da9d29eb4c5374874ed84a9b0
-config_hash: 012f050e575d1bbfe8db56a9eeaa5fcd
+configured_endpoints: 172
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e1901db484e520cc1f6aa88c8b00d0fcda30c8f9e5ea562a12b9edfc3fb3b6d6.yml
+openapi_spec_hash: 59c317749628f3ed4cc7911b68f6351f
+config_hash: aab05d0cf41f1f6b9f4d5677273c1600
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb9a97459..2e2469475 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,25 @@
# Changelog
+## 0.112.0 (2025-11-17)
+
+Full Changelog: [v0.111.0...v0.112.0](https://github.com/lithic-com/lithic-java/compare/v0.111.0...v0.112.0)
+
+### Features
+
+* **api:** add disputes V2 endpoints ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+* **api:** add return payment method ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+* **api:** add Tokenization and ACH Rules ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+* **api:** add unpause external_bank_accounts API method ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+* **api:** extract some common schemas into models ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+
+
+### Bug Fixes
+
+* **api:** add type guards to ConditionalValue deserializer ([dbd6653](https://github.com/lithic-com/lithic-java/commit/dbd665344d8cc3213a31c65b8bd22a2490085be4))
+* **api:** change allowed phone number length from 18 to 16 ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+* **api:** mark certain optional fields as nullable ([ff8ebce](https://github.com/lithic-com/lithic-java/commit/ff8ebce11768f9f6993d13140fdd906d725d8b44))
+* **format:** remove extraneous blank line in dispute service imports ([57ec41a](https://github.com/lithic-com/lithic-java/commit/57ec41a0bfbd4385ec76dbb4d4d6901c7b838ce0))
+
## 0.111.0 (2025-11-13)
Full Changelog: [v0.110.0...v0.111.0](https://github.com/lithic-com/lithic-java/compare/v0.110.0...v0.111.0)
diff --git a/README.md b/README.md
index 286679aea..2e03962db 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.111.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.111.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.112.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.112.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.111.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.112.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.111.0")
+implementation("com.lithic.api:lithic-java:0.112.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.111.0")
com.lithic.api
lithic-java
- 0.111.0
+ 0.112.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index d50b65125..ebb49cb87 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.111.0" // x-release-please-version
+ version = "0.112.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt
index 19d433991..4d7561aea 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt
@@ -21,6 +21,7 @@ import com.lithic.api.services.blocking.CardService
import com.lithic.api.services.blocking.CreditProductService
import com.lithic.api.services.blocking.DigitalCardArtService
import com.lithic.api.services.blocking.DisputeService
+import com.lithic.api.services.blocking.DisputesV2Service
import com.lithic.api.services.blocking.EventService
import com.lithic.api.services.blocking.ExternalBankAccountService
import com.lithic.api.services.blocking.ExternalPaymentService
@@ -96,6 +97,8 @@ interface LithicClient {
fun disputes(): DisputeService
+ fun disputesV2(): DisputesV2Service
+
fun events(): EventService
fun transfers(): TransferService
@@ -196,6 +199,8 @@ interface LithicClient {
fun disputes(): DisputeService.WithRawResponse
+ fun disputesV2(): DisputesV2Service.WithRawResponse
+
fun events(): EventService.WithRawResponse
fun transfers(): TransferService.WithRawResponse
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt
index 63aa8975b..e8aa12038 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt
@@ -20,6 +20,7 @@ import com.lithic.api.services.async.CardServiceAsync
import com.lithic.api.services.async.CreditProductServiceAsync
import com.lithic.api.services.async.DigitalCardArtServiceAsync
import com.lithic.api.services.async.DisputeServiceAsync
+import com.lithic.api.services.async.DisputesV2ServiceAsync
import com.lithic.api.services.async.EventServiceAsync
import com.lithic.api.services.async.ExternalBankAccountServiceAsync
import com.lithic.api.services.async.ExternalPaymentServiceAsync
@@ -96,6 +97,8 @@ interface LithicClientAsync {
fun disputes(): DisputeServiceAsync
+ fun disputesV2(): DisputesV2ServiceAsync
+
fun events(): EventServiceAsync
fun transfers(): TransferServiceAsync
@@ -199,6 +202,8 @@ interface LithicClientAsync {
fun disputes(): DisputeServiceAsync.WithRawResponse
+ fun disputesV2(): DisputesV2ServiceAsync.WithRawResponse
+
fun events(): EventServiceAsync.WithRawResponse
fun transfers(): TransferServiceAsync.WithRawResponse
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt
index d0a10d637..ec4117127 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt
@@ -43,6 +43,8 @@ import com.lithic.api.services.async.DigitalCardArtServiceAsync
import com.lithic.api.services.async.DigitalCardArtServiceAsyncImpl
import com.lithic.api.services.async.DisputeServiceAsync
import com.lithic.api.services.async.DisputeServiceAsyncImpl
+import com.lithic.api.services.async.DisputesV2ServiceAsync
+import com.lithic.api.services.async.DisputesV2ServiceAsyncImpl
import com.lithic.api.services.async.EventServiceAsync
import com.lithic.api.services.async.EventServiceAsyncImpl
import com.lithic.api.services.async.ExternalBankAccountServiceAsync
@@ -135,6 +137,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
DisputeServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val disputesV2: DisputesV2ServiceAsync by lazy {
+ DisputesV2ServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
private val events: EventServiceAsync by lazy {
EventServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -241,6 +247,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
override fun disputes(): DisputeServiceAsync = disputes
+ override fun disputesV2(): DisputesV2ServiceAsync = disputesV2
+
override fun events(): EventServiceAsync = events
override fun transfers(): TransferServiceAsync = transfers
@@ -337,6 +345,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
DisputeServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val disputesV2: DisputesV2ServiceAsync.WithRawResponse by lazy {
+ DisputesV2ServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val events: EventServiceAsync.WithRawResponse by lazy {
EventServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -443,6 +455,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
override fun disputes(): DisputeServiceAsync.WithRawResponse = disputes
+ override fun disputesV2(): DisputesV2ServiceAsync.WithRawResponse = disputesV2
+
override fun events(): EventServiceAsync.WithRawResponse = events
override fun transfers(): TransferServiceAsync.WithRawResponse = transfers
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt
index 7be47434e..f3e4589f0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt
@@ -43,6 +43,8 @@ import com.lithic.api.services.blocking.DigitalCardArtService
import com.lithic.api.services.blocking.DigitalCardArtServiceImpl
import com.lithic.api.services.blocking.DisputeService
import com.lithic.api.services.blocking.DisputeServiceImpl
+import com.lithic.api.services.blocking.DisputesV2Service
+import com.lithic.api.services.blocking.DisputesV2ServiceImpl
import com.lithic.api.services.blocking.EventService
import com.lithic.api.services.blocking.EventServiceImpl
import com.lithic.api.services.blocking.ExternalBankAccountService
@@ -128,6 +130,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
private val disputes: DisputeService by lazy { DisputeServiceImpl(clientOptionsWithUserAgent) }
+ private val disputesV2: DisputesV2Service by lazy {
+ DisputesV2ServiceImpl(clientOptionsWithUserAgent)
+ }
+
private val events: EventService by lazy { EventServiceImpl(clientOptionsWithUserAgent) }
private val transfers: TransferService by lazy {
@@ -223,6 +229,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
override fun disputes(): DisputeService = disputes
+ override fun disputesV2(): DisputesV2Service = disputesV2
+
override fun events(): EventService = events
override fun transfers(): TransferService = transfers
@@ -319,6 +327,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
DisputeServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val disputesV2: DisputesV2Service.WithRawResponse by lazy {
+ DisputesV2ServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val events: EventService.WithRawResponse by lazy {
EventServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -425,6 +437,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
override fun disputes(): DisputeService.WithRawResponse = disputes
+ override fun disputesV2(): DisputesV2Service.WithRawResponse = disputesV2
+
override fun events(): EventService.WithRawResponse = events
override fun transfers(): TransferService.WithRawResponse = transfers
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 cb3b40b2d..a9f83fd75 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
@@ -1230,997 +1230,6 @@ private constructor(
override fun toString() = value.toString()
}
- /** Financial Event */
- class FinancialEvent
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val token: JsonField,
- private val amount: JsonField,
- private val created: JsonField,
- private val result: JsonField,
- private val type: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
- @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
- @JsonProperty("created")
- @ExcludeMissing
- created: JsonField = JsonMissing.of(),
- @JsonProperty("result")
- @ExcludeMissing
- result: JsonField = JsonMissing.of(),
- @JsonProperty("type")
- @ExcludeMissing
- type: JsonField = JsonMissing.of(),
- ) : this(token, amount, created, result, type, mutableMapOf())
-
- /**
- * Globally unique identifier.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun token(): Optional = token.getOptional("token")
-
- /**
- * Amount of the financial event that has been settled in the currency's smallest unit
- * (e.g., cents).
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun amount(): Optional = amount.getOptional("amount")
-
- /**
- * Date and time when the financial event occurred. UTC time zone.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun created(): Optional = created.getOptional("created")
-
- /**
- * APPROVED financial events were successful while DECLINED financial events were
- * declined by user, Lithic, or the network.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun result(): Optional = result.getOptional("result")
-
- /**
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun type(): Optional = type.getOptional("type")
-
- /**
- * Returns the raw JSON value of [token].
- *
- * Unlike [token], this method doesn't throw if the JSON field has an unexpected type.
- */
- @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 [created].
- *
- * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("created")
- @ExcludeMissing
- fun _created(): JsonField = created
-
- /**
- * Returns the raw JSON value of [result].
- *
- * Unlike [result], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("result") @ExcludeMissing fun _result(): JsonField = result
-
- /**
- * Returns the raw JSON value of [type].
- *
- * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [FinancialEvent]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [FinancialEvent]. */
- class Builder internal constructor() {
-
- private var token: JsonField = JsonMissing.of()
- private var amount: JsonField = JsonMissing.of()
- private var created: JsonField = JsonMissing.of()
- private var result: JsonField = JsonMissing.of()
- private var type: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(financialEvent: FinancialEvent) = apply {
- token = financialEvent.token
- amount = financialEvent.amount
- created = financialEvent.created
- result = financialEvent.result
- type = financialEvent.type
- additionalProperties = financialEvent.additionalProperties.toMutableMap()
- }
-
- /** Globally unique identifier. */
- fun token(token: String) = token(JsonField.of(token))
-
- /**
- * Sets [Builder.token] to an arbitrary JSON value.
- *
- * You should usually call [Builder.token] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun token(token: JsonField) = apply { this.token = token }
-
- /**
- * Amount of the financial event that has been settled in the currency's smallest
- * unit (e.g., cents).
- */
- fun amount(amount: Long) = amount(JsonField.of(amount))
-
- /**
- * Sets [Builder.amount] 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.
- */
- fun amount(amount: JsonField) = apply { this.amount = amount }
-
- /** Date and time when the financial event occurred. UTC time zone. */
- fun created(created: OffsetDateTime) = created(JsonField.of(created))
-
- /**
- * Sets [Builder.created] to an arbitrary JSON value.
- *
- * You should usually call [Builder.created] with a well-typed [OffsetDateTime]
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun created(created: JsonField) = apply { this.created = created }
-
- /**
- * APPROVED financial events were successful while DECLINED financial events were
- * declined by user, Lithic, or the network.
- */
- fun result(result: Result) = result(JsonField.of(result))
-
- /**
- * Sets [Builder.result] to an arbitrary JSON value.
- *
- * You should usually call [Builder.result] with a well-typed [Result] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun result(result: JsonField) = apply { this.result = result }
-
- fun type(type: FinancialEventType) = type(JsonField.of(type))
-
- /**
- * Sets [Builder.type] to an arbitrary JSON value.
- *
- * You should usually call [Builder.type] with a well-typed [FinancialEventType]
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun type(type: JsonField) = apply { this.type = type }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [FinancialEvent].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): FinancialEvent =
- FinancialEvent(
- token,
- amount,
- created,
- result,
- type,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): FinancialEvent = apply {
- if (validated) {
- return@apply
- }
-
- token()
- amount()
- created()
- result().ifPresent { it.validate() }
- type().ifPresent { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (token.asKnown().isPresent) 1 else 0) +
- (if (amount.asKnown().isPresent) 1 else 0) +
- (if (created.asKnown().isPresent) 1 else 0) +
- (result.asKnown().getOrNull()?.validity() ?: 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /**
- * APPROVED financial events were successful while DECLINED financial events were
- * declined by user, Lithic, or the network.
- */
- class Result @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 APPROVED = of("APPROVED")
-
- @JvmField val DECLINED = of("DECLINED")
-
- @JvmStatic fun of(value: String) = Result(JsonField.of(value))
- }
-
- /** An enum containing [Result]'s known values. */
- enum class Known {
- APPROVED,
- DECLINED,
- }
-
- /**
- * An enum containing [Result]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [Result] 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 {
- APPROVED,
- DECLINED,
- /**
- * An enum member indicating that [Result] 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) {
- APPROVED -> Value.APPROVED
- DECLINED -> Value.DECLINED
- 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) {
- APPROVED -> Known.APPROVED
- DECLINED -> Known.DECLINED
- else -> throw LithicInvalidDataException("Unknown Result: $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(): Result = 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 Result && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class FinancialEventType
- @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 ACH_ORIGINATION_CANCELLED = of("ACH_ORIGINATION_CANCELLED")
-
- @JvmField val ACH_ORIGINATION_INITIATED = of("ACH_ORIGINATION_INITIATED")
-
- @JvmField val ACH_ORIGINATION_PROCESSED = of("ACH_ORIGINATION_PROCESSED")
-
- @JvmField val ACH_ORIGINATION_RELEASED = of("ACH_ORIGINATION_RELEASED")
-
- @JvmField val ACH_ORIGINATION_REJECTED = of("ACH_ORIGINATION_REJECTED")
-
- @JvmField val ACH_ORIGINATION_REVIEWED = of("ACH_ORIGINATION_REVIEWED")
-
- @JvmField val ACH_ORIGINATION_SETTLED = of("ACH_ORIGINATION_SETTLED")
-
- @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")
-
- @JvmField val ACH_RETURN_PROCESSED = of("ACH_RETURN_PROCESSED")
-
- @JvmField val ACH_RETURN_REJECTED = of("ACH_RETURN_REJECTED")
-
- @JvmField val ACH_RETURN_SETTLED = of("ACH_RETURN_SETTLED")
-
- @JvmField val AUTHORIZATION = of("AUTHORIZATION")
-
- @JvmField val AUTHORIZATION_ADVICE = of("AUTHORIZATION_ADVICE")
-
- @JvmField val AUTHORIZATION_EXPIRY = of("AUTHORIZATION_EXPIRY")
-
- @JvmField val AUTHORIZATION_REVERSAL = of("AUTHORIZATION_REVERSAL")
-
- @JvmField val BALANCE_INQUIRY = of("BALANCE_INQUIRY")
-
- @JvmField val BILLING_ERROR = of("BILLING_ERROR")
-
- @JvmField val BILLING_ERROR_REVERSAL = of("BILLING_ERROR_REVERSAL")
-
- @JvmField val CARD_TO_CARD = of("CARD_TO_CARD")
-
- @JvmField val CASH_BACK = of("CASH_BACK")
-
- @JvmField val CASH_BACK_REVERSAL = of("CASH_BACK_REVERSAL")
-
- @JvmField val CLEARING = of("CLEARING")
-
- @JvmField val COLLECTION = of("COLLECTION")
-
- @JvmField val CORRECTION_CREDIT = of("CORRECTION_CREDIT")
-
- @JvmField val CORRECTION_DEBIT = of("CORRECTION_DEBIT")
-
- @JvmField val CREDIT_AUTHORIZATION = of("CREDIT_AUTHORIZATION")
-
- @JvmField val CREDIT_AUTHORIZATION_ADVICE = of("CREDIT_AUTHORIZATION_ADVICE")
-
- @JvmField val CURRENCY_CONVERSION = of("CURRENCY_CONVERSION")
-
- @JvmField val CURRENCY_CONVERSION_REVERSAL = of("CURRENCY_CONVERSION_REVERSAL")
-
- @JvmField val DISPUTE_WON = of("DISPUTE_WON")
-
- @JvmField val EXTERNAL_ACH_CANCELED = of("EXTERNAL_ACH_CANCELED")
-
- @JvmField val EXTERNAL_ACH_INITIATED = of("EXTERNAL_ACH_INITIATED")
-
- @JvmField val EXTERNAL_ACH_RELEASED = of("EXTERNAL_ACH_RELEASED")
-
- @JvmField val EXTERNAL_ACH_REVERSED = of("EXTERNAL_ACH_REVERSED")
-
- @JvmField val EXTERNAL_ACH_SETTLED = of("EXTERNAL_ACH_SETTLED")
-
- @JvmField val EXTERNAL_CHECK_CANCELED = of("EXTERNAL_CHECK_CANCELED")
-
- @JvmField val EXTERNAL_CHECK_INITIATED = of("EXTERNAL_CHECK_INITIATED")
-
- @JvmField val EXTERNAL_CHECK_RELEASED = of("EXTERNAL_CHECK_RELEASED")
-
- @JvmField val EXTERNAL_CHECK_REVERSED = of("EXTERNAL_CHECK_REVERSED")
-
- @JvmField val EXTERNAL_CHECK_SETTLED = of("EXTERNAL_CHECK_SETTLED")
-
- @JvmField val EXTERNAL_TRANSFER_CANCELED = of("EXTERNAL_TRANSFER_CANCELED")
-
- @JvmField val EXTERNAL_TRANSFER_INITIATED = of("EXTERNAL_TRANSFER_INITIATED")
-
- @JvmField val EXTERNAL_TRANSFER_RELEASED = of("EXTERNAL_TRANSFER_RELEASED")
-
- @JvmField val EXTERNAL_TRANSFER_REVERSED = of("EXTERNAL_TRANSFER_REVERSED")
-
- @JvmField val EXTERNAL_TRANSFER_SETTLED = of("EXTERNAL_TRANSFER_SETTLED")
-
- @JvmField val EXTERNAL_WIRE_CANCELED = of("EXTERNAL_WIRE_CANCELED")
-
- @JvmField val EXTERNAL_WIRE_INITIATED = of("EXTERNAL_WIRE_INITIATED")
-
- @JvmField val EXTERNAL_WIRE_RELEASED = of("EXTERNAL_WIRE_RELEASED")
-
- @JvmField val EXTERNAL_WIRE_REVERSED = of("EXTERNAL_WIRE_REVERSED")
-
- @JvmField val EXTERNAL_WIRE_SETTLED = of("EXTERNAL_WIRE_SETTLED")
-
- @JvmField val FINANCIAL_AUTHORIZATION = of("FINANCIAL_AUTHORIZATION")
-
- @JvmField
- val FINANCIAL_CREDIT_AUTHORIZATION = of("FINANCIAL_CREDIT_AUTHORIZATION")
-
- @JvmField val INTEREST = of("INTEREST")
-
- @JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL")
-
- @JvmField val INTERNAL_ADJUSTMENT = of("INTERNAL_ADJUSTMENT")
-
- @JvmField val LATE_PAYMENT = of("LATE_PAYMENT")
-
- @JvmField val LATE_PAYMENT_REVERSAL = of("LATE_PAYMENT_REVERSAL")
-
- @JvmField val LOSS_WRITE_OFF = of("LOSS_WRITE_OFF")
-
- @JvmField val PROVISIONAL_CREDIT = of("PROVISIONAL_CREDIT")
-
- @JvmField val PROVISIONAL_CREDIT_REVERSAL = of("PROVISIONAL_CREDIT_REVERSAL")
-
- @JvmField val SERVICE = of("SERVICE")
-
- @JvmField val RETURN = of("RETURN")
-
- @JvmField val RETURN_REVERSAL = of("RETURN_REVERSAL")
-
- @JvmField val TRANSFER = of("TRANSFER")
-
- @JvmField val TRANSFER_INSUFFICIENT_FUNDS = of("TRANSFER_INSUFFICIENT_FUNDS")
-
- @JvmField val RETURNED_PAYMENT = of("RETURNED_PAYMENT")
-
- @JvmField val RETURNED_PAYMENT_REVERSAL = of("RETURNED_PAYMENT_REVERSAL")
-
- @JvmField val LITHIC_NETWORK_PAYMENT = of("LITHIC_NETWORK_PAYMENT")
-
- @JvmStatic fun of(value: String) = FinancialEventType(JsonField.of(value))
- }
-
- /** An enum containing [FinancialEventType]'s known values. */
- enum class Known {
- ACH_ORIGINATION_CANCELLED,
- ACH_ORIGINATION_INITIATED,
- ACH_ORIGINATION_PROCESSED,
- ACH_ORIGINATION_RELEASED,
- ACH_ORIGINATION_REJECTED,
- ACH_ORIGINATION_REVIEWED,
- ACH_ORIGINATION_SETTLED,
- ACH_RECEIPT_PROCESSED,
- ACH_RECEIPT_RELEASED,
- ACH_RECEIPT_SETTLED,
- ACH_RETURN_INITIATED,
- ACH_RETURN_PROCESSED,
- ACH_RETURN_REJECTED,
- ACH_RETURN_SETTLED,
- AUTHORIZATION,
- AUTHORIZATION_ADVICE,
- AUTHORIZATION_EXPIRY,
- AUTHORIZATION_REVERSAL,
- BALANCE_INQUIRY,
- BILLING_ERROR,
- BILLING_ERROR_REVERSAL,
- CARD_TO_CARD,
- CASH_BACK,
- CASH_BACK_REVERSAL,
- CLEARING,
- COLLECTION,
- CORRECTION_CREDIT,
- CORRECTION_DEBIT,
- CREDIT_AUTHORIZATION,
- CREDIT_AUTHORIZATION_ADVICE,
- CURRENCY_CONVERSION,
- CURRENCY_CONVERSION_REVERSAL,
- DISPUTE_WON,
- EXTERNAL_ACH_CANCELED,
- EXTERNAL_ACH_INITIATED,
- EXTERNAL_ACH_RELEASED,
- EXTERNAL_ACH_REVERSED,
- EXTERNAL_ACH_SETTLED,
- EXTERNAL_CHECK_CANCELED,
- EXTERNAL_CHECK_INITIATED,
- EXTERNAL_CHECK_RELEASED,
- EXTERNAL_CHECK_REVERSED,
- EXTERNAL_CHECK_SETTLED,
- EXTERNAL_TRANSFER_CANCELED,
- EXTERNAL_TRANSFER_INITIATED,
- EXTERNAL_TRANSFER_RELEASED,
- EXTERNAL_TRANSFER_REVERSED,
- EXTERNAL_TRANSFER_SETTLED,
- EXTERNAL_WIRE_CANCELED,
- EXTERNAL_WIRE_INITIATED,
- EXTERNAL_WIRE_RELEASED,
- EXTERNAL_WIRE_REVERSED,
- EXTERNAL_WIRE_SETTLED,
- FINANCIAL_AUTHORIZATION,
- FINANCIAL_CREDIT_AUTHORIZATION,
- INTEREST,
- INTEREST_REVERSAL,
- INTERNAL_ADJUSTMENT,
- LATE_PAYMENT,
- LATE_PAYMENT_REVERSAL,
- LOSS_WRITE_OFF,
- PROVISIONAL_CREDIT,
- PROVISIONAL_CREDIT_REVERSAL,
- SERVICE,
- RETURN,
- RETURN_REVERSAL,
- TRANSFER,
- TRANSFER_INSUFFICIENT_FUNDS,
- RETURNED_PAYMENT,
- RETURNED_PAYMENT_REVERSAL,
- LITHIC_NETWORK_PAYMENT,
- }
-
- /**
- * An enum containing [FinancialEventType]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [FinancialEventType] 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 {
- ACH_ORIGINATION_CANCELLED,
- ACH_ORIGINATION_INITIATED,
- ACH_ORIGINATION_PROCESSED,
- ACH_ORIGINATION_RELEASED,
- ACH_ORIGINATION_REJECTED,
- ACH_ORIGINATION_REVIEWED,
- ACH_ORIGINATION_SETTLED,
- ACH_RECEIPT_PROCESSED,
- ACH_RECEIPT_RELEASED,
- ACH_RECEIPT_SETTLED,
- ACH_RETURN_INITIATED,
- ACH_RETURN_PROCESSED,
- ACH_RETURN_REJECTED,
- ACH_RETURN_SETTLED,
- AUTHORIZATION,
- AUTHORIZATION_ADVICE,
- AUTHORIZATION_EXPIRY,
- AUTHORIZATION_REVERSAL,
- BALANCE_INQUIRY,
- BILLING_ERROR,
- BILLING_ERROR_REVERSAL,
- CARD_TO_CARD,
- CASH_BACK,
- CASH_BACK_REVERSAL,
- CLEARING,
- COLLECTION,
- CORRECTION_CREDIT,
- CORRECTION_DEBIT,
- CREDIT_AUTHORIZATION,
- CREDIT_AUTHORIZATION_ADVICE,
- CURRENCY_CONVERSION,
- CURRENCY_CONVERSION_REVERSAL,
- DISPUTE_WON,
- EXTERNAL_ACH_CANCELED,
- EXTERNAL_ACH_INITIATED,
- EXTERNAL_ACH_RELEASED,
- EXTERNAL_ACH_REVERSED,
- EXTERNAL_ACH_SETTLED,
- EXTERNAL_CHECK_CANCELED,
- EXTERNAL_CHECK_INITIATED,
- EXTERNAL_CHECK_RELEASED,
- EXTERNAL_CHECK_REVERSED,
- EXTERNAL_CHECK_SETTLED,
- EXTERNAL_TRANSFER_CANCELED,
- EXTERNAL_TRANSFER_INITIATED,
- EXTERNAL_TRANSFER_RELEASED,
- EXTERNAL_TRANSFER_REVERSED,
- EXTERNAL_TRANSFER_SETTLED,
- EXTERNAL_WIRE_CANCELED,
- EXTERNAL_WIRE_INITIATED,
- EXTERNAL_WIRE_RELEASED,
- EXTERNAL_WIRE_REVERSED,
- EXTERNAL_WIRE_SETTLED,
- FINANCIAL_AUTHORIZATION,
- FINANCIAL_CREDIT_AUTHORIZATION,
- INTEREST,
- INTEREST_REVERSAL,
- INTERNAL_ADJUSTMENT,
- LATE_PAYMENT,
- LATE_PAYMENT_REVERSAL,
- LOSS_WRITE_OFF,
- PROVISIONAL_CREDIT,
- PROVISIONAL_CREDIT_REVERSAL,
- SERVICE,
- RETURN,
- RETURN_REVERSAL,
- TRANSFER,
- TRANSFER_INSUFFICIENT_FUNDS,
- RETURNED_PAYMENT,
- RETURNED_PAYMENT_REVERSAL,
- LITHIC_NETWORK_PAYMENT,
- /**
- * An enum member indicating that [FinancialEventType] 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) {
- ACH_ORIGINATION_CANCELLED -> Value.ACH_ORIGINATION_CANCELLED
- ACH_ORIGINATION_INITIATED -> Value.ACH_ORIGINATION_INITIATED
- ACH_ORIGINATION_PROCESSED -> Value.ACH_ORIGINATION_PROCESSED
- ACH_ORIGINATION_RELEASED -> Value.ACH_ORIGINATION_RELEASED
- ACH_ORIGINATION_REJECTED -> Value.ACH_ORIGINATION_REJECTED
- 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
- ACH_RETURN_REJECTED -> Value.ACH_RETURN_REJECTED
- ACH_RETURN_SETTLED -> Value.ACH_RETURN_SETTLED
- AUTHORIZATION -> Value.AUTHORIZATION
- AUTHORIZATION_ADVICE -> Value.AUTHORIZATION_ADVICE
- AUTHORIZATION_EXPIRY -> Value.AUTHORIZATION_EXPIRY
- AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL
- BALANCE_INQUIRY -> Value.BALANCE_INQUIRY
- BILLING_ERROR -> Value.BILLING_ERROR
- BILLING_ERROR_REVERSAL -> Value.BILLING_ERROR_REVERSAL
- CARD_TO_CARD -> Value.CARD_TO_CARD
- CASH_BACK -> Value.CASH_BACK
- CASH_BACK_REVERSAL -> Value.CASH_BACK_REVERSAL
- CLEARING -> Value.CLEARING
- COLLECTION -> Value.COLLECTION
- CORRECTION_CREDIT -> Value.CORRECTION_CREDIT
- CORRECTION_DEBIT -> Value.CORRECTION_DEBIT
- CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION
- CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE
- CURRENCY_CONVERSION -> Value.CURRENCY_CONVERSION
- CURRENCY_CONVERSION_REVERSAL -> Value.CURRENCY_CONVERSION_REVERSAL
- DISPUTE_WON -> Value.DISPUTE_WON
- EXTERNAL_ACH_CANCELED -> Value.EXTERNAL_ACH_CANCELED
- EXTERNAL_ACH_INITIATED -> Value.EXTERNAL_ACH_INITIATED
- EXTERNAL_ACH_RELEASED -> Value.EXTERNAL_ACH_RELEASED
- EXTERNAL_ACH_REVERSED -> Value.EXTERNAL_ACH_REVERSED
- EXTERNAL_ACH_SETTLED -> Value.EXTERNAL_ACH_SETTLED
- EXTERNAL_CHECK_CANCELED -> Value.EXTERNAL_CHECK_CANCELED
- EXTERNAL_CHECK_INITIATED -> Value.EXTERNAL_CHECK_INITIATED
- EXTERNAL_CHECK_RELEASED -> Value.EXTERNAL_CHECK_RELEASED
- EXTERNAL_CHECK_REVERSED -> Value.EXTERNAL_CHECK_REVERSED
- EXTERNAL_CHECK_SETTLED -> Value.EXTERNAL_CHECK_SETTLED
- EXTERNAL_TRANSFER_CANCELED -> Value.EXTERNAL_TRANSFER_CANCELED
- EXTERNAL_TRANSFER_INITIATED -> Value.EXTERNAL_TRANSFER_INITIATED
- EXTERNAL_TRANSFER_RELEASED -> Value.EXTERNAL_TRANSFER_RELEASED
- EXTERNAL_TRANSFER_REVERSED -> Value.EXTERNAL_TRANSFER_REVERSED
- EXTERNAL_TRANSFER_SETTLED -> Value.EXTERNAL_TRANSFER_SETTLED
- EXTERNAL_WIRE_CANCELED -> Value.EXTERNAL_WIRE_CANCELED
- EXTERNAL_WIRE_INITIATED -> Value.EXTERNAL_WIRE_INITIATED
- EXTERNAL_WIRE_RELEASED -> Value.EXTERNAL_WIRE_RELEASED
- EXTERNAL_WIRE_REVERSED -> Value.EXTERNAL_WIRE_REVERSED
- EXTERNAL_WIRE_SETTLED -> Value.EXTERNAL_WIRE_SETTLED
- FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION
- FINANCIAL_CREDIT_AUTHORIZATION -> Value.FINANCIAL_CREDIT_AUTHORIZATION
- INTEREST -> Value.INTEREST
- INTEREST_REVERSAL -> Value.INTEREST_REVERSAL
- INTERNAL_ADJUSTMENT -> Value.INTERNAL_ADJUSTMENT
- LATE_PAYMENT -> Value.LATE_PAYMENT
- LATE_PAYMENT_REVERSAL -> Value.LATE_PAYMENT_REVERSAL
- LOSS_WRITE_OFF -> Value.LOSS_WRITE_OFF
- PROVISIONAL_CREDIT -> Value.PROVISIONAL_CREDIT
- PROVISIONAL_CREDIT_REVERSAL -> Value.PROVISIONAL_CREDIT_REVERSAL
- SERVICE -> Value.SERVICE
- RETURN -> Value.RETURN
- RETURN_REVERSAL -> Value.RETURN_REVERSAL
- TRANSFER -> Value.TRANSFER
- TRANSFER_INSUFFICIENT_FUNDS -> Value.TRANSFER_INSUFFICIENT_FUNDS
- RETURNED_PAYMENT -> Value.RETURNED_PAYMENT
- RETURNED_PAYMENT_REVERSAL -> Value.RETURNED_PAYMENT_REVERSAL
- LITHIC_NETWORK_PAYMENT -> Value.LITHIC_NETWORK_PAYMENT
- 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) {
- ACH_ORIGINATION_CANCELLED -> Known.ACH_ORIGINATION_CANCELLED
- ACH_ORIGINATION_INITIATED -> Known.ACH_ORIGINATION_INITIATED
- ACH_ORIGINATION_PROCESSED -> Known.ACH_ORIGINATION_PROCESSED
- ACH_ORIGINATION_RELEASED -> Known.ACH_ORIGINATION_RELEASED
- ACH_ORIGINATION_REJECTED -> Known.ACH_ORIGINATION_REJECTED
- 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
- ACH_RETURN_REJECTED -> Known.ACH_RETURN_REJECTED
- ACH_RETURN_SETTLED -> Known.ACH_RETURN_SETTLED
- AUTHORIZATION -> Known.AUTHORIZATION
- AUTHORIZATION_ADVICE -> Known.AUTHORIZATION_ADVICE
- AUTHORIZATION_EXPIRY -> Known.AUTHORIZATION_EXPIRY
- AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL
- BALANCE_INQUIRY -> Known.BALANCE_INQUIRY
- BILLING_ERROR -> Known.BILLING_ERROR
- BILLING_ERROR_REVERSAL -> Known.BILLING_ERROR_REVERSAL
- CARD_TO_CARD -> Known.CARD_TO_CARD
- CASH_BACK -> Known.CASH_BACK
- CASH_BACK_REVERSAL -> Known.CASH_BACK_REVERSAL
- CLEARING -> Known.CLEARING
- COLLECTION -> Known.COLLECTION
- CORRECTION_CREDIT -> Known.CORRECTION_CREDIT
- CORRECTION_DEBIT -> Known.CORRECTION_DEBIT
- CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION
- CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE
- CURRENCY_CONVERSION -> Known.CURRENCY_CONVERSION
- CURRENCY_CONVERSION_REVERSAL -> Known.CURRENCY_CONVERSION_REVERSAL
- DISPUTE_WON -> Known.DISPUTE_WON
- EXTERNAL_ACH_CANCELED -> Known.EXTERNAL_ACH_CANCELED
- EXTERNAL_ACH_INITIATED -> Known.EXTERNAL_ACH_INITIATED
- EXTERNAL_ACH_RELEASED -> Known.EXTERNAL_ACH_RELEASED
- EXTERNAL_ACH_REVERSED -> Known.EXTERNAL_ACH_REVERSED
- EXTERNAL_ACH_SETTLED -> Known.EXTERNAL_ACH_SETTLED
- EXTERNAL_CHECK_CANCELED -> Known.EXTERNAL_CHECK_CANCELED
- EXTERNAL_CHECK_INITIATED -> Known.EXTERNAL_CHECK_INITIATED
- EXTERNAL_CHECK_RELEASED -> Known.EXTERNAL_CHECK_RELEASED
- EXTERNAL_CHECK_REVERSED -> Known.EXTERNAL_CHECK_REVERSED
- EXTERNAL_CHECK_SETTLED -> Known.EXTERNAL_CHECK_SETTLED
- EXTERNAL_TRANSFER_CANCELED -> Known.EXTERNAL_TRANSFER_CANCELED
- EXTERNAL_TRANSFER_INITIATED -> Known.EXTERNAL_TRANSFER_INITIATED
- EXTERNAL_TRANSFER_RELEASED -> Known.EXTERNAL_TRANSFER_RELEASED
- EXTERNAL_TRANSFER_REVERSED -> Known.EXTERNAL_TRANSFER_REVERSED
- EXTERNAL_TRANSFER_SETTLED -> Known.EXTERNAL_TRANSFER_SETTLED
- EXTERNAL_WIRE_CANCELED -> Known.EXTERNAL_WIRE_CANCELED
- EXTERNAL_WIRE_INITIATED -> Known.EXTERNAL_WIRE_INITIATED
- EXTERNAL_WIRE_RELEASED -> Known.EXTERNAL_WIRE_RELEASED
- EXTERNAL_WIRE_REVERSED -> Known.EXTERNAL_WIRE_REVERSED
- EXTERNAL_WIRE_SETTLED -> Known.EXTERNAL_WIRE_SETTLED
- FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION
- FINANCIAL_CREDIT_AUTHORIZATION -> Known.FINANCIAL_CREDIT_AUTHORIZATION
- INTEREST -> Known.INTEREST
- INTEREST_REVERSAL -> Known.INTEREST_REVERSAL
- INTERNAL_ADJUSTMENT -> Known.INTERNAL_ADJUSTMENT
- LATE_PAYMENT -> Known.LATE_PAYMENT
- LATE_PAYMENT_REVERSAL -> Known.LATE_PAYMENT_REVERSAL
- LOSS_WRITE_OFF -> Known.LOSS_WRITE_OFF
- PROVISIONAL_CREDIT -> Known.PROVISIONAL_CREDIT
- PROVISIONAL_CREDIT_REVERSAL -> Known.PROVISIONAL_CREDIT_REVERSAL
- SERVICE -> Known.SERVICE
- RETURN -> Known.RETURN
- RETURN_REVERSAL -> Known.RETURN_REVERSAL
- TRANSFER -> Known.TRANSFER
- TRANSFER_INSUFFICIENT_FUNDS -> Known.TRANSFER_INSUFFICIENT_FUNDS
- RETURNED_PAYMENT -> Known.RETURNED_PAYMENT
- RETURNED_PAYMENT_REVERSAL -> Known.RETURNED_PAYMENT_REVERSAL
- LITHIC_NETWORK_PAYMENT -> Known.LITHIC_NETWORK_PAYMENT
- else ->
- throw LithicInvalidDataException("Unknown FinancialEventType: $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(): FinancialEventType = 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 FinancialEventType && 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 FinancialEvent &&
- token == other.token &&
- amount == other.amount &&
- created == other.created &&
- result == other.result &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(token, amount, created, result, type, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "FinancialEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, additionalProperties=$additionalProperties}"
- }
-
/** INTERNAL - Financial Transaction */
class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -2506,6 +1515,8 @@ private constructor(
@JvmField val CANCELED = of("CANCELED")
+ @JvmField val RETURNED = of("RETURNED")
+
@JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
}
@@ -2516,6 +1527,7 @@ private constructor(
DECLINED,
REVERSED,
CANCELED,
+ RETURNED,
}
/**
@@ -2534,6 +1546,7 @@ private constructor(
DECLINED,
REVERSED,
CANCELED,
+ RETURNED,
/**
* An enum member indicating that [TransactionStatus] was instantiated with an
* unknown value.
@@ -2555,6 +1568,7 @@ private constructor(
DECLINED -> Value.DECLINED
REVERSED -> Value.REVERSED
CANCELED -> Value.CANCELED
+ RETURNED -> Value.RETURNED
else -> Value._UNKNOWN
}
@@ -2574,6 +1588,7 @@ private constructor(
DECLINED -> Known.DECLINED
REVERSED -> Known.REVERSED
CANCELED -> Known.CANCELED
+ RETURNED -> Known.RETURNED
else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
}
@@ -2695,7 +1710,7 @@ private constructor(
private val cardholderAuthentication: JsonField,
private val created: JsonField,
private val financialAccountToken: JsonField,
- private val merchant: JsonField,
+ private val merchant: JsonField,
private val merchantAmount: JsonField,
private val merchantAuthorizationAmount: JsonField,
private val merchantCurrency: JsonField,
@@ -2750,7 +1765,7 @@ private constructor(
financialAccountToken: JsonField = JsonMissing.of(),
@JsonProperty("merchant")
@ExcludeMissing
- merchant: JsonField = JsonMissing.of(),
+ merchant: JsonField = JsonMissing.of(),
@JsonProperty("merchant_amount")
@ExcludeMissing
merchantAmount: JsonField = JsonMissing.of(),
@@ -2961,7 +1976,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 merchant(): Transaction.Merchant = merchant.getRequired("merchant")
+ fun merchant(): Merchant = merchant.getRequired("merchant")
/**
* Analogous to the 'amount', but in the merchant currency.
@@ -3063,10 +2078,10 @@ private constructor(
/**
* CARD - Card Transaction
*
- * @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 family(): Optional = family.getOptional("family")
+ fun family(): Family = family.getRequired("family")
/**
* Returns the raw JSON value of [token].
@@ -3192,9 +2207,7 @@ private constructor(
*
* Unlike [merchant], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("merchant")
- @ExcludeMissing
- fun _merchant(): JsonField = merchant
+ @JsonProperty("merchant") @ExcludeMissing fun _merchant(): JsonField = merchant
/**
* Returns the raw JSON value of [merchantAmount].
@@ -3360,6 +2373,7 @@ private constructor(
* .status()
* .tokenInfo()
* .updated()
+ * .family()
* ```
*/
@JvmStatic fun builder() = Builder()
@@ -3382,7 +2396,7 @@ private constructor(
null
private var created: JsonField? = null
private var financialAccountToken: JsonField? = null
- private var merchant: JsonField? = null
+ private var merchant: JsonField? = null
private var merchantAmount: JsonField? = null
private var merchantAuthorizationAmount: JsonField? = null
private var merchantCurrency: JsonField? = null
@@ -3395,7 +2409,7 @@ private constructor(
private var tokenInfo: JsonField? = null
private var updated: JsonField? = null
private var events: JsonField>? = null
- private var family: JsonField = JsonMissing.of()
+ private var family: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -3683,18 +2697,16 @@ private constructor(
this.financialAccountToken = financialAccountToken
}
- fun merchant(merchant: Transaction.Merchant) = merchant(JsonField.of(merchant))
+ fun merchant(merchant: Merchant) = merchant(JsonField.of(merchant))
/**
* Sets [Builder.merchant] to an arbitrary JSON value.
*
- * You should usually call [Builder.merchant] with a well-typed [Transaction.Merchant]
- * value instead. This method is primarily for setting the field to an undocumented or
- * not yet supported value.
+ * You should usually call [Builder.merchant] with a well-typed [Merchant] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun merchant(merchant: JsonField) = apply {
- this.merchant = merchant
- }
+ fun merchant(merchant: JsonField) = apply { this.merchant = merchant }
/** Analogous to the 'amount', but in the merchant currency. */
@Deprecated("deprecated")
@@ -3999,6 +3011,7 @@ private constructor(
* .status()
* .tokenInfo()
* .updated()
+ * .family()
* ```
*
* @throws IllegalStateException if any required field is unset.
@@ -4031,7 +3044,7 @@ private constructor(
checkRequired("tokenInfo", tokenInfo),
checkRequired("updated", updated),
(events ?: JsonMissing.of()).map { it.toImmutable() },
- family,
+ checkRequired("family", family),
additionalProperties.toMutableMap(),
)
}
@@ -4069,7 +3082,7 @@ private constructor(
tokenInfo().ifPresent { it.validate() }
updated()
events().ifPresent { it.forEach { it.validate() } }
- family().ifPresent { it.validate() }
+ family().validate()
validated = true
}
@@ -4117,10 +3130,8 @@ private constructor(
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(family.asKnown().getOrNull()?.validity() ?: 0)
- /** The status of the transaction */
- class TransactionStatus
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ /** CARD - Card Transaction */
+ class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
* Returns this class instance's raw value.
@@ -4134,47 +3145,29 @@ private constructor(
companion object {
- @JvmField val PENDING = of("PENDING")
-
- @JvmField val SETTLED = of("SETTLED")
-
- @JvmField val DECLINED = of("DECLINED")
-
- @JvmField val REVERSED = of("REVERSED")
-
- @JvmField val CANCELED = of("CANCELED")
+ @JvmField val CARD = of("CARD")
- @JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
+ @JvmStatic fun of(value: String) = Family(JsonField.of(value))
}
- /** An enum containing [TransactionStatus]'s known values. */
+ /** An enum containing [Family]'s known values. */
enum class Known {
- PENDING,
- SETTLED,
- DECLINED,
- REVERSED,
- CANCELED,
+ CARD
}
/**
- * An enum containing [TransactionStatus]'s known values, as well as an [_UNKNOWN]
- * member.
+ * An enum containing [Family]'s known values, as well as an [_UNKNOWN] member.
*
- * An instance of [TransactionStatus] can contain an unknown value in a couple of cases:
+ * An instance of [Family] 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 {
- PENDING,
- SETTLED,
- DECLINED,
- REVERSED,
- CANCELED,
+ CARD,
/**
- * An enum member indicating that [TransactionStatus] was instantiated with an
- * unknown value.
+ * An enum member indicating that [Family] was instantiated with an unknown value.
*/
_UNKNOWN,
}
@@ -4188,11 +3181,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- PENDING -> Value.PENDING
- SETTLED -> Value.SETTLED
- DECLINED -> Value.DECLINED
- REVERSED -> Value.REVERSED
- CANCELED -> Value.CANCELED
+ CARD -> Value.CARD
else -> Value._UNKNOWN
}
@@ -4207,12 +3196,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
- PENDING -> Known.PENDING
- SETTLED -> Known.SETTLED
- DECLINED -> Known.DECLINED
- REVERSED -> Known.REVERSED
- CANCELED -> Known.CANCELED
- else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
+ CARD -> Known.CARD
+ else -> throw LithicInvalidDataException("Unknown Family: $value")
}
/**
@@ -4231,7 +3216,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): TransactionStatus = apply {
+ fun validate(): Family = apply {
if (validated) {
return@apply
}
@@ -4261,7 +3246,7 @@ private constructor(
return true
}
- return other is TransactionStatus && value == other.value
+ return other is Family && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -4269,8 +3254,10 @@ private constructor(
override fun toString() = value.toString()
}
- /** CARD - Card Transaction */
- class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
+ /** The status of the transaction */
+ class TransactionStatus
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
/**
* Returns this class instance's raw value.
@@ -4284,29 +3271,51 @@ private constructor(
companion object {
- @JvmField val CARD = of("CARD")
+ @JvmField val PENDING = of("PENDING")
- @JvmStatic fun of(value: String) = Family(JsonField.of(value))
+ @JvmField val SETTLED = of("SETTLED")
+
+ @JvmField val DECLINED = of("DECLINED")
+
+ @JvmField val REVERSED = of("REVERSED")
+
+ @JvmField val CANCELED = of("CANCELED")
+
+ @JvmField val RETURNED = of("RETURNED")
+
+ @JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
}
- /** An enum containing [Family]'s known values. */
+ /** An enum containing [TransactionStatus]'s known values. */
enum class Known {
- CARD
+ PENDING,
+ SETTLED,
+ DECLINED,
+ REVERSED,
+ CANCELED,
+ RETURNED,
}
/**
- * An enum containing [Family]'s known values, as well as an [_UNKNOWN] member.
+ * An enum containing [TransactionStatus]'s known values, as well as an [_UNKNOWN]
+ * member.
*
- * An instance of [Family] can contain an unknown value in a couple of cases:
+ * An instance of [TransactionStatus] 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,
+ PENDING,
+ SETTLED,
+ DECLINED,
+ REVERSED,
+ CANCELED,
+ RETURNED,
/**
- * An enum member indicating that [Family] was instantiated with an unknown value.
+ * An enum member indicating that [TransactionStatus] was instantiated with an
+ * unknown value.
*/
_UNKNOWN,
}
@@ -4320,7 +3329,12 @@ private constructor(
*/
fun value(): Value =
when (this) {
- CARD -> Value.CARD
+ PENDING -> Value.PENDING
+ SETTLED -> Value.SETTLED
+ DECLINED -> Value.DECLINED
+ REVERSED -> Value.REVERSED
+ CANCELED -> Value.CANCELED
+ RETURNED -> Value.RETURNED
else -> Value._UNKNOWN
}
@@ -4335,8 +3349,13 @@ private constructor(
*/
fun known(): Known =
when (this) {
- CARD -> Known.CARD
- else -> throw LithicInvalidDataException("Unknown Family: $value")
+ PENDING -> Known.PENDING
+ SETTLED -> Known.SETTLED
+ DECLINED -> Known.DECLINED
+ REVERSED -> Known.REVERSED
+ CANCELED -> Known.CANCELED
+ RETURNED -> Known.RETURNED
+ else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
}
/**
@@ -4355,7 +3374,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Family = apply {
+ fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
}
@@ -4385,7 +3404,7 @@ private constructor(
return true
}
- return other is Family && value == other.value
+ return other is TransactionStatus && value == other.value
}
override fun hashCode() = value.hashCode()
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 9535a0c5c..60c072c17 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
@@ -1252,997 +1252,6 @@ private constructor(
override fun toString() = value.toString()
}
- /** Financial Event */
- class FinancialEvent
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val token: JsonField,
- private val amount: JsonField,
- private val created: JsonField,
- private val result: JsonField,
- private val type: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
- @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
- @JsonProperty("created")
- @ExcludeMissing
- created: JsonField = JsonMissing.of(),
- @JsonProperty("result")
- @ExcludeMissing
- result: JsonField = JsonMissing.of(),
- @JsonProperty("type")
- @ExcludeMissing
- type: JsonField = JsonMissing.of(),
- ) : this(token, amount, created, result, type, mutableMapOf())
-
- /**
- * Globally unique identifier.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun token(): Optional = token.getOptional("token")
-
- /**
- * Amount of the financial event that has been settled in the currency's smallest unit
- * (e.g., cents).
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun amount(): Optional = amount.getOptional("amount")
-
- /**
- * Date and time when the financial event occurred. UTC time zone.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun created(): Optional = created.getOptional("created")
-
- /**
- * APPROVED financial events were successful while DECLINED financial events were
- * declined by user, Lithic, or the network.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun result(): Optional = result.getOptional("result")
-
- /**
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun type(): Optional = type.getOptional("type")
-
- /**
- * Returns the raw JSON value of [token].
- *
- * Unlike [token], this method doesn't throw if the JSON field has an unexpected type.
- */
- @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 [created].
- *
- * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("created")
- @ExcludeMissing
- fun _created(): JsonField = created
-
- /**
- * Returns the raw JSON value of [result].
- *
- * Unlike [result], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("result") @ExcludeMissing fun _result(): JsonField = result
-
- /**
- * Returns the raw JSON value of [type].
- *
- * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [FinancialEvent]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [FinancialEvent]. */
- class Builder internal constructor() {
-
- private var token: JsonField = JsonMissing.of()
- private var amount: JsonField = JsonMissing.of()
- private var created: JsonField = JsonMissing.of()
- private var result: JsonField = JsonMissing.of()
- private var type: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(financialEvent: FinancialEvent) = apply {
- token = financialEvent.token
- amount = financialEvent.amount
- created = financialEvent.created
- result = financialEvent.result
- type = financialEvent.type
- additionalProperties = financialEvent.additionalProperties.toMutableMap()
- }
-
- /** Globally unique identifier. */
- fun token(token: String) = token(JsonField.of(token))
-
- /**
- * Sets [Builder.token] to an arbitrary JSON value.
- *
- * You should usually call [Builder.token] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun token(token: JsonField) = apply { this.token = token }
-
- /**
- * Amount of the financial event that has been settled in the currency's smallest
- * unit (e.g., cents).
- */
- fun amount(amount: Long) = amount(JsonField.of(amount))
-
- /**
- * Sets [Builder.amount] 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.
- */
- fun amount(amount: JsonField) = apply { this.amount = amount }
-
- /** Date and time when the financial event occurred. UTC time zone. */
- fun created(created: OffsetDateTime) = created(JsonField.of(created))
-
- /**
- * Sets [Builder.created] to an arbitrary JSON value.
- *
- * You should usually call [Builder.created] with a well-typed [OffsetDateTime]
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun created(created: JsonField) = apply { this.created = created }
-
- /**
- * APPROVED financial events were successful while DECLINED financial events were
- * declined by user, Lithic, or the network.
- */
- fun result(result: Result) = result(JsonField.of(result))
-
- /**
- * Sets [Builder.result] to an arbitrary JSON value.
- *
- * You should usually call [Builder.result] with a well-typed [Result] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun result(result: JsonField) = apply { this.result = result }
-
- fun type(type: FinancialEventType) = type(JsonField.of(type))
-
- /**
- * Sets [Builder.type] to an arbitrary JSON value.
- *
- * You should usually call [Builder.type] with a well-typed [FinancialEventType]
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun type(type: JsonField) = apply { this.type = type }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [FinancialEvent].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): FinancialEvent =
- FinancialEvent(
- token,
- amount,
- created,
- result,
- type,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): FinancialEvent = apply {
- if (validated) {
- return@apply
- }
-
- token()
- amount()
- created()
- result().ifPresent { it.validate() }
- type().ifPresent { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (token.asKnown().isPresent) 1 else 0) +
- (if (amount.asKnown().isPresent) 1 else 0) +
- (if (created.asKnown().isPresent) 1 else 0) +
- (result.asKnown().getOrNull()?.validity() ?: 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /**
- * APPROVED financial events were successful while DECLINED financial events were
- * declined by user, Lithic, or the network.
- */
- class Result @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 APPROVED = of("APPROVED")
-
- @JvmField val DECLINED = of("DECLINED")
-
- @JvmStatic fun of(value: String) = Result(JsonField.of(value))
- }
-
- /** An enum containing [Result]'s known values. */
- enum class Known {
- APPROVED,
- DECLINED,
- }
-
- /**
- * An enum containing [Result]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [Result] 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 {
- APPROVED,
- DECLINED,
- /**
- * An enum member indicating that [Result] 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) {
- APPROVED -> Value.APPROVED
- DECLINED -> Value.DECLINED
- 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) {
- APPROVED -> Known.APPROVED
- DECLINED -> Known.DECLINED
- else -> throw LithicInvalidDataException("Unknown Result: $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(): Result = 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 Result && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class FinancialEventType
- @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 ACH_ORIGINATION_CANCELLED = of("ACH_ORIGINATION_CANCELLED")
-
- @JvmField val ACH_ORIGINATION_INITIATED = of("ACH_ORIGINATION_INITIATED")
-
- @JvmField val ACH_ORIGINATION_PROCESSED = of("ACH_ORIGINATION_PROCESSED")
-
- @JvmField val ACH_ORIGINATION_RELEASED = of("ACH_ORIGINATION_RELEASED")
-
- @JvmField val ACH_ORIGINATION_REJECTED = of("ACH_ORIGINATION_REJECTED")
-
- @JvmField val ACH_ORIGINATION_REVIEWED = of("ACH_ORIGINATION_REVIEWED")
-
- @JvmField val ACH_ORIGINATION_SETTLED = of("ACH_ORIGINATION_SETTLED")
-
- @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")
-
- @JvmField val ACH_RETURN_PROCESSED = of("ACH_RETURN_PROCESSED")
-
- @JvmField val ACH_RETURN_REJECTED = of("ACH_RETURN_REJECTED")
-
- @JvmField val ACH_RETURN_SETTLED = of("ACH_RETURN_SETTLED")
-
- @JvmField val AUTHORIZATION = of("AUTHORIZATION")
-
- @JvmField val AUTHORIZATION_ADVICE = of("AUTHORIZATION_ADVICE")
-
- @JvmField val AUTHORIZATION_EXPIRY = of("AUTHORIZATION_EXPIRY")
-
- @JvmField val AUTHORIZATION_REVERSAL = of("AUTHORIZATION_REVERSAL")
-
- @JvmField val BALANCE_INQUIRY = of("BALANCE_INQUIRY")
-
- @JvmField val BILLING_ERROR = of("BILLING_ERROR")
-
- @JvmField val BILLING_ERROR_REVERSAL = of("BILLING_ERROR_REVERSAL")
-
- @JvmField val CARD_TO_CARD = of("CARD_TO_CARD")
-
- @JvmField val CASH_BACK = of("CASH_BACK")
-
- @JvmField val CASH_BACK_REVERSAL = of("CASH_BACK_REVERSAL")
-
- @JvmField val CLEARING = of("CLEARING")
-
- @JvmField val COLLECTION = of("COLLECTION")
-
- @JvmField val CORRECTION_CREDIT = of("CORRECTION_CREDIT")
-
- @JvmField val CORRECTION_DEBIT = of("CORRECTION_DEBIT")
-
- @JvmField val CREDIT_AUTHORIZATION = of("CREDIT_AUTHORIZATION")
-
- @JvmField val CREDIT_AUTHORIZATION_ADVICE = of("CREDIT_AUTHORIZATION_ADVICE")
-
- @JvmField val CURRENCY_CONVERSION = of("CURRENCY_CONVERSION")
-
- @JvmField val CURRENCY_CONVERSION_REVERSAL = of("CURRENCY_CONVERSION_REVERSAL")
-
- @JvmField val DISPUTE_WON = of("DISPUTE_WON")
-
- @JvmField val EXTERNAL_ACH_CANCELED = of("EXTERNAL_ACH_CANCELED")
-
- @JvmField val EXTERNAL_ACH_INITIATED = of("EXTERNAL_ACH_INITIATED")
-
- @JvmField val EXTERNAL_ACH_RELEASED = of("EXTERNAL_ACH_RELEASED")
-
- @JvmField val EXTERNAL_ACH_REVERSED = of("EXTERNAL_ACH_REVERSED")
-
- @JvmField val EXTERNAL_ACH_SETTLED = of("EXTERNAL_ACH_SETTLED")
-
- @JvmField val EXTERNAL_CHECK_CANCELED = of("EXTERNAL_CHECK_CANCELED")
-
- @JvmField val EXTERNAL_CHECK_INITIATED = of("EXTERNAL_CHECK_INITIATED")
-
- @JvmField val EXTERNAL_CHECK_RELEASED = of("EXTERNAL_CHECK_RELEASED")
-
- @JvmField val EXTERNAL_CHECK_REVERSED = of("EXTERNAL_CHECK_REVERSED")
-
- @JvmField val EXTERNAL_CHECK_SETTLED = of("EXTERNAL_CHECK_SETTLED")
-
- @JvmField val EXTERNAL_TRANSFER_CANCELED = of("EXTERNAL_TRANSFER_CANCELED")
-
- @JvmField val EXTERNAL_TRANSFER_INITIATED = of("EXTERNAL_TRANSFER_INITIATED")
-
- @JvmField val EXTERNAL_TRANSFER_RELEASED = of("EXTERNAL_TRANSFER_RELEASED")
-
- @JvmField val EXTERNAL_TRANSFER_REVERSED = of("EXTERNAL_TRANSFER_REVERSED")
-
- @JvmField val EXTERNAL_TRANSFER_SETTLED = of("EXTERNAL_TRANSFER_SETTLED")
-
- @JvmField val EXTERNAL_WIRE_CANCELED = of("EXTERNAL_WIRE_CANCELED")
-
- @JvmField val EXTERNAL_WIRE_INITIATED = of("EXTERNAL_WIRE_INITIATED")
-
- @JvmField val EXTERNAL_WIRE_RELEASED = of("EXTERNAL_WIRE_RELEASED")
-
- @JvmField val EXTERNAL_WIRE_REVERSED = of("EXTERNAL_WIRE_REVERSED")
-
- @JvmField val EXTERNAL_WIRE_SETTLED = of("EXTERNAL_WIRE_SETTLED")
-
- @JvmField val FINANCIAL_AUTHORIZATION = of("FINANCIAL_AUTHORIZATION")
-
- @JvmField
- val FINANCIAL_CREDIT_AUTHORIZATION = of("FINANCIAL_CREDIT_AUTHORIZATION")
-
- @JvmField val INTEREST = of("INTEREST")
-
- @JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL")
-
- @JvmField val INTERNAL_ADJUSTMENT = of("INTERNAL_ADJUSTMENT")
-
- @JvmField val LATE_PAYMENT = of("LATE_PAYMENT")
-
- @JvmField val LATE_PAYMENT_REVERSAL = of("LATE_PAYMENT_REVERSAL")
-
- @JvmField val LOSS_WRITE_OFF = of("LOSS_WRITE_OFF")
-
- @JvmField val PROVISIONAL_CREDIT = of("PROVISIONAL_CREDIT")
-
- @JvmField val PROVISIONAL_CREDIT_REVERSAL = of("PROVISIONAL_CREDIT_REVERSAL")
-
- @JvmField val SERVICE = of("SERVICE")
-
- @JvmField val RETURN = of("RETURN")
-
- @JvmField val RETURN_REVERSAL = of("RETURN_REVERSAL")
-
- @JvmField val TRANSFER = of("TRANSFER")
-
- @JvmField val TRANSFER_INSUFFICIENT_FUNDS = of("TRANSFER_INSUFFICIENT_FUNDS")
-
- @JvmField val RETURNED_PAYMENT = of("RETURNED_PAYMENT")
-
- @JvmField val RETURNED_PAYMENT_REVERSAL = of("RETURNED_PAYMENT_REVERSAL")
-
- @JvmField val LITHIC_NETWORK_PAYMENT = of("LITHIC_NETWORK_PAYMENT")
-
- @JvmStatic fun of(value: String) = FinancialEventType(JsonField.of(value))
- }
-
- /** An enum containing [FinancialEventType]'s known values. */
- enum class Known {
- ACH_ORIGINATION_CANCELLED,
- ACH_ORIGINATION_INITIATED,
- ACH_ORIGINATION_PROCESSED,
- ACH_ORIGINATION_RELEASED,
- ACH_ORIGINATION_REJECTED,
- ACH_ORIGINATION_REVIEWED,
- ACH_ORIGINATION_SETTLED,
- ACH_RECEIPT_PROCESSED,
- ACH_RECEIPT_RELEASED,
- ACH_RECEIPT_SETTLED,
- ACH_RETURN_INITIATED,
- ACH_RETURN_PROCESSED,
- ACH_RETURN_REJECTED,
- ACH_RETURN_SETTLED,
- AUTHORIZATION,
- AUTHORIZATION_ADVICE,
- AUTHORIZATION_EXPIRY,
- AUTHORIZATION_REVERSAL,
- BALANCE_INQUIRY,
- BILLING_ERROR,
- BILLING_ERROR_REVERSAL,
- CARD_TO_CARD,
- CASH_BACK,
- CASH_BACK_REVERSAL,
- CLEARING,
- COLLECTION,
- CORRECTION_CREDIT,
- CORRECTION_DEBIT,
- CREDIT_AUTHORIZATION,
- CREDIT_AUTHORIZATION_ADVICE,
- CURRENCY_CONVERSION,
- CURRENCY_CONVERSION_REVERSAL,
- DISPUTE_WON,
- EXTERNAL_ACH_CANCELED,
- EXTERNAL_ACH_INITIATED,
- EXTERNAL_ACH_RELEASED,
- EXTERNAL_ACH_REVERSED,
- EXTERNAL_ACH_SETTLED,
- EXTERNAL_CHECK_CANCELED,
- EXTERNAL_CHECK_INITIATED,
- EXTERNAL_CHECK_RELEASED,
- EXTERNAL_CHECK_REVERSED,
- EXTERNAL_CHECK_SETTLED,
- EXTERNAL_TRANSFER_CANCELED,
- EXTERNAL_TRANSFER_INITIATED,
- EXTERNAL_TRANSFER_RELEASED,
- EXTERNAL_TRANSFER_REVERSED,
- EXTERNAL_TRANSFER_SETTLED,
- EXTERNAL_WIRE_CANCELED,
- EXTERNAL_WIRE_INITIATED,
- EXTERNAL_WIRE_RELEASED,
- EXTERNAL_WIRE_REVERSED,
- EXTERNAL_WIRE_SETTLED,
- FINANCIAL_AUTHORIZATION,
- FINANCIAL_CREDIT_AUTHORIZATION,
- INTEREST,
- INTEREST_REVERSAL,
- INTERNAL_ADJUSTMENT,
- LATE_PAYMENT,
- LATE_PAYMENT_REVERSAL,
- LOSS_WRITE_OFF,
- PROVISIONAL_CREDIT,
- PROVISIONAL_CREDIT_REVERSAL,
- SERVICE,
- RETURN,
- RETURN_REVERSAL,
- TRANSFER,
- TRANSFER_INSUFFICIENT_FUNDS,
- RETURNED_PAYMENT,
- RETURNED_PAYMENT_REVERSAL,
- LITHIC_NETWORK_PAYMENT,
- }
-
- /**
- * An enum containing [FinancialEventType]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [FinancialEventType] 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 {
- ACH_ORIGINATION_CANCELLED,
- ACH_ORIGINATION_INITIATED,
- ACH_ORIGINATION_PROCESSED,
- ACH_ORIGINATION_RELEASED,
- ACH_ORIGINATION_REJECTED,
- ACH_ORIGINATION_REVIEWED,
- ACH_ORIGINATION_SETTLED,
- ACH_RECEIPT_PROCESSED,
- ACH_RECEIPT_RELEASED,
- ACH_RECEIPT_SETTLED,
- ACH_RETURN_INITIATED,
- ACH_RETURN_PROCESSED,
- ACH_RETURN_REJECTED,
- ACH_RETURN_SETTLED,
- AUTHORIZATION,
- AUTHORIZATION_ADVICE,
- AUTHORIZATION_EXPIRY,
- AUTHORIZATION_REVERSAL,
- BALANCE_INQUIRY,
- BILLING_ERROR,
- BILLING_ERROR_REVERSAL,
- CARD_TO_CARD,
- CASH_BACK,
- CASH_BACK_REVERSAL,
- CLEARING,
- COLLECTION,
- CORRECTION_CREDIT,
- CORRECTION_DEBIT,
- CREDIT_AUTHORIZATION,
- CREDIT_AUTHORIZATION_ADVICE,
- CURRENCY_CONVERSION,
- CURRENCY_CONVERSION_REVERSAL,
- DISPUTE_WON,
- EXTERNAL_ACH_CANCELED,
- EXTERNAL_ACH_INITIATED,
- EXTERNAL_ACH_RELEASED,
- EXTERNAL_ACH_REVERSED,
- EXTERNAL_ACH_SETTLED,
- EXTERNAL_CHECK_CANCELED,
- EXTERNAL_CHECK_INITIATED,
- EXTERNAL_CHECK_RELEASED,
- EXTERNAL_CHECK_REVERSED,
- EXTERNAL_CHECK_SETTLED,
- EXTERNAL_TRANSFER_CANCELED,
- EXTERNAL_TRANSFER_INITIATED,
- EXTERNAL_TRANSFER_RELEASED,
- EXTERNAL_TRANSFER_REVERSED,
- EXTERNAL_TRANSFER_SETTLED,
- EXTERNAL_WIRE_CANCELED,
- EXTERNAL_WIRE_INITIATED,
- EXTERNAL_WIRE_RELEASED,
- EXTERNAL_WIRE_REVERSED,
- EXTERNAL_WIRE_SETTLED,
- FINANCIAL_AUTHORIZATION,
- FINANCIAL_CREDIT_AUTHORIZATION,
- INTEREST,
- INTEREST_REVERSAL,
- INTERNAL_ADJUSTMENT,
- LATE_PAYMENT,
- LATE_PAYMENT_REVERSAL,
- LOSS_WRITE_OFF,
- PROVISIONAL_CREDIT,
- PROVISIONAL_CREDIT_REVERSAL,
- SERVICE,
- RETURN,
- RETURN_REVERSAL,
- TRANSFER,
- TRANSFER_INSUFFICIENT_FUNDS,
- RETURNED_PAYMENT,
- RETURNED_PAYMENT_REVERSAL,
- LITHIC_NETWORK_PAYMENT,
- /**
- * An enum member indicating that [FinancialEventType] 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) {
- ACH_ORIGINATION_CANCELLED -> Value.ACH_ORIGINATION_CANCELLED
- ACH_ORIGINATION_INITIATED -> Value.ACH_ORIGINATION_INITIATED
- ACH_ORIGINATION_PROCESSED -> Value.ACH_ORIGINATION_PROCESSED
- ACH_ORIGINATION_RELEASED -> Value.ACH_ORIGINATION_RELEASED
- ACH_ORIGINATION_REJECTED -> Value.ACH_ORIGINATION_REJECTED
- 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
- ACH_RETURN_REJECTED -> Value.ACH_RETURN_REJECTED
- ACH_RETURN_SETTLED -> Value.ACH_RETURN_SETTLED
- AUTHORIZATION -> Value.AUTHORIZATION
- AUTHORIZATION_ADVICE -> Value.AUTHORIZATION_ADVICE
- AUTHORIZATION_EXPIRY -> Value.AUTHORIZATION_EXPIRY
- AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL
- BALANCE_INQUIRY -> Value.BALANCE_INQUIRY
- BILLING_ERROR -> Value.BILLING_ERROR
- BILLING_ERROR_REVERSAL -> Value.BILLING_ERROR_REVERSAL
- CARD_TO_CARD -> Value.CARD_TO_CARD
- CASH_BACK -> Value.CASH_BACK
- CASH_BACK_REVERSAL -> Value.CASH_BACK_REVERSAL
- CLEARING -> Value.CLEARING
- COLLECTION -> Value.COLLECTION
- CORRECTION_CREDIT -> Value.CORRECTION_CREDIT
- CORRECTION_DEBIT -> Value.CORRECTION_DEBIT
- CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION
- CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE
- CURRENCY_CONVERSION -> Value.CURRENCY_CONVERSION
- CURRENCY_CONVERSION_REVERSAL -> Value.CURRENCY_CONVERSION_REVERSAL
- DISPUTE_WON -> Value.DISPUTE_WON
- EXTERNAL_ACH_CANCELED -> Value.EXTERNAL_ACH_CANCELED
- EXTERNAL_ACH_INITIATED -> Value.EXTERNAL_ACH_INITIATED
- EXTERNAL_ACH_RELEASED -> Value.EXTERNAL_ACH_RELEASED
- EXTERNAL_ACH_REVERSED -> Value.EXTERNAL_ACH_REVERSED
- EXTERNAL_ACH_SETTLED -> Value.EXTERNAL_ACH_SETTLED
- EXTERNAL_CHECK_CANCELED -> Value.EXTERNAL_CHECK_CANCELED
- EXTERNAL_CHECK_INITIATED -> Value.EXTERNAL_CHECK_INITIATED
- EXTERNAL_CHECK_RELEASED -> Value.EXTERNAL_CHECK_RELEASED
- EXTERNAL_CHECK_REVERSED -> Value.EXTERNAL_CHECK_REVERSED
- EXTERNAL_CHECK_SETTLED -> Value.EXTERNAL_CHECK_SETTLED
- EXTERNAL_TRANSFER_CANCELED -> Value.EXTERNAL_TRANSFER_CANCELED
- EXTERNAL_TRANSFER_INITIATED -> Value.EXTERNAL_TRANSFER_INITIATED
- EXTERNAL_TRANSFER_RELEASED -> Value.EXTERNAL_TRANSFER_RELEASED
- EXTERNAL_TRANSFER_REVERSED -> Value.EXTERNAL_TRANSFER_REVERSED
- EXTERNAL_TRANSFER_SETTLED -> Value.EXTERNAL_TRANSFER_SETTLED
- EXTERNAL_WIRE_CANCELED -> Value.EXTERNAL_WIRE_CANCELED
- EXTERNAL_WIRE_INITIATED -> Value.EXTERNAL_WIRE_INITIATED
- EXTERNAL_WIRE_RELEASED -> Value.EXTERNAL_WIRE_RELEASED
- EXTERNAL_WIRE_REVERSED -> Value.EXTERNAL_WIRE_REVERSED
- EXTERNAL_WIRE_SETTLED -> Value.EXTERNAL_WIRE_SETTLED
- FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION
- FINANCIAL_CREDIT_AUTHORIZATION -> Value.FINANCIAL_CREDIT_AUTHORIZATION
- INTEREST -> Value.INTEREST
- INTEREST_REVERSAL -> Value.INTEREST_REVERSAL
- INTERNAL_ADJUSTMENT -> Value.INTERNAL_ADJUSTMENT
- LATE_PAYMENT -> Value.LATE_PAYMENT
- LATE_PAYMENT_REVERSAL -> Value.LATE_PAYMENT_REVERSAL
- LOSS_WRITE_OFF -> Value.LOSS_WRITE_OFF
- PROVISIONAL_CREDIT -> Value.PROVISIONAL_CREDIT
- PROVISIONAL_CREDIT_REVERSAL -> Value.PROVISIONAL_CREDIT_REVERSAL
- SERVICE -> Value.SERVICE
- RETURN -> Value.RETURN
- RETURN_REVERSAL -> Value.RETURN_REVERSAL
- TRANSFER -> Value.TRANSFER
- TRANSFER_INSUFFICIENT_FUNDS -> Value.TRANSFER_INSUFFICIENT_FUNDS
- RETURNED_PAYMENT -> Value.RETURNED_PAYMENT
- RETURNED_PAYMENT_REVERSAL -> Value.RETURNED_PAYMENT_REVERSAL
- LITHIC_NETWORK_PAYMENT -> Value.LITHIC_NETWORK_PAYMENT
- 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) {
- ACH_ORIGINATION_CANCELLED -> Known.ACH_ORIGINATION_CANCELLED
- ACH_ORIGINATION_INITIATED -> Known.ACH_ORIGINATION_INITIATED
- ACH_ORIGINATION_PROCESSED -> Known.ACH_ORIGINATION_PROCESSED
- ACH_ORIGINATION_RELEASED -> Known.ACH_ORIGINATION_RELEASED
- ACH_ORIGINATION_REJECTED -> Known.ACH_ORIGINATION_REJECTED
- 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
- ACH_RETURN_REJECTED -> Known.ACH_RETURN_REJECTED
- ACH_RETURN_SETTLED -> Known.ACH_RETURN_SETTLED
- AUTHORIZATION -> Known.AUTHORIZATION
- AUTHORIZATION_ADVICE -> Known.AUTHORIZATION_ADVICE
- AUTHORIZATION_EXPIRY -> Known.AUTHORIZATION_EXPIRY
- AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL
- BALANCE_INQUIRY -> Known.BALANCE_INQUIRY
- BILLING_ERROR -> Known.BILLING_ERROR
- BILLING_ERROR_REVERSAL -> Known.BILLING_ERROR_REVERSAL
- CARD_TO_CARD -> Known.CARD_TO_CARD
- CASH_BACK -> Known.CASH_BACK
- CASH_BACK_REVERSAL -> Known.CASH_BACK_REVERSAL
- CLEARING -> Known.CLEARING
- COLLECTION -> Known.COLLECTION
- CORRECTION_CREDIT -> Known.CORRECTION_CREDIT
- CORRECTION_DEBIT -> Known.CORRECTION_DEBIT
- CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION
- CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE
- CURRENCY_CONVERSION -> Known.CURRENCY_CONVERSION
- CURRENCY_CONVERSION_REVERSAL -> Known.CURRENCY_CONVERSION_REVERSAL
- DISPUTE_WON -> Known.DISPUTE_WON
- EXTERNAL_ACH_CANCELED -> Known.EXTERNAL_ACH_CANCELED
- EXTERNAL_ACH_INITIATED -> Known.EXTERNAL_ACH_INITIATED
- EXTERNAL_ACH_RELEASED -> Known.EXTERNAL_ACH_RELEASED
- EXTERNAL_ACH_REVERSED -> Known.EXTERNAL_ACH_REVERSED
- EXTERNAL_ACH_SETTLED -> Known.EXTERNAL_ACH_SETTLED
- EXTERNAL_CHECK_CANCELED -> Known.EXTERNAL_CHECK_CANCELED
- EXTERNAL_CHECK_INITIATED -> Known.EXTERNAL_CHECK_INITIATED
- EXTERNAL_CHECK_RELEASED -> Known.EXTERNAL_CHECK_RELEASED
- EXTERNAL_CHECK_REVERSED -> Known.EXTERNAL_CHECK_REVERSED
- EXTERNAL_CHECK_SETTLED -> Known.EXTERNAL_CHECK_SETTLED
- EXTERNAL_TRANSFER_CANCELED -> Known.EXTERNAL_TRANSFER_CANCELED
- EXTERNAL_TRANSFER_INITIATED -> Known.EXTERNAL_TRANSFER_INITIATED
- EXTERNAL_TRANSFER_RELEASED -> Known.EXTERNAL_TRANSFER_RELEASED
- EXTERNAL_TRANSFER_REVERSED -> Known.EXTERNAL_TRANSFER_REVERSED
- EXTERNAL_TRANSFER_SETTLED -> Known.EXTERNAL_TRANSFER_SETTLED
- EXTERNAL_WIRE_CANCELED -> Known.EXTERNAL_WIRE_CANCELED
- EXTERNAL_WIRE_INITIATED -> Known.EXTERNAL_WIRE_INITIATED
- EXTERNAL_WIRE_RELEASED -> Known.EXTERNAL_WIRE_RELEASED
- EXTERNAL_WIRE_REVERSED -> Known.EXTERNAL_WIRE_REVERSED
- EXTERNAL_WIRE_SETTLED -> Known.EXTERNAL_WIRE_SETTLED
- FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION
- FINANCIAL_CREDIT_AUTHORIZATION -> Known.FINANCIAL_CREDIT_AUTHORIZATION
- INTEREST -> Known.INTEREST
- INTEREST_REVERSAL -> Known.INTEREST_REVERSAL
- INTERNAL_ADJUSTMENT -> Known.INTERNAL_ADJUSTMENT
- LATE_PAYMENT -> Known.LATE_PAYMENT
- LATE_PAYMENT_REVERSAL -> Known.LATE_PAYMENT_REVERSAL
- LOSS_WRITE_OFF -> Known.LOSS_WRITE_OFF
- PROVISIONAL_CREDIT -> Known.PROVISIONAL_CREDIT
- PROVISIONAL_CREDIT_REVERSAL -> Known.PROVISIONAL_CREDIT_REVERSAL
- SERVICE -> Known.SERVICE
- RETURN -> Known.RETURN
- RETURN_REVERSAL -> Known.RETURN_REVERSAL
- TRANSFER -> Known.TRANSFER
- TRANSFER_INSUFFICIENT_FUNDS -> Known.TRANSFER_INSUFFICIENT_FUNDS
- RETURNED_PAYMENT -> Known.RETURNED_PAYMENT
- RETURNED_PAYMENT_REVERSAL -> Known.RETURNED_PAYMENT_REVERSAL
- LITHIC_NETWORK_PAYMENT -> Known.LITHIC_NETWORK_PAYMENT
- else ->
- throw LithicInvalidDataException("Unknown FinancialEventType: $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(): FinancialEventType = 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 FinancialEventType && 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 FinancialEvent &&
- token == other.token &&
- amount == other.amount &&
- created == other.created &&
- result == other.result &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(token, amount, created, result, type, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "FinancialEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, additionalProperties=$additionalProperties}"
- }
-
/** INTERNAL - Financial Transaction */
class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -2528,6 +1537,8 @@ private constructor(
@JvmField val CANCELED = of("CANCELED")
+ @JvmField val RETURNED = of("RETURNED")
+
@JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
}
@@ -2538,6 +1549,7 @@ private constructor(
DECLINED,
REVERSED,
CANCELED,
+ RETURNED,
}
/**
@@ -2556,6 +1568,7 @@ private constructor(
DECLINED,
REVERSED,
CANCELED,
+ RETURNED,
/**
* An enum member indicating that [TransactionStatus] was instantiated with an
* unknown value.
@@ -2577,6 +1590,7 @@ private constructor(
DECLINED -> Value.DECLINED
REVERSED -> Value.REVERSED
CANCELED -> Value.CANCELED
+ RETURNED -> Value.RETURNED
else -> Value._UNKNOWN
}
@@ -2596,6 +1610,7 @@ private constructor(
DECLINED -> Known.DECLINED
REVERSED -> Known.REVERSED
CANCELED -> Known.CANCELED
+ RETURNED -> Known.RETURNED
else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
}
@@ -2717,7 +1732,7 @@ private constructor(
private val cardholderAuthentication: JsonField,
private val created: JsonField,
private val financialAccountToken: JsonField,
- private val merchant: JsonField,
+ private val merchant: JsonField,
private val merchantAmount: JsonField,
private val merchantAuthorizationAmount: JsonField,
private val merchantCurrency: JsonField,
@@ -2772,7 +1787,7 @@ private constructor(
financialAccountToken: JsonField = JsonMissing.of(),
@JsonProperty("merchant")
@ExcludeMissing
- merchant: JsonField = JsonMissing.of(),
+ merchant: JsonField = JsonMissing.of(),
@JsonProperty("merchant_amount")
@ExcludeMissing
merchantAmount: JsonField = JsonMissing.of(),
@@ -2983,7 +1998,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 merchant(): Transaction.Merchant = merchant.getRequired("merchant")
+ fun merchant(): Merchant = merchant.getRequired("merchant")
/**
* Analogous to the 'amount', but in the merchant currency.
@@ -3085,10 +2100,10 @@ private constructor(
/**
* CARD - Card Transaction
*
- * @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 family(): Optional = family.getOptional("family")
+ fun family(): Family = family.getRequired("family")
/**
* Returns the raw JSON value of [token].
@@ -3214,9 +2229,7 @@ private constructor(
*
* Unlike [merchant], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("merchant")
- @ExcludeMissing
- fun _merchant(): JsonField = merchant
+ @JsonProperty("merchant") @ExcludeMissing fun _merchant(): JsonField = merchant
/**
* Returns the raw JSON value of [merchantAmount].
@@ -3382,6 +2395,7 @@ private constructor(
* .status()
* .tokenInfo()
* .updated()
+ * .family()
* ```
*/
@JvmStatic fun builder() = Builder()
@@ -3404,7 +2418,7 @@ private constructor(
null
private var created: JsonField? = null
private var financialAccountToken: JsonField? = null
- private var merchant: JsonField? = null
+ private var merchant: JsonField? = null
private var merchantAmount: JsonField? = null
private var merchantAuthorizationAmount: JsonField? = null
private var merchantCurrency: JsonField? = null
@@ -3417,7 +2431,7 @@ private constructor(
private var tokenInfo: JsonField? = null
private var updated: JsonField? = null
private var events: JsonField>? = null
- private var family: JsonField = JsonMissing.of()
+ private var family: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -3705,18 +2719,16 @@ private constructor(
this.financialAccountToken = financialAccountToken
}
- fun merchant(merchant: Transaction.Merchant) = merchant(JsonField.of(merchant))
+ fun merchant(merchant: Merchant) = merchant(JsonField.of(merchant))
/**
* Sets [Builder.merchant] to an arbitrary JSON value.
*
- * You should usually call [Builder.merchant] with a well-typed [Transaction.Merchant]
- * value instead. This method is primarily for setting the field to an undocumented or
- * not yet supported value.
+ * You should usually call [Builder.merchant] with a well-typed [Merchant] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun merchant(merchant: JsonField) = apply {
- this.merchant = merchant
- }
+ fun merchant(merchant: JsonField) = apply { this.merchant = merchant }
/** Analogous to the 'amount', but in the merchant currency. */
@Deprecated("deprecated")
@@ -4021,6 +3033,7 @@ private constructor(
* .status()
* .tokenInfo()
* .updated()
+ * .family()
* ```
*
* @throws IllegalStateException if any required field is unset.
@@ -4053,7 +3066,7 @@ private constructor(
checkRequired("tokenInfo", tokenInfo),
checkRequired("updated", updated),
(events ?: JsonMissing.of()).map { it.toImmutable() },
- family,
+ checkRequired("family", family),
additionalProperties.toMutableMap(),
)
}
@@ -4091,7 +3104,7 @@ private constructor(
tokenInfo().ifPresent { it.validate() }
updated()
events().ifPresent { it.forEach { it.validate() } }
- family().ifPresent { it.validate() }
+ family().validate()
validated = true
}
@@ -4139,10 +3152,8 @@ private constructor(
(events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(family.asKnown().getOrNull()?.validity() ?: 0)
- /** The status of the transaction */
- class TransactionStatus
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ /** CARD - Card Transaction */
+ class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
* Returns this class instance's raw value.
@@ -4156,47 +3167,29 @@ private constructor(
companion object {
- @JvmField val PENDING = of("PENDING")
-
- @JvmField val SETTLED = of("SETTLED")
-
- @JvmField val DECLINED = of("DECLINED")
-
- @JvmField val REVERSED = of("REVERSED")
-
- @JvmField val CANCELED = of("CANCELED")
+ @JvmField val CARD = of("CARD")
- @JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
+ @JvmStatic fun of(value: String) = Family(JsonField.of(value))
}
- /** An enum containing [TransactionStatus]'s known values. */
+ /** An enum containing [Family]'s known values. */
enum class Known {
- PENDING,
- SETTLED,
- DECLINED,
- REVERSED,
- CANCELED,
+ CARD
}
/**
- * An enum containing [TransactionStatus]'s known values, as well as an [_UNKNOWN]
- * member.
+ * An enum containing [Family]'s known values, as well as an [_UNKNOWN] member.
*
- * An instance of [TransactionStatus] can contain an unknown value in a couple of cases:
+ * An instance of [Family] 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 {
- PENDING,
- SETTLED,
- DECLINED,
- REVERSED,
- CANCELED,
+ CARD,
/**
- * An enum member indicating that [TransactionStatus] was instantiated with an
- * unknown value.
+ * An enum member indicating that [Family] was instantiated with an unknown value.
*/
_UNKNOWN,
}
@@ -4210,11 +3203,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- PENDING -> Value.PENDING
- SETTLED -> Value.SETTLED
- DECLINED -> Value.DECLINED
- REVERSED -> Value.REVERSED
- CANCELED -> Value.CANCELED
+ CARD -> Value.CARD
else -> Value._UNKNOWN
}
@@ -4229,12 +3218,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
- PENDING -> Known.PENDING
- SETTLED -> Known.SETTLED
- DECLINED -> Known.DECLINED
- REVERSED -> Known.REVERSED
- CANCELED -> Known.CANCELED
- else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
+ CARD -> Known.CARD
+ else -> throw LithicInvalidDataException("Unknown Family: $value")
}
/**
@@ -4253,7 +3238,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): TransactionStatus = apply {
+ fun validate(): Family = apply {
if (validated) {
return@apply
}
@@ -4283,7 +3268,7 @@ private constructor(
return true
}
- return other is TransactionStatus && value == other.value
+ return other is Family && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -4291,8 +3276,10 @@ private constructor(
override fun toString() = value.toString()
}
- /** CARD - Card Transaction */
- class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
+ /** The status of the transaction */
+ class TransactionStatus
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
/**
* Returns this class instance's raw value.
@@ -4306,29 +3293,51 @@ private constructor(
companion object {
- @JvmField val CARD = of("CARD")
+ @JvmField val PENDING = of("PENDING")
- @JvmStatic fun of(value: String) = Family(JsonField.of(value))
+ @JvmField val SETTLED = of("SETTLED")
+
+ @JvmField val DECLINED = of("DECLINED")
+
+ @JvmField val REVERSED = of("REVERSED")
+
+ @JvmField val CANCELED = of("CANCELED")
+
+ @JvmField val RETURNED = of("RETURNED")
+
+ @JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
}
- /** An enum containing [Family]'s known values. */
+ /** An enum containing [TransactionStatus]'s known values. */
enum class Known {
- CARD
+ PENDING,
+ SETTLED,
+ DECLINED,
+ REVERSED,
+ CANCELED,
+ RETURNED,
}
/**
- * An enum containing [Family]'s known values, as well as an [_UNKNOWN] member.
+ * An enum containing [TransactionStatus]'s known values, as well as an [_UNKNOWN]
+ * member.
*
- * An instance of [Family] can contain an unknown value in a couple of cases:
+ * An instance of [TransactionStatus] 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,
+ PENDING,
+ SETTLED,
+ DECLINED,
+ REVERSED,
+ CANCELED,
+ RETURNED,
/**
- * An enum member indicating that [Family] was instantiated with an unknown value.
+ * An enum member indicating that [TransactionStatus] was instantiated with an
+ * unknown value.
*/
_UNKNOWN,
}
@@ -4342,7 +3351,12 @@ private constructor(
*/
fun value(): Value =
when (this) {
- CARD -> Value.CARD
+ PENDING -> Value.PENDING
+ SETTLED -> Value.SETTLED
+ DECLINED -> Value.DECLINED
+ REVERSED -> Value.REVERSED
+ CANCELED -> Value.CANCELED
+ RETURNED -> Value.RETURNED
else -> Value._UNKNOWN
}
@@ -4357,8 +3371,13 @@ private constructor(
*/
fun known(): Known =
when (this) {
- CARD -> Known.CARD
- else -> throw LithicInvalidDataException("Unknown Family: $value")
+ PENDING -> Known.PENDING
+ SETTLED -> Known.SETTLED
+ DECLINED -> Known.DECLINED
+ REVERSED -> Known.REVERSED
+ CANCELED -> Known.CANCELED
+ RETURNED -> Known.RETURNED
+ else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
}
/**
@@ -4377,7 +3396,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Family = apply {
+ fun validate(): TransactionStatus = apply {
if (validated) {
return@apply
}
@@ -4407,7 +3426,7 @@ private constructor(
return true
}
- return other is Family && value == other.value
+ return other is TransactionStatus && value == other.value
}
override fun hashCode() = value.hashCode()
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt
index 5bcc304e5..ae1e77a4e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt
@@ -6,35 +6,22 @@ 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.getOrThrow
-import com.lithic.api.core.toImmutable
+import com.lithic.api.core.checkRequired
import com.lithic.api.errors.LithicInvalidDataException
import java.util.Collections
import java.util.Objects
-import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AuthRuleCondition
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val attribute: JsonField,
- private val operation: JsonField,
- private val value: JsonField,
+ private val operation: JsonField,
+ private val value: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -45,8 +32,8 @@ private constructor(
attribute: JsonField = JsonMissing.of(),
@JsonProperty("operation")
@ExcludeMissing
- operation: JsonField = JsonMissing.of(),
- @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(),
+ operation: JsonField = JsonMissing.of(),
+ @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(),
) : this(attribute, operation, value, mutableMapOf())
/**
@@ -92,26 +79,26 @@ private constructor(
* cardholder KYC data if it exists. Valid values are `MATCH`, `MATCH_ADDRESS_ONLY`,
* `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
*
- * @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 attribute(): Optional = attribute.getOptional("attribute")
+ fun attribute(): ConditionalAttribute = attribute.getRequired("attribute")
/**
* The operation to apply to the attribute
*
- * @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 operation(): Optional = operation.getOptional("operation")
+ fun operation(): ConditionalOperation = operation.getRequired("operation")
/**
* A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
*
- * @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 value(): Optional = value.getOptional("value")
+ fun value(): ConditionalValue = value.getRequired("value")
/**
* Returns the raw JSON value of [attribute].
@@ -127,14 +114,16 @@ private constructor(
*
* Unlike [operation], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("operation") @ExcludeMissing fun _operation(): JsonField = operation
+ @JsonProperty("operation")
+ @ExcludeMissing
+ fun _operation(): JsonField = operation
/**
* Returns the raw JSON value of [value].
*
* Unlike [value], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value
+ @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -150,16 +139,25 @@ private constructor(
companion object {
- /** Returns a mutable builder for constructing an instance of [AuthRuleCondition]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [AuthRuleCondition].
+ *
+ * The following fields are required:
+ * ```java
+ * .attribute()
+ * .operation()
+ * .value()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
/** A builder for [AuthRuleCondition]. */
class Builder internal constructor() {
- private var attribute: JsonField = JsonMissing.of()
- private var operation: JsonField = JsonMissing.of()
- private var value: JsonField = JsonMissing.of()
+ private var attribute: JsonField? = null
+ private var operation: JsonField? = null
+ private var value: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -231,37 +229,40 @@ private constructor(
}
/** The operation to apply to the attribute */
- fun operation(operation: Operation) = operation(JsonField.of(operation))
+ fun operation(operation: ConditionalOperation) = operation(JsonField.of(operation))
/**
* Sets [Builder.operation] to an arbitrary JSON value.
*
- * You should usually call [Builder.operation] with a well-typed [Operation] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
+ * You should usually call [Builder.operation] with a well-typed [ConditionalOperation]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
*/
- fun operation(operation: JsonField) = apply { this.operation = operation }
+ fun operation(operation: JsonField) = apply {
+ this.operation = operation
+ }
/** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun value(value: Value) = value(JsonField.of(value))
+ fun value(value: ConditionalValue) = value(JsonField.of(value))
/**
* Sets [Builder.value] to an arbitrary JSON value.
*
- * You should usually call [Builder.value] with a well-typed [Value] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
+ * You should usually call [Builder.value] with a well-typed [ConditionalValue] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun value(value: JsonField) = apply { this.value = value }
+ fun value(value: JsonField) = apply { this.value = value }
- /** Alias for calling [value] with `Value.ofRegex(regex)`. */
- fun value(regex: String) = value(Value.ofRegex(regex))
+ /** Alias for calling [value] with `ConditionalValue.ofRegex(regex)`. */
+ fun value(regex: String) = value(ConditionalValue.ofRegex(regex))
- /** Alias for calling [value] with `Value.ofNumber(number)`. */
- fun value(number: Long) = value(Value.ofNumber(number))
+ /** Alias for calling [value] with `ConditionalValue.ofNumber(number)`. */
+ fun value(number: Long) = value(ConditionalValue.ofNumber(number))
- /** Alias for calling [value] with `Value.ofListOfStrings(listOfStrings)`. */
+ /** Alias for calling [value] with `ConditionalValue.ofListOfStrings(listOfStrings)`. */
fun valueOfListOfStrings(listOfStrings: List) =
- value(Value.ofListOfStrings(listOfStrings))
+ value(ConditionalValue.ofListOfStrings(listOfStrings))
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -286,9 +287,23 @@ private constructor(
* Returns an immutable instance of [AuthRuleCondition].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .attribute()
+ * .operation()
+ * .value()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
fun build(): AuthRuleCondition =
- AuthRuleCondition(attribute, operation, value, additionalProperties.toMutableMap())
+ AuthRuleCondition(
+ checkRequired("attribute", attribute),
+ checkRequired("operation", operation),
+ checkRequired("value", value),
+ additionalProperties.toMutableMap(),
+ )
}
private var validated: Boolean = false
@@ -298,9 +313,9 @@ private constructor(
return@apply
}
- attribute().ifPresent { it.validate() }
- operation().ifPresent { it.validate() }
- value().ifPresent { it.validate() }
+ attribute().validate()
+ operation().validate()
+ value().validate()
validated = true
}
@@ -323,401 +338,6 @@ private constructor(
(operation.asKnown().getOrNull()?.validity() ?: 0) +
(value.asKnown().getOrNull()?.validity() ?: 0)
- /** The operation to apply to the attribute */
- class Operation @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 IS_ONE_OF = of("IS_ONE_OF")
-
- @JvmField val IS_NOT_ONE_OF = of("IS_NOT_ONE_OF")
-
- @JvmField val MATCHES = of("MATCHES")
-
- @JvmField val DOES_NOT_MATCH = of("DOES_NOT_MATCH")
-
- @JvmField val IS_EQUAL_TO = of("IS_EQUAL_TO")
-
- @JvmField val IS_NOT_EQUAL_TO = of("IS_NOT_EQUAL_TO")
-
- @JvmField val IS_GREATER_THAN = of("IS_GREATER_THAN")
-
- @JvmField val IS_GREATER_THAN_OR_EQUAL_TO = of("IS_GREATER_THAN_OR_EQUAL_TO")
-
- @JvmField val IS_LESS_THAN = of("IS_LESS_THAN")
-
- @JvmField val IS_LESS_THAN_OR_EQUAL_TO = of("IS_LESS_THAN_OR_EQUAL_TO")
-
- @JvmStatic fun of(value: String) = Operation(JsonField.of(value))
- }
-
- /** An enum containing [Operation]'s known values. */
- enum class Known {
- IS_ONE_OF,
- IS_NOT_ONE_OF,
- MATCHES,
- DOES_NOT_MATCH,
- IS_EQUAL_TO,
- IS_NOT_EQUAL_TO,
- IS_GREATER_THAN,
- IS_GREATER_THAN_OR_EQUAL_TO,
- IS_LESS_THAN,
- IS_LESS_THAN_OR_EQUAL_TO,
- }
-
- /**
- * An enum containing [Operation]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [Operation] 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 {
- IS_ONE_OF,
- IS_NOT_ONE_OF,
- MATCHES,
- DOES_NOT_MATCH,
- IS_EQUAL_TO,
- IS_NOT_EQUAL_TO,
- IS_GREATER_THAN,
- IS_GREATER_THAN_OR_EQUAL_TO,
- IS_LESS_THAN,
- IS_LESS_THAN_OR_EQUAL_TO,
- /**
- * An enum member indicating that [Operation] 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) {
- IS_ONE_OF -> Value.IS_ONE_OF
- IS_NOT_ONE_OF -> Value.IS_NOT_ONE_OF
- MATCHES -> Value.MATCHES
- DOES_NOT_MATCH -> Value.DOES_NOT_MATCH
- IS_EQUAL_TO -> Value.IS_EQUAL_TO
- IS_NOT_EQUAL_TO -> Value.IS_NOT_EQUAL_TO
- IS_GREATER_THAN -> Value.IS_GREATER_THAN
- IS_GREATER_THAN_OR_EQUAL_TO -> Value.IS_GREATER_THAN_OR_EQUAL_TO
- IS_LESS_THAN -> Value.IS_LESS_THAN
- IS_LESS_THAN_OR_EQUAL_TO -> Value.IS_LESS_THAN_OR_EQUAL_TO
- 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) {
- IS_ONE_OF -> Known.IS_ONE_OF
- IS_NOT_ONE_OF -> Known.IS_NOT_ONE_OF
- MATCHES -> Known.MATCHES
- DOES_NOT_MATCH -> Known.DOES_NOT_MATCH
- IS_EQUAL_TO -> Known.IS_EQUAL_TO
- IS_NOT_EQUAL_TO -> Known.IS_NOT_EQUAL_TO
- IS_GREATER_THAN -> Known.IS_GREATER_THAN
- IS_GREATER_THAN_OR_EQUAL_TO -> Known.IS_GREATER_THAN_OR_EQUAL_TO
- IS_LESS_THAN -> Known.IS_LESS_THAN
- IS_LESS_THAN_OR_EQUAL_TO -> Known.IS_LESS_THAN_OR_EQUAL_TO
- else -> throw LithicInvalidDataException("Unknown Operation: $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(): Operation = 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 Operation && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- @JsonDeserialize(using = Value.Deserializer::class)
- @JsonSerialize(using = Value.Serializer::class)
- class Value
- private constructor(
- private val regex: String? = null,
- private val number: Long? = null,
- private val listOfStrings: List? = null,
- private val _json: JsonValue? = null,
- ) {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun regex(): Optional = Optional.ofNullable(regex)
-
- /**
- * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`,
- * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun number(): Optional = Optional.ofNullable(number)
-
- /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */
- fun listOfStrings(): Optional> = Optional.ofNullable(listOfStrings)
-
- fun isRegex(): Boolean = regex != null
-
- fun isNumber(): Boolean = number != null
-
- fun isListOfStrings(): Boolean = listOfStrings != null
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun asRegex(): String = regex.getOrThrow("regex")
-
- /**
- * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`,
- * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun asNumber(): Long = number.getOrThrow("number")
-
- /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */
- fun asListOfStrings(): List = listOfStrings.getOrThrow("listOfStrings")
-
- fun _json(): Optional = Optional.ofNullable(_json)
-
- fun accept(visitor: Visitor): T =
- when {
- regex != null -> visitor.visitRegex(regex)
- number != null -> visitor.visitNumber(number)
- listOfStrings != null -> visitor.visitListOfStrings(listOfStrings)
- else -> visitor.unknown(_json)
- }
-
- private var validated: Boolean = false
-
- fun validate(): Value = apply {
- if (validated) {
- return@apply
- }
-
- accept(
- object : Visitor {
- override fun visitRegex(regex: String) {}
-
- override fun visitNumber(number: Long) {}
-
- override fun visitListOfStrings(listOfStrings: List) {}
- }
- )
- 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 visitRegex(regex: String) = 1
-
- override fun visitNumber(number: Long) = 1
-
- override fun visitListOfStrings(listOfStrings: List) =
- listOfStrings.size
-
- override fun unknown(json: JsonValue?) = 0
- }
- )
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Value &&
- regex == other.regex &&
- number == other.number &&
- listOfStrings == other.listOfStrings
- }
-
- override fun hashCode(): Int = Objects.hash(regex, number, listOfStrings)
-
- override fun toString(): String =
- when {
- regex != null -> "Value{regex=$regex}"
- number != null -> "Value{number=$number}"
- listOfStrings != null -> "Value{listOfStrings=$listOfStrings}"
- _json != null -> "Value{_unknown=$_json}"
- else -> throw IllegalStateException("Invalid Value")
- }
-
- companion object {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- @JvmStatic fun ofRegex(regex: String) = Value(regex = regex)
-
- /**
- * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`,
- * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- @JvmStatic fun ofNumber(number: Long) = Value(number = number)
-
- /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */
- @JvmStatic
- fun ofListOfStrings(listOfStrings: List) =
- Value(listOfStrings = listOfStrings.toImmutable())
- }
-
- /** An interface that defines how to map each variant of [Value] to a value of type [T]. */
- interface Visitor {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun visitRegex(regex: String): T
-
- /**
- * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`,
- * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun visitNumber(number: Long): T
-
- /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */
- fun visitListOfStrings(listOfStrings: List): T
-
- /**
- * Maps an unknown variant of [Value] to a value of type [T].
- *
- * An instance of [Value] 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 Value: $json")
- }
- }
-
- internal class Deserializer : BaseDeserializer(Value::class) {
-
- override fun ObjectCodec.deserialize(node: JsonNode): Value {
- val json = JsonValue.fromJsonNode(node)
-
- val bestMatches =
- sequenceOf(
- tryDeserialize(node, jacksonTypeRef())?.let {
- Value(regex = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())?.let {
- Value(number = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef>())?.let {
- Value(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).
- 0 -> Value(_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(Value::class) {
-
- override fun serialize(
- value: Value,
- generator: JsonGenerator,
- provider: SerializerProvider,
- ) {
- when {
- value.regex != null -> generator.writeObject(value.regex)
- value.number != null -> generator.writeObject(value.number)
- value.listOfStrings != null -> generator.writeObject(value.listOfStrings)
- value._json != null -> generator.writeObject(value._json)
- else -> throw IllegalStateException("Invalid Value")
- }
- }
- }
- }
-
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
index 727366e24..df34a0018 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
@@ -476,7 +476,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
* @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
@@ -673,6 +674,24 @@ private constructor(
Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAchAction(conditionalAchAction)`.
+ */
+ fun parameters(conditionalAchAction: ConditionalAchActionParameters) =
+ parameters(Parameters.ofConditionalAchAction(conditionalAchAction))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)`.
+ */
+ fun parameters(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
+ )
+
/**
* The type of Auth Rule. For certain rule types, this determines the event stream
* during which it will be evaluated. For rules that can be applied to one of
@@ -681,7 +700,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -875,6 +895,10 @@ private constructor(
private val conditionalAuthorizationAction:
ConditionalAuthorizationActionParameters? =
null,
+ private val conditionalAchAction: ConditionalAchActionParameters? = null,
+ private val conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters? =
+ null,
private val _json: JsonValue? = null,
) {
@@ -894,6 +918,13 @@ private constructor(
Optional =
Optional.ofNullable(conditionalAuthorizationAction)
+ fun conditionalAchAction(): Optional =
+ Optional.ofNullable(conditionalAchAction)
+
+ fun conditionalTokenizationAction():
+ Optional =
+ Optional.ofNullable(conditionalTokenizationAction)
+
fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -905,6 +936,11 @@ private constructor(
fun isConditionalAuthorizationAction(): Boolean =
conditionalAuthorizationAction != null
+ fun isConditionalAchAction(): Boolean = conditionalAchAction != null
+
+ fun isConditionalTokenizationAction(): Boolean =
+ conditionalTokenizationAction != null
+
fun asConditionalBlock(): ConditionalBlockParameters =
conditionalBlock.getOrThrow("conditionalBlock")
@@ -920,6 +956,12 @@ private constructor(
fun asConditionalAuthorizationAction(): ConditionalAuthorizationActionParameters =
conditionalAuthorizationAction.getOrThrow("conditionalAuthorizationAction")
+ fun asConditionalAchAction(): ConditionalAchActionParameters =
+ conditionalAchAction.getOrThrow("conditionalAchAction")
+
+ fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
+ conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -934,6 +976,12 @@ private constructor(
visitor.visitConditionalAuthorizationAction(
conditionalAuthorizationAction
)
+ conditionalAchAction != null ->
+ visitor.visitConditionalAchAction(conditionalAchAction)
+ conditionalTokenizationAction != null ->
+ visitor.visitConditionalTokenizationAction(
+ conditionalTokenizationAction
+ )
else -> visitor.unknown(_json)
}
@@ -974,6 +1022,19 @@ private constructor(
) {
conditionalAuthorizationAction.validate()
}
+
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) {
+ conditionalAchAction.validate()
+ }
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters
+ ) {
+ conditionalTokenizationAction.validate()
+ }
}
)
validated = true
@@ -1017,6 +1078,15 @@ private constructor(
ConditionalAuthorizationActionParameters
) = conditionalAuthorizationAction.validity()
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = conditionalAchAction.validity()
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters
+ ) = conditionalTokenizationAction.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -1031,7 +1101,9 @@ private constructor(
velocityLimitParams == other.velocityLimitParams &&
merchantLock == other.merchantLock &&
conditional3dsAction == other.conditional3dsAction &&
- conditionalAuthorizationAction == other.conditionalAuthorizationAction
+ conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
+ conditionalAchAction == other.conditionalAchAction &&
+ conditionalTokenizationAction == other.conditionalTokenizationAction
}
override fun hashCode(): Int =
@@ -1041,6 +1113,8 @@ private constructor(
merchantLock,
conditional3dsAction,
conditionalAuthorizationAction,
+ conditionalAchAction,
+ conditionalTokenizationAction,
)
override fun toString(): String =
@@ -1053,6 +1127,10 @@ private constructor(
"Parameters{conditional3dsAction=$conditional3dsAction}"
conditionalAuthorizationAction != null ->
"Parameters{conditionalAuthorizationAction=$conditionalAuthorizationAction}"
+ conditionalAchAction != null ->
+ "Parameters{conditionalAchAction=$conditionalAchAction}"
+ conditionalTokenizationAction != null ->
+ "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1080,6 +1158,16 @@ private constructor(
fun ofConditionalAuthorizationAction(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
) = Parameters(conditionalAuthorizationAction = conditionalAuthorizationAction)
+
+ @JvmStatic
+ fun ofConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = Parameters(conditionalAchAction = conditionalAchAction)
+
+ @JvmStatic
+ fun ofConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
}
/**
@@ -1102,6 +1190,14 @@ private constructor(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
): T
+ fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ): T
+
+ fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -1154,6 +1250,25 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let {
+ Parameters(conditionalAchAction = it, _json = json)
+ },
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalTokenizationActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalTokenizationAction = it,
+ _json = json,
+ )
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -1189,6 +1304,10 @@ private constructor(
generator.writeObject(value.conditional3dsAction)
value.conditionalAuthorizationAction != null ->
generator.writeObject(value.conditionalAuthorizationAction)
+ value.conditionalAchAction != null ->
+ generator.writeObject(value.conditionalAchAction)
+ value.conditionalTokenizationAction != null ->
+ generator.writeObject(value.conditionalTokenizationAction)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1203,7 +1322,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType
@JsonCreator
@@ -1371,6 +1491,12 @@ private constructor(
@JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
+ @JvmField val TOKENIZATION = of("TOKENIZATION")
+
+ @JvmField val ACH_CREDIT_RECEIPT = of("ACH_CREDIT_RECEIPT")
+
+ @JvmField val ACH_DEBIT_RECEIPT = of("ACH_DEBIT_RECEIPT")
+
@JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
}
@@ -1378,6 +1504,9 @@ private constructor(
enum class Known {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
}
/**
@@ -1392,6 +1521,9 @@ private constructor(
enum class Value {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
/**
* An enum member indicating that [EventStream] was instantiated with an unknown
* value.
@@ -1410,6 +1542,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Value.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Value.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Value.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Value.ACH_DEBIT_RECEIPT
else -> Value._UNKNOWN
}
@@ -1426,6 +1561,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Known.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Known.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Known.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Known.ACH_DEBIT_RECEIPT
else -> throw LithicInvalidDataException("Unknown EventStream: $value")
}
@@ -1569,7 +1707,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
* @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
@@ -1762,6 +1901,24 @@ private constructor(
Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAchAction(conditionalAchAction)`.
+ */
+ fun parameters(conditionalAchAction: ConditionalAchActionParameters) =
+ parameters(Parameters.ofConditionalAchAction(conditionalAchAction))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)`.
+ */
+ fun parameters(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
+ )
+
/**
* The type of Auth Rule. For certain rule types, this determines the event stream
* during which it will be evaluated. For rules that can be applied to one of
@@ -1770,7 +1927,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -1908,6 +2066,10 @@ private constructor(
private val conditionalAuthorizationAction:
ConditionalAuthorizationActionParameters? =
null,
+ private val conditionalAchAction: ConditionalAchActionParameters? = null,
+ private val conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters? =
+ null,
private val _json: JsonValue? = null,
) {
@@ -1927,6 +2089,13 @@ private constructor(
Optional =
Optional.ofNullable(conditionalAuthorizationAction)
+ fun conditionalAchAction(): Optional =
+ Optional.ofNullable(conditionalAchAction)
+
+ fun conditionalTokenizationAction():
+ Optional =
+ Optional.ofNullable(conditionalTokenizationAction)
+
fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -1938,6 +2107,11 @@ private constructor(
fun isConditionalAuthorizationAction(): Boolean =
conditionalAuthorizationAction != null
+ fun isConditionalAchAction(): Boolean = conditionalAchAction != null
+
+ fun isConditionalTokenizationAction(): Boolean =
+ conditionalTokenizationAction != null
+
fun asConditionalBlock(): ConditionalBlockParameters =
conditionalBlock.getOrThrow("conditionalBlock")
@@ -1953,6 +2127,12 @@ private constructor(
fun asConditionalAuthorizationAction(): ConditionalAuthorizationActionParameters =
conditionalAuthorizationAction.getOrThrow("conditionalAuthorizationAction")
+ fun asConditionalAchAction(): ConditionalAchActionParameters =
+ conditionalAchAction.getOrThrow("conditionalAchAction")
+
+ fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
+ conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -1967,6 +2147,12 @@ private constructor(
visitor.visitConditionalAuthorizationAction(
conditionalAuthorizationAction
)
+ conditionalAchAction != null ->
+ visitor.visitConditionalAchAction(conditionalAchAction)
+ conditionalTokenizationAction != null ->
+ visitor.visitConditionalTokenizationAction(
+ conditionalTokenizationAction
+ )
else -> visitor.unknown(_json)
}
@@ -2007,6 +2193,19 @@ private constructor(
) {
conditionalAuthorizationAction.validate()
}
+
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) {
+ conditionalAchAction.validate()
+ }
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters
+ ) {
+ conditionalTokenizationAction.validate()
+ }
}
)
validated = true
@@ -2050,6 +2249,15 @@ private constructor(
ConditionalAuthorizationActionParameters
) = conditionalAuthorizationAction.validity()
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = conditionalAchAction.validity()
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters
+ ) = conditionalTokenizationAction.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -2064,7 +2272,9 @@ private constructor(
velocityLimitParams == other.velocityLimitParams &&
merchantLock == other.merchantLock &&
conditional3dsAction == other.conditional3dsAction &&
- conditionalAuthorizationAction == other.conditionalAuthorizationAction
+ conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
+ conditionalAchAction == other.conditionalAchAction &&
+ conditionalTokenizationAction == other.conditionalTokenizationAction
}
override fun hashCode(): Int =
@@ -2074,6 +2284,8 @@ private constructor(
merchantLock,
conditional3dsAction,
conditionalAuthorizationAction,
+ conditionalAchAction,
+ conditionalTokenizationAction,
)
override fun toString(): String =
@@ -2086,6 +2298,10 @@ private constructor(
"Parameters{conditional3dsAction=$conditional3dsAction}"
conditionalAuthorizationAction != null ->
"Parameters{conditionalAuthorizationAction=$conditionalAuthorizationAction}"
+ conditionalAchAction != null ->
+ "Parameters{conditionalAchAction=$conditionalAchAction}"
+ conditionalTokenizationAction != null ->
+ "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -2113,6 +2329,16 @@ private constructor(
fun ofConditionalAuthorizationAction(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
) = Parameters(conditionalAuthorizationAction = conditionalAuthorizationAction)
+
+ @JvmStatic
+ fun ofConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = Parameters(conditionalAchAction = conditionalAchAction)
+
+ @JvmStatic
+ fun ofConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
}
/**
@@ -2135,6 +2361,14 @@ private constructor(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
): T
+ fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ): T
+
+ fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -2187,6 +2421,25 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let {
+ Parameters(conditionalAchAction = it, _json = json)
+ },
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalTokenizationActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalTokenizationAction = it,
+ _json = json,
+ )
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -2222,6 +2475,10 @@ private constructor(
generator.writeObject(value.conditional3dsAction)
value.conditionalAuthorizationAction != null ->
generator.writeObject(value.conditionalAuthorizationAction)
+ value.conditionalAchAction != null ->
+ generator.writeObject(value.conditionalAchAction)
+ value.conditionalTokenizationAction != null ->
+ generator.writeObject(value.conditionalTokenizationAction)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -2236,7 +2493,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType
@JsonCreator
@@ -2404,6 +2662,12 @@ private constructor(
@JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
+ @JvmField val TOKENIZATION = of("TOKENIZATION")
+
+ @JvmField val ACH_CREDIT_RECEIPT = of("ACH_CREDIT_RECEIPT")
+
+ @JvmField val ACH_DEBIT_RECEIPT = of("ACH_DEBIT_RECEIPT")
+
@JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
}
@@ -2411,6 +2675,9 @@ private constructor(
enum class Known {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
}
/**
@@ -2425,6 +2692,9 @@ private constructor(
enum class Value {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
/**
* An enum member indicating that [EventStream] was instantiated with an unknown
* value.
@@ -2443,6 +2713,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Value.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Value.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Value.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Value.ACH_DEBIT_RECEIPT
else -> Value._UNKNOWN
}
@@ -2459,6 +2732,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Known.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Known.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Known.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Known.ACH_DEBIT_RECEIPT
else -> throw LithicInvalidDataException("Unknown EventStream: $value")
}
@@ -2605,7 +2881,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*
* @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
@@ -2794,6 +3071,24 @@ private constructor(
Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAchAction(conditionalAchAction)`.
+ */
+ fun parameters(conditionalAchAction: ConditionalAchActionParameters) =
+ parameters(Parameters.ofConditionalAchAction(conditionalAchAction))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)`.
+ */
+ fun parameters(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
+ )
+
/** Whether the Auth Rule applies to all authorizations on the card program. */
fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel))
@@ -2816,7 +3111,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -2984,6 +3280,10 @@ private constructor(
private val conditionalAuthorizationAction:
ConditionalAuthorizationActionParameters? =
null,
+ private val conditionalAchAction: ConditionalAchActionParameters? = null,
+ private val conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters? =
+ null,
private val _json: JsonValue? = null,
) {
@@ -3003,6 +3303,13 @@ private constructor(
Optional =
Optional.ofNullable(conditionalAuthorizationAction)
+ fun conditionalAchAction(): Optional =
+ Optional.ofNullable(conditionalAchAction)
+
+ fun conditionalTokenizationAction():
+ Optional =
+ Optional.ofNullable(conditionalTokenizationAction)
+
fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -3014,6 +3321,11 @@ private constructor(
fun isConditionalAuthorizationAction(): Boolean =
conditionalAuthorizationAction != null
+ fun isConditionalAchAction(): Boolean = conditionalAchAction != null
+
+ fun isConditionalTokenizationAction(): Boolean =
+ conditionalTokenizationAction != null
+
fun asConditionalBlock(): ConditionalBlockParameters =
conditionalBlock.getOrThrow("conditionalBlock")
@@ -3029,6 +3341,12 @@ private constructor(
fun asConditionalAuthorizationAction(): ConditionalAuthorizationActionParameters =
conditionalAuthorizationAction.getOrThrow("conditionalAuthorizationAction")
+ fun asConditionalAchAction(): ConditionalAchActionParameters =
+ conditionalAchAction.getOrThrow("conditionalAchAction")
+
+ fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
+ conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -3043,6 +3361,12 @@ private constructor(
visitor.visitConditionalAuthorizationAction(
conditionalAuthorizationAction
)
+ conditionalAchAction != null ->
+ visitor.visitConditionalAchAction(conditionalAchAction)
+ conditionalTokenizationAction != null ->
+ visitor.visitConditionalTokenizationAction(
+ conditionalTokenizationAction
+ )
else -> visitor.unknown(_json)
}
@@ -3083,6 +3407,19 @@ private constructor(
) {
conditionalAuthorizationAction.validate()
}
+
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) {
+ conditionalAchAction.validate()
+ }
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters
+ ) {
+ conditionalTokenizationAction.validate()
+ }
}
)
validated = true
@@ -3126,6 +3463,15 @@ private constructor(
ConditionalAuthorizationActionParameters
) = conditionalAuthorizationAction.validity()
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = conditionalAchAction.validity()
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction:
+ ConditionalTokenizationActionParameters
+ ) = conditionalTokenizationAction.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -3140,7 +3486,9 @@ private constructor(
velocityLimitParams == other.velocityLimitParams &&
merchantLock == other.merchantLock &&
conditional3dsAction == other.conditional3dsAction &&
- conditionalAuthorizationAction == other.conditionalAuthorizationAction
+ conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
+ conditionalAchAction == other.conditionalAchAction &&
+ conditionalTokenizationAction == other.conditionalTokenizationAction
}
override fun hashCode(): Int =
@@ -3150,6 +3498,8 @@ private constructor(
merchantLock,
conditional3dsAction,
conditionalAuthorizationAction,
+ conditionalAchAction,
+ conditionalTokenizationAction,
)
override fun toString(): String =
@@ -3162,6 +3512,10 @@ private constructor(
"Parameters{conditional3dsAction=$conditional3dsAction}"
conditionalAuthorizationAction != null ->
"Parameters{conditionalAuthorizationAction=$conditionalAuthorizationAction}"
+ conditionalAchAction != null ->
+ "Parameters{conditionalAchAction=$conditionalAchAction}"
+ conditionalTokenizationAction != null ->
+ "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -3189,6 +3543,16 @@ private constructor(
fun ofConditionalAuthorizationAction(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
) = Parameters(conditionalAuthorizationAction = conditionalAuthorizationAction)
+
+ @JvmStatic
+ fun ofConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = Parameters(conditionalAchAction = conditionalAchAction)
+
+ @JvmStatic
+ fun ofConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
}
/**
@@ -3211,6 +3575,14 @@ private constructor(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
): T
+ fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ): T
+
+ fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -3263,6 +3635,25 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let {
+ Parameters(conditionalAchAction = it, _json = json)
+ },
+ tryDeserialize(
+ node,
+ jacksonTypeRef<
+ ConditionalTokenizationActionParameters
+ >(),
+ )
+ ?.let {
+ Parameters(
+ conditionalTokenizationAction = it,
+ _json = json,
+ )
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -3298,6 +3689,10 @@ private constructor(
generator.writeObject(value.conditional3dsAction)
value.conditionalAuthorizationAction != null ->
generator.writeObject(value.conditionalAuthorizationAction)
+ value.conditionalAchAction != null ->
+ generator.writeObject(value.conditionalAchAction)
+ value.conditionalTokenizationAction != null ->
+ generator.writeObject(value.conditionalTokenizationAction)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -3312,7 +3707,8 @@ private constructor(
* - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
* - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType
@JsonCreator
@@ -3480,6 +3876,12 @@ private constructor(
@JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
+ @JvmField val TOKENIZATION = of("TOKENIZATION")
+
+ @JvmField val ACH_CREDIT_RECEIPT = of("ACH_CREDIT_RECEIPT")
+
+ @JvmField val ACH_DEBIT_RECEIPT = of("ACH_DEBIT_RECEIPT")
+
@JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
}
@@ -3487,6 +3889,9 @@ private constructor(
enum class Known {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
}
/**
@@ -3501,6 +3906,9 @@ private constructor(
enum class Value {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
/**
* An enum member indicating that [EventStream] was instantiated with an unknown
* value.
@@ -3519,6 +3927,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Value.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Value.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Value.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Value.ACH_DEBIT_RECEIPT
else -> Value._UNKNOWN
}
@@ -3535,6 +3946,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Known.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Known.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Known.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Known.ACH_DEBIT_RECEIPT
else -> throw LithicInvalidDataException("Unknown EventStream: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
index da480f2e7..641c141a0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
@@ -162,6 +162,23 @@ private constructor(
body.parameters(conditionalAuthorizationAction)
}
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAchAction(conditionalAchAction)`.
+ */
+ fun parameters(conditionalAchAction: ConditionalAchActionParameters) = apply {
+ body.parameters(conditionalAchAction)
+ }
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)`.
+ */
+ fun parameters(conditionalTokenizationAction: ConditionalTokenizationActionParameters) =
+ apply {
+ body.parameters(conditionalTokenizationAction)
+ }
+
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
body.additionalProperties(additionalBodyProperties)
}
@@ -419,6 +436,22 @@ private constructor(
Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAchAction(conditionalAchAction)`.
+ */
+ fun parameters(conditionalAchAction: ConditionalAchActionParameters) =
+ parameters(Parameters.ofConditionalAchAction(conditionalAchAction))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)`.
+ */
+ fun parameters(conditionalTokenizationAction: ConditionalTokenizationActionParameters) =
+ parameters(
+ Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
+ )
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -503,6 +536,8 @@ private constructor(
private val conditional3dsAction: Conditional3dsActionParameters? = null,
private val conditionalAuthorizationAction: ConditionalAuthorizationActionParameters? =
null,
+ private val conditionalAchAction: ConditionalAchActionParameters? = null,
+ private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -520,6 +555,12 @@ private constructor(
fun conditionalAuthorizationAction(): Optional =
Optional.ofNullable(conditionalAuthorizationAction)
+ fun conditionalAchAction(): Optional =
+ Optional.ofNullable(conditionalAchAction)
+
+ fun conditionalTokenizationAction(): Optional =
+ Optional.ofNullable(conditionalTokenizationAction)
+
fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -530,6 +571,10 @@ private constructor(
fun isConditionalAuthorizationAction(): Boolean = conditionalAuthorizationAction != null
+ fun isConditionalAchAction(): Boolean = conditionalAchAction != null
+
+ fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+
fun asConditionalBlock(): ConditionalBlockParameters =
conditionalBlock.getOrThrow("conditionalBlock")
@@ -544,6 +589,12 @@ private constructor(
fun asConditionalAuthorizationAction(): ConditionalAuthorizationActionParameters =
conditionalAuthorizationAction.getOrThrow("conditionalAuthorizationAction")
+ fun asConditionalAchAction(): ConditionalAchActionParameters =
+ conditionalAchAction.getOrThrow("conditionalAchAction")
+
+ fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
+ conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -555,6 +606,10 @@ private constructor(
visitor.visitConditional3dsAction(conditional3dsAction)
conditionalAuthorizationAction != null ->
visitor.visitConditionalAuthorizationAction(conditionalAuthorizationAction)
+ conditionalAchAction != null ->
+ visitor.visitConditionalAchAction(conditionalAchAction)
+ conditionalTokenizationAction != null ->
+ visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
else -> visitor.unknown(_json)
}
@@ -594,6 +649,18 @@ private constructor(
) {
conditionalAuthorizationAction.validate()
}
+
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) {
+ conditionalAchAction.validate()
+ }
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) {
+ conditionalTokenizationAction.validate()
+ }
}
)
validated = true
@@ -636,6 +703,14 @@ private constructor(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
) = conditionalAuthorizationAction.validity()
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = conditionalAchAction.validity()
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = conditionalTokenizationAction.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -650,7 +725,9 @@ private constructor(
velocityLimitParams == other.velocityLimitParams &&
merchantLock == other.merchantLock &&
conditional3dsAction == other.conditional3dsAction &&
- conditionalAuthorizationAction == other.conditionalAuthorizationAction
+ conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
+ conditionalAchAction == other.conditionalAchAction &&
+ conditionalTokenizationAction == other.conditionalTokenizationAction
}
override fun hashCode(): Int =
@@ -660,6 +737,8 @@ private constructor(
merchantLock,
conditional3dsAction,
conditionalAuthorizationAction,
+ conditionalAchAction,
+ conditionalTokenizationAction,
)
override fun toString(): String =
@@ -672,6 +751,10 @@ private constructor(
"Parameters{conditional3dsAction=$conditional3dsAction}"
conditionalAuthorizationAction != null ->
"Parameters{conditionalAuthorizationAction=$conditionalAuthorizationAction}"
+ conditionalAchAction != null ->
+ "Parameters{conditionalAchAction=$conditionalAchAction}"
+ conditionalTokenizationAction != null ->
+ "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -698,6 +781,15 @@ private constructor(
fun ofConditionalAuthorizationAction(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
) = Parameters(conditionalAuthorizationAction = conditionalAuthorizationAction)
+
+ @JvmStatic
+ fun ofConditionalAchAction(conditionalAchAction: ConditionalAchActionParameters) =
+ Parameters(conditionalAchAction = conditionalAchAction)
+
+ @JvmStatic
+ fun ofConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
}
/**
@@ -717,6 +809,12 @@ private constructor(
conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
): T
+ fun visitConditionalAchAction(conditionalAchAction: ConditionalAchActionParameters): T
+
+ fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -756,6 +854,15 @@ private constructor(
?.let {
Parameters(conditionalAuthorizationAction = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(conditionalAchAction = it, _json = json) },
+ tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let {
+ Parameters(conditionalTokenizationAction = it, _json = json)
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -789,6 +896,10 @@ private constructor(
generator.writeObject(value.conditional3dsAction)
value.conditionalAuthorizationAction != null ->
generator.writeObject(value.conditionalAuthorizationAction)
+ value.conditionalAchAction != null ->
+ generator.writeObject(value.conditionalAchAction)
+ value.conditionalTokenizationAction != null ->
+ generator.writeObject(value.conditionalTokenizationAction)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt
index fd29f1ce5..56b4c09b8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListParams.kt
@@ -325,6 +325,12 @@ private constructor(
@JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
+ @JvmField val TOKENIZATION = of("TOKENIZATION")
+
+ @JvmField val ACH_CREDIT_RECEIPT = of("ACH_CREDIT_RECEIPT")
+
+ @JvmField val ACH_DEBIT_RECEIPT = of("ACH_DEBIT_RECEIPT")
+
@JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
}
@@ -332,6 +338,9 @@ private constructor(
enum class Known {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
}
/**
@@ -346,6 +355,9 @@ private constructor(
enum class Value {
AUTHORIZATION,
THREE_DS_AUTHENTICATION,
+ TOKENIZATION,
+ ACH_CREDIT_RECEIPT,
+ ACH_DEBIT_RECEIPT,
/**
* An enum member indicating that [EventStream] was instantiated with an unknown value.
*/
@@ -363,6 +375,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Value.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Value.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Value.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Value.ACH_DEBIT_RECEIPT
else -> Value._UNKNOWN
}
@@ -379,6 +394,9 @@ private constructor(
when (this) {
AUTHORIZATION -> Known.AUTHORIZATION
THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
+ TOKENIZATION -> Known.TOKENIZATION
+ ACH_CREDIT_RECEIPT -> Known.ACH_CREDIT_RECEIPT
+ ACH_DEBIT_RECEIPT -> Known.ACH_DEBIT_RECEIPT
else -> throw LithicInvalidDataException("Unknown EventStream: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt
index 799e4c552..5dcbcb5b1 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt
@@ -1615,8 +1615,8 @@ private constructor(
fun name(): Optional = name.getOptional("name")
/**
- * Home phone number provided by the cardholder. Maps to EMV 3DS fields `homePhone.cc` and
- * `homePhone.subscriber`.
+ * Home phone number in E.164 format provided by the cardholder. Maps to EMV 3DS fields
+ * `homePhone.cc` and `homePhone.subscriber`.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -1624,8 +1624,8 @@ private constructor(
fun phoneNumberHome(): Optional = phoneNumberHome.getOptional("phone_number_home")
/**
- * Mobile/cell phone number provided by the cardholder. Maps to EMV 3DS fields
- * `mobilePhone.cc` and `mobilePhone.subscriber`.
+ * Mobile/cell phone number in E.164 format provided by the cardholder. Maps to EMV 3DS
+ * fields `mobilePhone.cc` and `mobilePhone.subscriber`.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -1634,8 +1634,8 @@ private constructor(
phoneNumberMobile.getOptional("phone_number_mobile")
/**
- * Work phone number provided by the cardholder. Maps to EMV 3DS fields `workPhone.cc` and
- * `workPhone.subscriber`.
+ * Work phone number in E.164 format provided by the cardholder. Maps to EMV 3DS fields
+ * `workPhone.cc` and `workPhone.subscriber`.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -1881,8 +1881,8 @@ private constructor(
fun name(name: JsonField) = apply { this.name = name }
/**
- * Home phone number provided by the cardholder. Maps to EMV 3DS fields `homePhone.cc`
- * and `homePhone.subscriber`.
+ * Home phone number in E.164 format provided by the cardholder. Maps to EMV 3DS fields
+ * `homePhone.cc` and `homePhone.subscriber`.
*/
fun phoneNumberHome(phoneNumberHome: String?) =
phoneNumberHome(JsonField.ofNullable(phoneNumberHome))
@@ -1903,8 +1903,8 @@ private constructor(
}
/**
- * Mobile/cell phone number provided by the cardholder. Maps to EMV 3DS fields
- * `mobilePhone.cc` and `mobilePhone.subscriber`.
+ * Mobile/cell phone number in E.164 format provided by the cardholder. Maps to EMV 3DS
+ * fields `mobilePhone.cc` and `mobilePhone.subscriber`.
*/
fun phoneNumberMobile(phoneNumberMobile: String?) =
phoneNumberMobile(JsonField.ofNullable(phoneNumberMobile))
@@ -1927,8 +1927,8 @@ private constructor(
}
/**
- * Work phone number provided by the cardholder. Maps to EMV 3DS fields `workPhone.cc`
- * and `workPhone.subscriber`.
+ * Work phone number in E.164 format provided by the cardholder. Maps to EMV 3DS fields
+ * `workPhone.cc` and `workPhone.subscriber`.
*/
fun phoneNumberWork(phoneNumberWork: String?) =
phoneNumberWork(JsonField.ofNullable(phoneNumberWork))
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 e3b8e21b5..b5aaffabe 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
@@ -2342,6 +2342,8 @@ private constructor(
@JvmField val CANCELED = of("CANCELED")
+ @JvmField val RETURNED = of("RETURNED")
+
@JvmStatic fun of(value: String) = TransactionStatus(JsonField.of(value))
}
@@ -2352,6 +2354,7 @@ private constructor(
DECLINED,
REVERSED,
CANCELED,
+ RETURNED,
}
/**
@@ -2369,6 +2372,7 @@ private constructor(
DECLINED,
REVERSED,
CANCELED,
+ RETURNED,
/**
* An enum member indicating that [TransactionStatus] was instantiated with an unknown
* value.
@@ -2390,6 +2394,7 @@ private constructor(
DECLINED -> Value.DECLINED
REVERSED -> Value.REVERSED
CANCELED -> Value.CANCELED
+ RETURNED -> Value.RETURNED
else -> Value._UNKNOWN
}
@@ -2409,6 +2414,7 @@ private constructor(
DECLINED -> Known.DECLINED
REVERSED -> Known.REVERSED
CANCELED -> Known.CANCELED
+ RETURNED -> Known.RETURNED
else -> throw LithicInvalidDataException("Unknown TransactionStatus: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt
new file mode 100644
index 000000000..906e45055
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CategoryBalances.kt
@@ -0,0 +1,240 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.checkRequired
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Collections
+import java.util.Objects
+
+class CategoryBalances
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val fees: JsonField,
+ private val interest: JsonField,
+ private val principal: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("fees") @ExcludeMissing fees: JsonField = JsonMissing.of(),
+ @JsonProperty("interest") @ExcludeMissing interest: JsonField = JsonMissing.of(),
+ @JsonProperty("principal") @ExcludeMissing principal: JsonField = JsonMissing.of(),
+ ) : this(fees, interest, principal, mutableMapOf())
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun fees(): Long = fees.getRequired("fees")
+
+ /**
+ * @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 interest(): Long = interest.getRequired("interest")
+
+ /**
+ * @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 principal(): Long = principal.getRequired("principal")
+
+ /**
+ * Returns the raw JSON value of [fees].
+ *
+ * Unlike [fees], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("fees") @ExcludeMissing fun _fees(): JsonField = fees
+
+ /**
+ * Returns the raw JSON value of [interest].
+ *
+ * Unlike [interest], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("interest") @ExcludeMissing fun _interest(): JsonField = interest
+
+ /**
+ * Returns the raw JSON value of [principal].
+ *
+ * Unlike [principal], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("principal") @ExcludeMissing fun _principal(): JsonField = principal
+
+ @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 [CategoryBalances].
+ *
+ * The following fields are required:
+ * ```java
+ * .fees()
+ * .interest()
+ * .principal()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CategoryBalances]. */
+ class Builder internal constructor() {
+
+ private var fees: JsonField? = null
+ private var interest: JsonField? = null
+ private var principal: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(categoryBalances: CategoryBalances) = apply {
+ fees = categoryBalances.fees
+ interest = categoryBalances.interest
+ principal = categoryBalances.principal
+ additionalProperties = categoryBalances.additionalProperties.toMutableMap()
+ }
+
+ fun fees(fees: Long) = fees(JsonField.of(fees))
+
+ /**
+ * Sets [Builder.fees] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.fees] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun fees(fees: JsonField) = apply { this.fees = fees }
+
+ fun interest(interest: Long) = interest(JsonField.of(interest))
+
+ /**
+ * Sets [Builder.interest] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.interest] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun interest(interest: JsonField) = apply { this.interest = interest }
+
+ fun principal(principal: Long) = principal(JsonField.of(principal))
+
+ /**
+ * Sets [Builder.principal] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.principal] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun principal(principal: JsonField