From 899a3be4a06965cf3a37cf4ddf6f8581fac9351a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:40:50 +0000 Subject: [PATCH 01/14] feat(api): add override_company_name parameter to payment create --- .stats.yml | 4 +- .../lithic/api/models/PaymentCreateParams.kt | 63 +++++++++++++++++-- .../api/models/PaymentCreateParamsTest.kt | 3 + .../services/async/PaymentServiceAsyncTest.kt | 1 + .../services/blocking/PaymentServiceTest.kt | 1 + 5 files changed, 66 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2c9eb4a3..8315b1d8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-17c04dd1b0508b380c21e3acc3d4cd1e86b590f81d14fa26d1973b236f660e38.yml -openapi_spec_hash: f8ddee07358d2c938450a6889fbf7940 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-7349acbc90f2ba5668e44039a8e16c678944a2e83281f78e54812ba45904f49a.yml +openapi_spec_hash: d749723cb9a5dca308c467a01cfdc3e9 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt index c23de0e6..70698404 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt @@ -1152,6 +1152,7 @@ private constructor( private val secCode: JsonField, private val achHoldPeriod: JsonField, private val addenda: JsonField, + private val overrideCompanyName: JsonField, private val additionalProperties: MutableMap, ) { @@ -1164,7 +1165,10 @@ private constructor( @ExcludeMissing achHoldPeriod: JsonField = JsonMissing.of(), @JsonProperty("addenda") @ExcludeMissing addenda: JsonField = JsonMissing.of(), - ) : this(secCode, achHoldPeriod, addenda, mutableMapOf()) + @JsonProperty("override_company_name") + @ExcludeMissing + overrideCompanyName: JsonField = JsonMissing.of(), + ) : this(secCode, achHoldPeriod, addenda, overrideCompanyName, mutableMapOf()) /** * @throws LithicInvalidDataException if the JSON field has an unexpected type or is @@ -1186,6 +1190,16 @@ private constructor( */ fun addenda(): Optional = addenda.getOptional("addenda") + /** + * Value to override the configured company name with. Can only be used if allowed to + * override + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun overrideCompanyName(): Optional = + overrideCompanyName.getOptional("override_company_name") + /** * Returns the raw JSON value of [secCode]. * @@ -1210,6 +1224,16 @@ private constructor( */ @JsonProperty("addenda") @ExcludeMissing fun _addenda(): JsonField = addenda + /** + * Returns the raw JSON value of [overrideCompanyName]. + * + * Unlike [overrideCompanyName], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("override_company_name") + @ExcludeMissing + fun _overrideCompanyName(): JsonField = overrideCompanyName + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1242,6 +1266,7 @@ private constructor( private var secCode: JsonField? = null private var achHoldPeriod: JsonField = JsonMissing.of() private var addenda: JsonField = JsonMissing.of() + private var overrideCompanyName: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1250,6 +1275,7 @@ private constructor( secCode = paymentMethodRequestAttributes.secCode achHoldPeriod = paymentMethodRequestAttributes.achHoldPeriod addenda = paymentMethodRequestAttributes.addenda + overrideCompanyName = paymentMethodRequestAttributes.overrideCompanyName additionalProperties = paymentMethodRequestAttributes.additionalProperties.toMutableMap() } @@ -1293,6 +1319,31 @@ private constructor( */ fun addenda(addenda: JsonField) = apply { this.addenda = addenda } + /** + * Value to override the configured company name with. Can only be used if allowed to + * override + */ + fun overrideCompanyName(overrideCompanyName: String?) = + overrideCompanyName(JsonField.ofNullable(overrideCompanyName)) + + /** + * Alias for calling [Builder.overrideCompanyName] with + * `overrideCompanyName.orElse(null)`. + */ + fun overrideCompanyName(overrideCompanyName: Optional) = + overrideCompanyName(overrideCompanyName.getOrNull()) + + /** + * Sets [Builder.overrideCompanyName] to an arbitrary JSON value. + * + * You should usually call [Builder.overrideCompanyName] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun overrideCompanyName(overrideCompanyName: JsonField) = apply { + this.overrideCompanyName = overrideCompanyName + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1329,6 +1380,7 @@ private constructor( checkRequired("secCode", secCode), achHoldPeriod, addenda, + overrideCompanyName, additionalProperties.toMutableMap(), ) } @@ -1343,6 +1395,7 @@ private constructor( secCode().validate() achHoldPeriod() addenda() + overrideCompanyName() validated = true } @@ -1364,7 +1417,8 @@ private constructor( internal fun validity(): Int = (secCode.asKnown().getOrNull()?.validity() ?: 0) + (if (achHoldPeriod.asKnown().isPresent) 1 else 0) + - (if (addenda.asKnown().isPresent) 1 else 0) + (if (addenda.asKnown().isPresent) 1 else 0) + + (if (overrideCompanyName.asKnown().isPresent) 1 else 0) class SecCode @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1511,17 +1565,18 @@ private constructor( secCode == other.secCode && achHoldPeriod == other.achHoldPeriod && addenda == other.addenda && + overrideCompanyName == other.overrideCompanyName && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(secCode, achHoldPeriod, addenda, additionalProperties) + Objects.hash(secCode, achHoldPeriod, addenda, overrideCompanyName, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "PaymentMethodRequestAttributes{secCode=$secCode, achHoldPeriod=$achHoldPeriod, addenda=$addenda, additionalProperties=$additionalProperties}" + "PaymentMethodRequestAttributes{secCode=$secCode, achHoldPeriod=$achHoldPeriod, addenda=$addenda, overrideCompanyName=$overrideCompanyName, additionalProperties=$additionalProperties}" } class Type @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt index f94636cd..d69a590c 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt @@ -19,6 +19,7 @@ internal class PaymentCreateParamsTest { .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD) .achHoldPeriod(0L) .addenda("addenda") + .overrideCompanyName("override_company_name") .build() ) .type(PaymentCreateParams.Type.COLLECTION) @@ -46,6 +47,7 @@ internal class PaymentCreateParamsTest { .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD) .achHoldPeriod(0L) .addenda("addenda") + .overrideCompanyName("override_company_name") .build() ) .type(PaymentCreateParams.Type.COLLECTION) @@ -72,6 +74,7 @@ internal class PaymentCreateParamsTest { .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD) .achHoldPeriod(0L) .addenda("addenda") + .overrideCompanyName("override_company_name") .build() ) assertThat(body.type()).isEqualTo(PaymentCreateParams.Type.COLLECTION) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt index df3aafba..45c7d5e5 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/PaymentServiceAsyncTest.kt @@ -38,6 +38,7 @@ internal class PaymentServiceAsyncTest { .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD) .achHoldPeriod(0L) .addenda("addenda") + .overrideCompanyName("override_company_name") .build() ) .type(PaymentCreateParams.Type.COLLECTION) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt index 82d833e0..06ff4622 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt @@ -38,6 +38,7 @@ internal class PaymentServiceTest { .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD) .achHoldPeriod(0L) .addenda("addenda") + .overrideCompanyName("override_company_name") .build() ) .type(PaymentCreateParams.Type.COLLECTION) From c266aa2a776ae772b05a025dab383477ec5c2d0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:21:08 +0000 Subject: [PATCH 02/14] chore(ci): skip lint on metadata-only changes Note that we still want to run tests, as these depend on the metadata. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40ef7f83..906878cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 15 name: lint runs-on: ${{ github.repository == 'stainless-sdks/lithic-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -46,7 +46,7 @@ jobs: contents: read id-token: write runs-on: ${{ github.repository == 'stainless-sdks/lithic-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 From 5feba92cc13a3877fb2769d8808e65959b4b12b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:28:48 +0000 Subject: [PATCH 03/14] fix(types): make data and has_more required in AccountActivityListPageResponse --- .stats.yml | 4 +-- .../models/AccountActivityListPageResponse.kt | 36 +++++++++++++------ .../AccountActivityListPageResponseTest.kt | 5 ++- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8315b1d8..885c1016 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-7349acbc90f2ba5668e44039a8e16c678944a2e83281f78e54812ba45904f49a.yml -openapi_spec_hash: d749723cb9a5dca308c467a01cfdc3e9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-8b222de46ecf164a1d6e47c5e677d6e1772c7b1726d0574d9322305c9af4eec6.yml +openapi_spec_hash: f573dc729467c8c592750677f45a3ea4 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt index ccf10fd8..db504ef4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt @@ -11,11 +11,11 @@ import com.lithic.api.core.JsonField import com.lithic.api.core.JsonMissing import com.lithic.api.core.JsonValue import com.lithic.api.core.checkKnown +import com.lithic.api.core.checkRequired import com.lithic.api.core.toImmutable import com.lithic.api.errors.LithicInvalidDataException import java.util.Collections import java.util.Objects -import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A response containing a list of transactions */ @@ -36,18 +36,18 @@ private constructor( ) : this(data, hasMore, mutableMapOf()) /** - * @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 data(): Optional> = data.getOptional("data") + fun data(): List = data.getRequired("data") /** * Indicates if there are more transactions available for pagination * - * @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 hasMore(): Optional = hasMore.getOptional("has_more") + fun hasMore(): Boolean = hasMore.getRequired("has_more") /** * Returns the raw JSON value of [data]. @@ -82,6 +82,12 @@ private constructor( /** * Returns a mutable builder for constructing an instance of * [AccountActivityListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .hasMore() + * ``` */ @JvmStatic fun builder() = Builder() } @@ -90,7 +96,7 @@ private constructor( class Builder internal constructor() { private var data: JsonField>? = null - private var hasMore: JsonField = JsonMissing.of() + private var hasMore: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -193,11 +199,19 @@ private constructor( * Returns an immutable instance of [AccountActivityListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .hasMore() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ fun build(): AccountActivityListPageResponse = AccountActivityListPageResponse( - (data ?: JsonMissing.of()).map { it.toImmutable() }, - hasMore, + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("hasMore", hasMore), additionalProperties.toMutableMap(), ) } @@ -209,7 +223,7 @@ private constructor( return@apply } - data().ifPresent { it.forEach { it.validate() } } + data().forEach { it.validate() } hasMore() validated = true } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt index 97cb2ad4..032617c4 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt @@ -5,7 +5,6 @@ package com.lithic.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.lithic.api.core.jsonMapper import java.time.OffsetDateTime -import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -51,7 +50,7 @@ internal class AccountActivityListPageResponseTest { .hasMore(true) .build() - assertThat(accountActivityListPageResponse.data().getOrNull()) + assertThat(accountActivityListPageResponse.data()) .containsExactly( AccountActivityListResponse.ofInternal( AccountActivityListResponse.FinancialTransaction.builder() @@ -87,7 +86,7 @@ internal class AccountActivityListPageResponseTest { .build() ) ) - assertThat(accountActivityListPageResponse.hasMore()).contains(true) + assertThat(accountActivityListPageResponse.hasMore()).isEqualTo(true) } @Test From 2fe328dff29b7df2d9096274e5725e1bf37df25f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:08:38 +0000 Subject: [PATCH 04/14] docs(api): update natureOfBusiness and qrCodeUrl parameter descriptions --- .stats.yml | 4 +- .../com/lithic/api/models/CardBulkOrder.kt | 33 ++++++++++++-- .../api/models/CardBulkOrderCreateParams.kt | 45 +++++++++++++++---- .../api/models/CardBulkOrderListParams.kt | 2 +- .../api/models/CardBulkOrderRetrieveParams.kt | 2 +- .../api/models/CardBulkOrderUpdateParams.kt | 4 +- .../api/models/CardConvertPhysicalParams.kt | 25 ++++++----- .../com/lithic/api/models/CardCreateParams.kt | 25 ++++++----- .../lithic/api/models/CardReissueParams.kt | 25 ++++++----- .../com/lithic/api/models/CardRenewParams.kt | 25 ++++++----- .../async/CardBulkOrderServiceAsync.kt | 14 +++--- .../services/blocking/CardBulkOrderService.kt | 14 +++--- 12 files changed, 146 insertions(+), 72 deletions(-) diff --git a/.stats.yml b/.stats.yml index 885c1016..f20dc054 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-8b222de46ecf164a1d6e47c5e677d6e1772c7b1726d0574d9322305c9af4eec6.yml -openapi_spec_hash: f573dc729467c8c592750677f45a3ea4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-eb2cf51467f505a1d29c3ca40b9595ecbf6d6a3743f53bc42a52c8135a252ff0.yml +openapi_spec_hash: 2fbd71b69d71138b3e54432a38d759ed config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt index 7de48325..d0a76573 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrder.kt @@ -116,7 +116,8 @@ private constructor( fun _shippingAddress(): JsonValue = shippingAddress /** - * Shipping method for all cards in this bulk order + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and BULK_EXPRESS + * are only available with Perfect Plastic Printing * * @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). @@ -330,7 +331,10 @@ private constructor( this.shippingAddress = shippingAddress } - /** Shipping method for all cards in this bulk order */ + /** + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + * BULK_EXPRESS are only available with Perfect Plastic Printing + */ fun shippingMethod(shippingMethod: ShippingMethod) = shippingMethod(JsonField.of(shippingMethod)) @@ -463,7 +467,10 @@ private constructor( (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) - /** Shipping method for all cards in this bulk order */ + /** + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and BULK_EXPRESS + * are only available with Perfect Plastic Printing + */ class ShippingMethod @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -481,12 +488,21 @@ private constructor( @JvmField val BULK_EXPEDITED = of("BULK_EXPEDITED") + @JvmField val BULK_PRIORITY = of("BULK_PRIORITY") + + @JvmField val BULK_2_DAY = of("BULK_2_DAY") + + @JvmField val BULK_EXPRESS = of("BULK_EXPRESS") + @JvmStatic fun of(value: String) = ShippingMethod(JsonField.of(value)) } /** An enum containing [ShippingMethod]'s known values. */ enum class Known { - BULK_EXPEDITED + BULK_EXPEDITED, + BULK_PRIORITY, + BULK_2_DAY, + BULK_EXPRESS, } /** @@ -500,6 +516,9 @@ private constructor( */ enum class Value { BULK_EXPEDITED, + BULK_PRIORITY, + BULK_2_DAY, + BULK_EXPRESS, /** * An enum member indicating that [ShippingMethod] was instantiated with an unknown * value. @@ -517,6 +536,9 @@ private constructor( fun value(): Value = when (this) { BULK_EXPEDITED -> Value.BULK_EXPEDITED + BULK_PRIORITY -> Value.BULK_PRIORITY + BULK_2_DAY -> Value.BULK_2_DAY + BULK_EXPRESS -> Value.BULK_EXPRESS else -> Value._UNKNOWN } @@ -532,6 +554,9 @@ private constructor( fun known(): Known = when (this) { BULK_EXPEDITED -> Known.BULK_EXPEDITED + BULK_PRIORITY -> Known.BULK_PRIORITY + BULK_2_DAY -> Known.BULK_2_DAY + BULK_EXPRESS -> Known.BULK_EXPRESS else -> throw LithicInvalidDataException("Unknown ShippingMethod: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt index 98a6abe3..e230278b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderCreateParams.kt @@ -21,8 +21,8 @@ import java.util.Objects import kotlin.jvm.optionals.getOrNull /** - * Create a new bulk order for physical card shipments **[BETA]**. Cards can be added to the order - * via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH + * Create a new bulk order for physical card shipments. Cards can be added to the order via the POST + * /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH * /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your Customer * Success Manager and card personalization bureau to ensure bulk shipping is supported for your * program. @@ -54,7 +54,8 @@ private constructor( fun _shippingAddress(): JsonValue = body._shippingAddress() /** - * Shipping method for all cards in this bulk order + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and BULK_EXPRESS + * are only available with Perfect Plastic Printing * * @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). @@ -150,7 +151,10 @@ private constructor( body.shippingAddress(shippingAddress) } - /** Shipping method for all cards in this bulk order */ + /** + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + * BULK_EXPRESS are only available with Perfect Plastic Printing + */ fun shippingMethod(shippingMethod: ShippingMethod) = apply { body.shippingMethod(shippingMethod) } @@ -360,7 +364,8 @@ private constructor( fun _shippingAddress(): JsonValue = shippingAddress /** - * Shipping method for all cards in this bulk order + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + * BULK_EXPRESS are only available with Perfect Plastic Printing * * @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). @@ -453,7 +458,10 @@ private constructor( this.shippingAddress = shippingAddress } - /** Shipping method for all cards in this bulk order */ + /** + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + * BULK_EXPRESS are only available with Perfect Plastic Printing + */ fun shippingMethod(shippingMethod: ShippingMethod) = shippingMethod(JsonField.of(shippingMethod)) @@ -563,7 +571,10 @@ private constructor( "CreateBulkOrderRequest{customerProductId=$customerProductId, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, additionalProperties=$additionalProperties}" } - /** Shipping method for all cards in this bulk order */ + /** + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and BULK_EXPRESS + * are only available with Perfect Plastic Printing + */ class ShippingMethod @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -581,12 +592,21 @@ private constructor( @JvmField val BULK_EXPEDITED = of("BULK_EXPEDITED") + @JvmField val BULK_PRIORITY = of("BULK_PRIORITY") + + @JvmField val BULK_2_DAY = of("BULK_2_DAY") + + @JvmField val BULK_EXPRESS = of("BULK_EXPRESS") + @JvmStatic fun of(value: String) = ShippingMethod(JsonField.of(value)) } /** An enum containing [ShippingMethod]'s known values. */ enum class Known { - BULK_EXPEDITED + BULK_EXPEDITED, + BULK_PRIORITY, + BULK_2_DAY, + BULK_EXPRESS, } /** @@ -600,6 +620,9 @@ private constructor( */ enum class Value { BULK_EXPEDITED, + BULK_PRIORITY, + BULK_2_DAY, + BULK_EXPRESS, /** * An enum member indicating that [ShippingMethod] was instantiated with an unknown * value. @@ -617,6 +640,9 @@ private constructor( fun value(): Value = when (this) { BULK_EXPEDITED -> Value.BULK_EXPEDITED + BULK_PRIORITY -> Value.BULK_PRIORITY + BULK_2_DAY -> Value.BULK_2_DAY + BULK_EXPRESS -> Value.BULK_EXPRESS else -> Value._UNKNOWN } @@ -632,6 +658,9 @@ private constructor( fun known(): Known = when (this) { BULK_EXPEDITED -> Known.BULK_EXPEDITED + BULK_PRIORITY -> Known.BULK_PRIORITY + BULK_2_DAY -> Known.BULK_2_DAY + BULK_EXPRESS -> Known.BULK_EXPRESS else -> throw LithicInvalidDataException("Unknown ShippingMethod: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListParams.kt index 48db021e..3f841075 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderListParams.kt @@ -11,7 +11,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** List bulk orders for physical card shipments **[BETA]** */ +/** List bulk orders for physical card shipments */ class CardBulkOrderListParams private constructor( private val begin: OffsetDateTime?, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderRetrieveParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderRetrieveParams.kt index 554c19d6..bdda850c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderRetrieveParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderRetrieveParams.kt @@ -9,7 +9,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Retrieve a specific bulk order by token **[BETA]** */ +/** Retrieve a specific bulk order by token */ class CardBulkOrderRetrieveParams private constructor( private val bulkOrderToken: String?, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt index c495aa14..2acbedea 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardBulkOrderUpdateParams.kt @@ -22,8 +22,8 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * Update a bulk order **[BETA]**. Primarily used to lock the order, preventing additional cards - * from being added + * Update a bulk order. Primarily used to lock the order, preventing additional cards from being + * added */ class CardBulkOrderUpdateParams private constructor( diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt index a593b9c2..cf9eef55 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardConvertPhysicalParams.kt @@ -78,7 +78,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -224,7 +225,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = apply { body.shippingMethod(shippingMethod) @@ -453,7 +455,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -594,7 +597,8 @@ private constructor( * tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping + * method and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = shippingMethod(JsonField.of(shippingMethod)) @@ -720,7 +724,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. */ class ShippingMethod @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -739,7 +744,7 @@ private constructor( @JvmField val _2_DAY = of("2_DAY") - @JvmField val BULK_EXPEDITED = of("BULK_EXPEDITED") + @JvmField val BULK = of("BULK") @JvmField val EXPEDITED = of("EXPEDITED") @@ -757,7 +762,7 @@ private constructor( /** An enum containing [ShippingMethod]'s known values. */ enum class Known { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -776,7 +781,7 @@ private constructor( */ enum class Value { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -799,7 +804,7 @@ private constructor( fun value(): Value = when (this) { _2_DAY -> Value._2_DAY - BULK_EXPEDITED -> Value.BULK_EXPEDITED + BULK -> Value.BULK EXPEDITED -> Value.EXPEDITED EXPRESS -> Value.EXPRESS PRIORITY -> Value.PRIORITY @@ -820,7 +825,7 @@ private constructor( fun known(): Known = when (this) { _2_DAY -> Known._2_DAY - BULK_EXPEDITED -> Known.BULK_EXPEDITED + BULK -> Known.BULK EXPEDITED -> Known.EXPEDITED EXPRESS -> Known.EXPRESS PRIORITY -> Known.PRIORITY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt index 552485e7..efa44b41 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt @@ -224,7 +224,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -779,7 +780,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = apply { body.shippingMethod(shippingMethod) @@ -1303,7 +1305,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1915,7 +1918,8 @@ private constructor( * tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping + * method and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = shippingMethod(JsonField.of(shippingMethod)) @@ -2560,7 +2564,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. */ class ShippingMethod @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -2579,7 +2584,7 @@ private constructor( @JvmField val _2_DAY = of("2_DAY") - @JvmField val BULK_EXPEDITED = of("BULK_EXPEDITED") + @JvmField val BULK = of("BULK") @JvmField val EXPEDITED = of("EXPEDITED") @@ -2597,7 +2602,7 @@ private constructor( /** An enum containing [ShippingMethod]'s known values. */ enum class Known { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -2616,7 +2621,7 @@ private constructor( */ enum class Value { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -2639,7 +2644,7 @@ private constructor( fun value(): Value = when (this) { _2_DAY -> Value._2_DAY - BULK_EXPEDITED -> Value.BULK_EXPEDITED + BULK -> Value.BULK EXPEDITED -> Value.EXPEDITED EXPRESS -> Value.EXPRESS PRIORITY -> Value.PRIORITY @@ -2660,7 +2665,7 @@ private constructor( fun known(): Known = when (this) { _2_DAY -> Known._2_DAY - BULK_EXPEDITED -> Known.BULK_EXPEDITED + BULK -> Known.BULK EXPEDITED -> Known.EXPEDITED EXPRESS -> Known.EXPRESS PRIORITY -> Known.PRIORITY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt index 9bdc4068..5567f469 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt @@ -73,7 +73,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -214,7 +215,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = apply { body.shippingMethod(shippingMethod) @@ -437,7 +439,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -571,7 +574,8 @@ private constructor( * tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping + * method and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = shippingMethod(JsonField.of(shippingMethod)) @@ -690,7 +694,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. */ class ShippingMethod @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -709,7 +714,7 @@ private constructor( @JvmField val _2_DAY = of("2_DAY") - @JvmField val BULK_EXPEDITED = of("BULK_EXPEDITED") + @JvmField val BULK = of("BULK") @JvmField val EXPEDITED = of("EXPEDITED") @@ -727,7 +732,7 @@ private constructor( /** An enum containing [ShippingMethod]'s known values. */ enum class Known { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -746,7 +751,7 @@ private constructor( */ enum class Value { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -769,7 +774,7 @@ private constructor( fun value(): Value = when (this) { _2_DAY -> Value._2_DAY - BULK_EXPEDITED -> Value.BULK_EXPEDITED + BULK -> Value.BULK EXPEDITED -> Value.EXPEDITED EXPRESS -> Value.EXPRESS PRIORITY -> Value.PRIORITY @@ -790,7 +795,7 @@ private constructor( fun known(): Known = when (this) { _2_DAY -> Known._2_DAY - BULK_EXPEDITED -> Known.BULK_EXPEDITED + BULK -> Known.BULK EXPEDITED -> Known.EXPEDITED EXPRESS -> Known.EXPRESS PRIORITY -> Known.PRIORITY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt index cffea8f5..0f50a0c7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt @@ -95,7 +95,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -285,7 +286,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = apply { body.shippingMethod(shippingMethod) @@ -546,7 +548,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method + * and timeline are inherited from the parent bulk order. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -735,7 +738,8 @@ private constructor( * tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or * similar international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping + * method and timeline are inherited from the parent bulk order. */ fun shippingMethod(shippingMethod: ShippingMethod) = shippingMethod(JsonField.of(shippingMethod)) @@ -877,7 +881,8 @@ private constructor( * * `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking * * `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar * international option, with tracking - * * `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * * `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and + * timeline are inherited from the parent bulk order. */ class ShippingMethod @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -896,7 +901,7 @@ private constructor( @JvmField val _2_DAY = of("2_DAY") - @JvmField val BULK_EXPEDITED = of("BULK_EXPEDITED") + @JvmField val BULK = of("BULK") @JvmField val EXPEDITED = of("EXPEDITED") @@ -914,7 +919,7 @@ private constructor( /** An enum containing [ShippingMethod]'s known values. */ enum class Known { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -933,7 +938,7 @@ private constructor( */ enum class Value { _2_DAY, - BULK_EXPEDITED, + BULK, EXPEDITED, EXPRESS, PRIORITY, @@ -956,7 +961,7 @@ private constructor( fun value(): Value = when (this) { _2_DAY -> Value._2_DAY - BULK_EXPEDITED -> Value.BULK_EXPEDITED + BULK -> Value.BULK EXPEDITED -> Value.EXPEDITED EXPRESS -> Value.EXPRESS PRIORITY -> Value.PRIORITY @@ -977,7 +982,7 @@ private constructor( fun known(): Known = when (this) { _2_DAY -> Known._2_DAY - BULK_EXPEDITED -> Known.BULK_EXPEDITED + BULK -> Known.BULK EXPEDITED -> Known.EXPEDITED EXPRESS -> Known.EXPRESS PRIORITY -> Known.PRIORITY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardBulkOrderServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardBulkOrderServiceAsync.kt index e21cf894..0bb832df 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardBulkOrderServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardBulkOrderServiceAsync.kt @@ -29,9 +29,9 @@ interface CardBulkOrderServiceAsync { fun withOptions(modifier: Consumer): CardBulkOrderServiceAsync /** - * Create a new bulk order for physical card shipments **[BETA]**. Cards can be added to the - * order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via - * PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your + * Create a new bulk order for physical card shipments. Cards can be added to the order via the + * POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH + * /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your * Customer Success Manager and card personalization bureau to ensure bulk shipping is supported * for your program. */ @@ -44,7 +44,7 @@ interface CardBulkOrderServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture - /** Retrieve a specific bulk order by token **[BETA]** */ + /** Retrieve a specific bulk order by token */ fun retrieve(bulkOrderToken: String): CompletableFuture = retrieve(bulkOrderToken, CardBulkOrderRetrieveParams.none()) @@ -80,8 +80,8 @@ interface CardBulkOrderServiceAsync { retrieve(bulkOrderToken, CardBulkOrderRetrieveParams.none(), requestOptions) /** - * Update a bulk order **[BETA]**. Primarily used to lock the order, preventing additional cards - * from being added + * Update a bulk order. Primarily used to lock the order, preventing additional cards from being + * added */ fun update( bulkOrderToken: String, @@ -106,7 +106,7 @@ interface CardBulkOrderServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture - /** List bulk orders for physical card shipments **[BETA]** */ + /** List bulk orders for physical card shipments */ fun list(): CompletableFuture = list(CardBulkOrderListParams.none()) /** @see list */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardBulkOrderService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardBulkOrderService.kt index 6339c2cc..ad70ce11 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardBulkOrderService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardBulkOrderService.kt @@ -29,9 +29,9 @@ interface CardBulkOrderService { fun withOptions(modifier: Consumer): CardBulkOrderService /** - * Create a new bulk order for physical card shipments **[BETA]**. Cards can be added to the - * order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via - * PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your + * Create a new bulk order for physical card shipments. Cards can be added to the order via the + * POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH + * /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your * Customer Success Manager and card personalization bureau to ensure bulk shipping is supported * for your program. */ @@ -44,7 +44,7 @@ interface CardBulkOrderService { requestOptions: RequestOptions = RequestOptions.none(), ): CardBulkOrder - /** Retrieve a specific bulk order by token **[BETA]** */ + /** Retrieve a specific bulk order by token */ fun retrieve(bulkOrderToken: String): CardBulkOrder = retrieve(bulkOrderToken, CardBulkOrderRetrieveParams.none()) @@ -77,8 +77,8 @@ interface CardBulkOrderService { retrieve(bulkOrderToken, CardBulkOrderRetrieveParams.none(), requestOptions) /** - * Update a bulk order **[BETA]**. Primarily used to lock the order, preventing additional cards - * from being added + * Update a bulk order. Primarily used to lock the order, preventing additional cards from being + * added */ fun update(bulkOrderToken: String, params: CardBulkOrderUpdateParams): CardBulkOrder = update(bulkOrderToken, params, RequestOptions.none()) @@ -101,7 +101,7 @@ interface CardBulkOrderService { requestOptions: RequestOptions = RequestOptions.none(), ): CardBulkOrder - /** List bulk orders for physical card shipments **[BETA]** */ + /** List bulk orders for physical card shipments */ fun list(): CardBulkOrderListPage = list(CardBulkOrderListParams.none()) /** @see list */ From 65f1c4b2a4c28c8a9fbc07a187fb01cf4567461c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:08:32 +0000 Subject: [PATCH 05/14] feat(api): add card decline count values to conditional authorization --- .stats.yml | 4 +-- ...onditionalAuthorizationActionParameters.kt | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f20dc054..d11f292a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-eb2cf51467f505a1d29c3ca40b9595ecbf6d6a3743f53bc42a52c8135a252ff0.yml -openapi_spec_hash: 2fbd71b69d71138b3e54432a38d759ed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-27d13d3d5226c710b07f9fc954fa53a8e6923e74d90d3f587d96399c1baf4de3.yml +openapi_spec_hash: 99a60cbd91f32b25617a9536fadebf07 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt index e148e23b..b571582e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalAuthorizationActionParameters.kt @@ -409,6 +409,12 @@ private constructor( * hour up and until the authorization. * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the trailing 24 * hours up and until the authorization. + * * `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in the + * trailing 15 minutes before the authorization. + * * `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in the + * trailing hour up and until the authorization. + * * `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in the + * trailing 24 hours up and until the authorization. * * `CARD_STATE`: The current state of the card associated with the transaction. Valid * values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. * * `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. Valid values @@ -563,6 +569,12 @@ private constructor( * hour up and until the authorization. * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the * trailing 24 hours up and until the authorization. + * * `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in the + * trailing 15 minutes before the authorization. + * * `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in the + * trailing hour up and until the authorization. + * * `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in the + * trailing 24 hours up and until the authorization. * * `CARD_STATE`: The current state of the card associated with the transaction. Valid * values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. * * `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. Valid @@ -750,6 +762,12 @@ private constructor( * hour up and until the authorization. * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the trailing 24 * hours up and until the authorization. + * * `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in the + * trailing 15 minutes before the authorization. + * * `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in the + * trailing hour up and until the authorization. + * * `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in the + * trailing 24 hours up and until the authorization. * * `CARD_STATE`: The current state of the card associated with the transaction. Valid * values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. * * `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. Valid values @@ -817,6 +835,12 @@ private constructor( @JvmField val CARD_TRANSACTION_COUNT_24_H = of("CARD_TRANSACTION_COUNT_24H") + @JvmField val CARD_DECLINE_COUNT_15_M = of("CARD_DECLINE_COUNT_15M") + + @JvmField val CARD_DECLINE_COUNT_1_H = of("CARD_DECLINE_COUNT_1H") + + @JvmField val CARD_DECLINE_COUNT_24_H = of("CARD_DECLINE_COUNT_24H") + @JvmField val CARD_STATE = of("CARD_STATE") @JvmField val PIN_ENTERED = of("PIN_ENTERED") @@ -855,6 +879,9 @@ private constructor( CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, CARD_TRANSACTION_COUNT_24_H, + CARD_DECLINE_COUNT_15_M, + CARD_DECLINE_COUNT_1_H, + CARD_DECLINE_COUNT_24_H, CARD_STATE, PIN_ENTERED, PIN_STATUS, @@ -890,6 +917,9 @@ private constructor( CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, CARD_TRANSACTION_COUNT_24_H, + CARD_DECLINE_COUNT_15_M, + CARD_DECLINE_COUNT_1_H, + CARD_DECLINE_COUNT_24_H, CARD_STATE, PIN_ENTERED, PIN_STATUS, @@ -929,6 +959,9 @@ private constructor( CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H CARD_TRANSACTION_COUNT_24_H -> Value.CARD_TRANSACTION_COUNT_24_H + CARD_DECLINE_COUNT_15_M -> Value.CARD_DECLINE_COUNT_15_M + CARD_DECLINE_COUNT_1_H -> Value.CARD_DECLINE_COUNT_1_H + CARD_DECLINE_COUNT_24_H -> Value.CARD_DECLINE_COUNT_24_H CARD_STATE -> Value.CARD_STATE PIN_ENTERED -> Value.PIN_ENTERED PIN_STATUS -> Value.PIN_STATUS @@ -966,6 +999,9 @@ private constructor( CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H CARD_TRANSACTION_COUNT_24_H -> Known.CARD_TRANSACTION_COUNT_24_H + CARD_DECLINE_COUNT_15_M -> Known.CARD_DECLINE_COUNT_15_M + CARD_DECLINE_COUNT_1_H -> Known.CARD_DECLINE_COUNT_1_H + CARD_DECLINE_COUNT_24_H -> Known.CARD_DECLINE_COUNT_24_H CARD_STATE -> Known.CARD_STATE PIN_ENTERED -> Known.PIN_ENTERED PIN_STATUS -> Known.PIN_STATUS From 44d890e17988a1e587124a95afe3984c99a3bca0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:41:05 +0000 Subject: [PATCH 06/14] feat(api): add statement_totals field to Statement/StatementsCreatedWebhookEvent --- .stats.yml | 4 +- .../kotlin/com/lithic/api/models/Statement.kt | 46 ++++++++++++++++++- .../models/StatementsCreatedWebhookEvent.kt | 45 +++++++++++++++++- .../api/models/ParsedWebhookEventTest.kt | 30 ++++++++++++ .../com/lithic/api/models/StatementTest.kt | 46 +++++++++++++++++++ .../StatementsCreatedWebhookEventTest.kt | 46 +++++++++++++++++++ .../com/lithic/api/models/StatementsTest.kt | 45 ++++++++++++++++++ 7 files changed, 257 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index d11f292a..0f37c1b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-27d13d3d5226c710b07f9fc954fa53a8e6923e74d90d3f587d96399c1baf4de3.yml -openapi_spec_hash: 99a60cbd91f32b25617a9536fadebf07 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bf54d7063b11e1b1656e00d02438f34f87938a9fdbdd5b980fce3cfae3dabffa.yml +openapi_spec_hash: c6efbc9d3105fa48f76ebb095b887e08 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt index c4cc252d..b919da1e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt @@ -45,6 +45,7 @@ private constructor( private val nextPaymentDueDate: JsonField, private val nextStatementEndDate: JsonField, private val payoffDetails: JsonField, + private val statementTotals: JsonField, private val additionalProperties: MutableMap, ) { @@ -114,6 +115,9 @@ private constructor( @JsonProperty("payoff_details") @ExcludeMissing payoffDetails: JsonField = JsonMissing.of(), + @JsonProperty("statement_totals") + @ExcludeMissing + statementTotals: JsonField = JsonMissing.of(), ) : this( token, accountStanding, @@ -137,6 +141,7 @@ private constructor( nextPaymentDueDate, nextStatementEndDate, payoffDetails, + statementTotals, mutableMapOf(), ) @@ -309,6 +314,13 @@ private constructor( */ fun payoffDetails(): Optional = payoffDetails.getOptional("payoff_details") + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun statementTotals(): Optional = + statementTotals.getOptional("statement_totals") + /** * Returns the raw JSON value of [token]. * @@ -504,6 +516,15 @@ private constructor( @ExcludeMissing fun _payoffDetails(): JsonField = payoffDetails + /** + * Returns the raw JSON value of [statementTotals]. + * + * Unlike [statementTotals], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("statement_totals") + @ExcludeMissing + fun _statementTotals(): JsonField = statementTotals + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -571,6 +592,7 @@ private constructor( private var nextPaymentDueDate: JsonField = JsonMissing.of() private var nextStatementEndDate: JsonField = JsonMissing.of() private var payoffDetails: JsonField = JsonMissing.of() + private var statementTotals: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -597,6 +619,7 @@ private constructor( nextPaymentDueDate = statement.nextPaymentDueDate nextStatementEndDate = statement.nextStatementEndDate payoffDetails = statement.payoffDetails + statementTotals = statement.statementTotals additionalProperties = statement.additionalProperties.toMutableMap() } @@ -915,6 +938,20 @@ private constructor( this.payoffDetails = payoffDetails } + fun statementTotals(statementTotals: StatementTotals) = + statementTotals(JsonField.of(statementTotals)) + + /** + * Sets [Builder.statementTotals] to an arbitrary JSON value. + * + * You should usually call [Builder.statementTotals] with a well-typed [StatementTotals] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun statementTotals(statementTotals: JsonField) = apply { + this.statementTotals = statementTotals + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -987,6 +1024,7 @@ private constructor( nextPaymentDueDate, nextStatementEndDate, payoffDetails, + statementTotals, additionalProperties.toMutableMap(), ) } @@ -1020,6 +1058,7 @@ private constructor( nextPaymentDueDate() nextStatementEndDate() payoffDetails().ifPresent { it.validate() } + statementTotals().ifPresent { it.validate() } validated = true } @@ -1059,7 +1098,8 @@ private constructor( (interestDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (nextPaymentDueDate.asKnown().isPresent) 1 else 0) + (if (nextStatementEndDate.asKnown().isPresent) 1 else 0) + - (payoffDetails.asKnown().getOrNull()?.validity() ?: 0) + (payoffDetails.asKnown().getOrNull()?.validity() ?: 0) + + (statementTotals.asKnown().getOrNull()?.validity() ?: 0) class AccountStanding @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3643,6 +3683,7 @@ private constructor( nextPaymentDueDate == other.nextPaymentDueDate && nextStatementEndDate == other.nextStatementEndDate && payoffDetails == other.payoffDetails && + statementTotals == other.statementTotals && additionalProperties == other.additionalProperties } @@ -3670,6 +3711,7 @@ private constructor( nextPaymentDueDate, nextStatementEndDate, payoffDetails, + statementTotals, additionalProperties, ) } @@ -3677,5 +3719,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Statement{token=$token, accountStanding=$accountStanding, amountDue=$amountDue, availableCredit=$availableCredit, created=$created, creditLimit=$creditLimit, creditProductToken=$creditProductToken, daysInBillingCycle=$daysInBillingCycle, endingBalance=$endingBalance, financialAccountToken=$financialAccountToken, paymentDueDate=$paymentDueDate, periodTotals=$periodTotals, startingBalance=$startingBalance, statementEndDate=$statementEndDate, statementStartDate=$statementStartDate, statementType=$statementType, updated=$updated, ytdTotals=$ytdTotals, interestDetails=$interestDetails, nextPaymentDueDate=$nextPaymentDueDate, nextStatementEndDate=$nextStatementEndDate, payoffDetails=$payoffDetails, additionalProperties=$additionalProperties}" + "Statement{token=$token, accountStanding=$accountStanding, amountDue=$amountDue, availableCredit=$availableCredit, created=$created, creditLimit=$creditLimit, creditProductToken=$creditProductToken, daysInBillingCycle=$daysInBillingCycle, endingBalance=$endingBalance, financialAccountToken=$financialAccountToken, paymentDueDate=$paymentDueDate, periodTotals=$periodTotals, startingBalance=$startingBalance, statementEndDate=$statementEndDate, statementStartDate=$statementStartDate, statementType=$statementType, updated=$updated, ytdTotals=$ytdTotals, interestDetails=$interestDetails, nextPaymentDueDate=$nextPaymentDueDate, nextStatementEndDate=$nextStatementEndDate, payoffDetails=$payoffDetails, statementTotals=$statementTotals, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt index 521d74b8..6509608b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt @@ -45,6 +45,7 @@ private constructor( private val nextPaymentDueDate: JsonField, private val nextStatementEndDate: JsonField, private val payoffDetails: JsonField, + private val statementTotals: JsonField, private val eventType: JsonField, private val additionalProperties: MutableMap, ) { @@ -115,6 +116,9 @@ private constructor( @JsonProperty("payoff_details") @ExcludeMissing payoffDetails: JsonField = JsonMissing.of(), + @JsonProperty("statement_totals") + @ExcludeMissing + statementTotals: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing eventType: JsonField = JsonMissing.of(), @@ -141,6 +145,7 @@ private constructor( nextPaymentDueDate, nextStatementEndDate, payoffDetails, + statementTotals, eventType, mutableMapOf(), ) @@ -169,6 +174,7 @@ private constructor( .nextPaymentDueDate(nextPaymentDueDate) .nextStatementEndDate(nextStatementEndDate) .payoffDetails(payoffDetails) + .statementTotals(statementTotals) .build() /** @@ -342,6 +348,13 @@ private constructor( fun payoffDetails(): Optional = payoffDetails.getOptional("payoff_details") + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun statementTotals(): Optional = + statementTotals.getOptional("statement_totals") + /** * The type of event that occurred. * @@ -547,6 +560,15 @@ private constructor( @ExcludeMissing fun _payoffDetails(): JsonField = payoffDetails + /** + * Returns the raw JSON value of [statementTotals]. + * + * Unlike [statementTotals], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("statement_totals") + @ExcludeMissing + fun _statementTotals(): JsonField = statementTotals + /** * Returns the raw JSON value of [eventType]. * @@ -623,6 +645,7 @@ private constructor( private var nextPaymentDueDate: JsonField = JsonMissing.of() private var nextStatementEndDate: JsonField = JsonMissing.of() private var payoffDetails: JsonField = JsonMissing.of() + private var statementTotals: JsonField = JsonMissing.of() private var eventType: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -650,6 +673,7 @@ private constructor( nextPaymentDueDate = statementsCreatedWebhookEvent.nextPaymentDueDate nextStatementEndDate = statementsCreatedWebhookEvent.nextStatementEndDate payoffDetails = statementsCreatedWebhookEvent.payoffDetails + statementTotals = statementsCreatedWebhookEvent.statementTotals eventType = statementsCreatedWebhookEvent.eventType additionalProperties = statementsCreatedWebhookEvent.additionalProperties.toMutableMap() } @@ -972,6 +996,20 @@ private constructor( this.payoffDetails = payoffDetails } + fun statementTotals(statementTotals: StatementTotals) = + statementTotals(JsonField.of(statementTotals)) + + /** + * Sets [Builder.statementTotals] to an arbitrary JSON value. + * + * You should usually call [Builder.statementTotals] with a well-typed [StatementTotals] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun statementTotals(statementTotals: JsonField) = apply { + this.statementTotals = statementTotals + } + /** The type of event that occurred. */ fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) @@ -1057,6 +1095,7 @@ private constructor( nextPaymentDueDate, nextStatementEndDate, payoffDetails, + statementTotals, checkRequired("eventType", eventType), additionalProperties.toMutableMap(), ) @@ -1091,6 +1130,7 @@ private constructor( nextPaymentDueDate() nextStatementEndDate() payoffDetails().ifPresent { it.validate() } + statementTotals().ifPresent { it.validate() } eventType().validate() validated = true } @@ -1132,6 +1172,7 @@ private constructor( (if (nextPaymentDueDate.asKnown().isPresent) 1 else 0) + (if (nextStatementEndDate.asKnown().isPresent) 1 else 0) + (payoffDetails.asKnown().getOrNull()?.validity() ?: 0) + + (statementTotals.asKnown().getOrNull()?.validity() ?: 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) /** The type of event that occurred. */ @@ -1284,6 +1325,7 @@ private constructor( nextPaymentDueDate == other.nextPaymentDueDate && nextStatementEndDate == other.nextStatementEndDate && payoffDetails == other.payoffDetails && + statementTotals == other.statementTotals && eventType == other.eventType && additionalProperties == other.additionalProperties } @@ -1312,6 +1354,7 @@ private constructor( nextPaymentDueDate, nextStatementEndDate, payoffDetails, + statementTotals, eventType, additionalProperties, ) @@ -1320,5 +1363,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "StatementsCreatedWebhookEvent{token=$token, accountStanding=$accountStanding, amountDue=$amountDue, availableCredit=$availableCredit, created=$created, creditLimit=$creditLimit, creditProductToken=$creditProductToken, daysInBillingCycle=$daysInBillingCycle, endingBalance=$endingBalance, financialAccountToken=$financialAccountToken, paymentDueDate=$paymentDueDate, periodTotals=$periodTotals, startingBalance=$startingBalance, statementEndDate=$statementEndDate, statementStartDate=$statementStartDate, statementType=$statementType, updated=$updated, ytdTotals=$ytdTotals, interestDetails=$interestDetails, nextPaymentDueDate=$nextPaymentDueDate, nextStatementEndDate=$nextStatementEndDate, payoffDetails=$payoffDetails, eventType=$eventType, additionalProperties=$additionalProperties}" + "StatementsCreatedWebhookEvent{token=$token, accountStanding=$accountStanding, amountDue=$amountDue, availableCredit=$availableCredit, created=$created, creditLimit=$creditLimit, creditProductToken=$creditProductToken, daysInBillingCycle=$daysInBillingCycle, endingBalance=$endingBalance, financialAccountToken=$financialAccountToken, paymentDueDate=$paymentDueDate, periodTotals=$periodTotals, startingBalance=$startingBalance, statementEndDate=$statementEndDate, statementStartDate=$statementStartDate, statementType=$statementType, updated=$updated, ytdTotals=$ytdTotals, interestDetails=$interestDetails, nextPaymentDueDate=$nextPaymentDueDate, nextStatementEndDate=$nextStatementEndDate, payoffDetails=$payoffDetails, statementTotals=$statementTotals, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index 7c12415c..14272219 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt @@ -8255,6 +8255,21 @@ internal class ParsedWebhookEventTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .eventType(StatementsCreatedWebhookEvent.EventType.STATEMENTS_CREATED) .build() @@ -8439,6 +8454,21 @@ internal class ParsedWebhookEventTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .eventType(StatementsCreatedWebhookEvent.EventType.STATEMENTS_CREATED) .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt index 550c9a4f..af21a7a7 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt @@ -128,6 +128,21 @@ internal class StatementTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .build() assertThat(statement.token()).isEqualTo("token") @@ -249,6 +264,22 @@ internal class StatementTest { .payoffPeriodPaymentTotal(0L) .build() ) + assertThat(statement.statementTotals()) + .contains( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) } @Test @@ -368,6 +399,21 @@ internal class StatementTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .build() val roundtrippedStatement = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt index 31c7e03b..c495d843 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt @@ -128,6 +128,21 @@ internal class StatementsCreatedWebhookEventTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .eventType(StatementsCreatedWebhookEvent.EventType.STATEMENTS_CREATED) .build() @@ -259,6 +274,22 @@ internal class StatementsCreatedWebhookEventTest { .payoffPeriodPaymentTotal(0L) .build() ) + assertThat(statementsCreatedWebhookEvent.statementTotals()) + .contains( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) assertThat(statementsCreatedWebhookEvent.eventType()) .isEqualTo(StatementsCreatedWebhookEvent.EventType.STATEMENTS_CREATED) } @@ -380,6 +411,21 @@ internal class StatementsCreatedWebhookEventTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .eventType(StatementsCreatedWebhookEvent.EventType.STATEMENTS_CREATED) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsTest.kt index 9acf115b..5917526a 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsTest.kt @@ -130,6 +130,21 @@ internal class StatementsTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .build() ) .hasMore(true) @@ -250,6 +265,21 @@ internal class StatementsTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .build() ) assertThat(statements.hasMore()).isEqualTo(true) @@ -374,6 +404,21 @@ internal class StatementsTest { .payoffPeriodPaymentTotal(0L) .build() ) + .statementTotals( + StatementTotals.builder() + .balanceTransfers(0L) + .cashAdvances(0L) + .credits(0L) + .debits(0L) + .fees(0L) + .interest(0L) + .payments(0L) + .purchases(0L) + .creditDetails(JsonValue.from(mapOf())) + .debitDetails(JsonValue.from(mapOf())) + .paymentDetails(JsonValue.from(mapOf())) + .build() + ) .build() ) .hasMore(true) From f655477b2d6a9bd20d869599f21dd2910ed3f809 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 13:07:25 +0000 Subject: [PATCH 07/14] fix(types): make creditProductToken optional in Statement --- .stats.yml | 4 ++-- .../kotlin/com/lithic/api/models/Statement.kt | 17 ++++++++++++----- .../api/models/StatementsCreatedWebhookEvent.kt | 17 ++++++++++++----- .../com/lithic/api/models/StatementTest.kt | 2 +- .../models/StatementsCreatedWebhookEventTest.kt | 2 +- 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0f37c1b0..b4d51b4c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bf54d7063b11e1b1656e00d02438f34f87938a9fdbdd5b980fce3cfae3dabffa.yml -openapi_spec_hash: c6efbc9d3105fa48f76ebb095b887e08 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-0b90022fb88c44037dcbff183d3016a85fe7267c5b461f65a54262f734629a2b.yml +openapi_spec_hash: 7b35e7c203748b3424b5931acd6dacf8 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt index b919da1e..0ff48a04 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt @@ -192,10 +192,11 @@ private constructor( /** * Globally unique identifier for a credit product * - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token") + fun creditProductToken(): Optional = + creditProductToken.getOptional("credit_product_token") /** * Number of days in the billing cycle @@ -698,8 +699,14 @@ private constructor( fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } /** Globally unique identifier for a credit product */ - fun creditProductToken(creditProductToken: String) = - creditProductToken(JsonField.of(creditProductToken)) + fun creditProductToken(creditProductToken: String?) = + creditProductToken(JsonField.ofNullable(creditProductToken)) + + /** + * Alias for calling [Builder.creditProductToken] with `creditProductToken.orElse(null)`. + */ + fun creditProductToken(creditProductToken: Optional) = + creditProductToken(creditProductToken.getOrNull()) /** * Sets [Builder.creditProductToken] to an arbitrary JSON value. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt index 6509608b..b2c79f01 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementsCreatedWebhookEvent.kt @@ -225,10 +225,11 @@ private constructor( /** * Globally unique identifier for a credit product * - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token") + fun creditProductToken(): Optional = + creditProductToken.getOptional("credit_product_token") /** * Number of days in the billing cycle @@ -755,8 +756,14 @@ private constructor( fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } /** Globally unique identifier for a credit product */ - fun creditProductToken(creditProductToken: String) = - creditProductToken(JsonField.of(creditProductToken)) + fun creditProductToken(creditProductToken: String?) = + creditProductToken(JsonField.ofNullable(creditProductToken)) + + /** + * Alias for calling [Builder.creditProductToken] with `creditProductToken.orElse(null)`. + */ + fun creditProductToken(creditProductToken: Optional) = + creditProductToken(creditProductToken.getOrNull()) /** * Sets [Builder.creditProductToken] to an arbitrary JSON value. diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt index af21a7a7..92c6f62f 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementTest.kt @@ -177,7 +177,7 @@ internal class StatementTest { assertThat(statement.availableCredit()).isEqualTo(0L) assertThat(statement.created()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(statement.creditLimit()).isEqualTo(0L) - assertThat(statement.creditProductToken()).isEqualTo("credit_product_token") + assertThat(statement.creditProductToken()).contains("credit_product_token") assertThat(statement.daysInBillingCycle()).isEqualTo(0L) assertThat(statement.endingBalance()).isEqualTo(0L) assertThat(statement.financialAccountToken()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt index c495d843..9ecf7005 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/StatementsCreatedWebhookEventTest.kt @@ -180,7 +180,7 @@ internal class StatementsCreatedWebhookEventTest { .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(statementsCreatedWebhookEvent.creditLimit()).isEqualTo(0L) assertThat(statementsCreatedWebhookEvent.creditProductToken()) - .isEqualTo("credit_product_token") + .contains("credit_product_token") assertThat(statementsCreatedWebhookEvent.daysInBillingCycle()).isEqualTo(0L) assertThat(statementsCreatedWebhookEvent.endingBalance()).isEqualTo(0L) assertThat(statementsCreatedWebhookEvent.financialAccountToken()) From 67cbf7d5138afeae5b76339972c28fa63fbc3e30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:43:50 +0000 Subject: [PATCH 08/14] fix(types): remove hostname, make fields required in AsaRequestCard --- .stats.yml | 4 +- ...uthorizationApprovalRequestWebhookEvent.kt | 166 ++++++++---------- ...rizationApprovalRequestWebhookEventTest.kt | 9 +- .../api/models/ParsedWebhookEventTest.kt | 6 +- 4 files changed, 77 insertions(+), 108 deletions(-) diff --git a/.stats.yml b/.stats.yml index b4d51b4c..236957bc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-0b90022fb88c44037dcbff183d3016a85fe7267c5b461f65a54262f734629a2b.yml -openapi_spec_hash: 7b35e7c203748b3424b5931acd6dacf8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-0340e93de3d3691236aa19c800980112e05dc61fa13f8d8d7ca72e335720a31b.yml +openapi_spec_hash: a271f7753dd6e560fcee7dd8b9e17927 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt index c611238c..a90b2f51 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt @@ -2673,7 +2673,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val token: JsonField, - private val hostname: JsonField, private val lastFour: JsonField, private val memo: JsonField, private val spendLimit: JsonField, @@ -2686,9 +2685,6 @@ private constructor( @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(), - @JsonProperty("hostname") - @ExcludeMissing - hostname: JsonField = JsonMissing.of(), @JsonProperty("last_four") @ExcludeMissing lastFour: JsonField = JsonMissing.of(), @@ -2701,50 +2697,31 @@ private constructor( spendLimitDuration: JsonField = JsonMissing.of(), @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), - ) : this( - token, - hostname, - lastFour, - memo, - spendLimit, - spendLimitDuration, - state, - type, - mutableMapOf(), - ) + ) : this(token, lastFour, memo, spendLimit, spendLimitDuration, state, type, mutableMapOf()) /** * Globally unique identifier for the card. * - * @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") - - /** - * Hostname of card’s locked merchant (will be empty if not applicable) - * - * @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 hostname(): Optional = hostname.getOptional("hostname") + fun token(): String = token.getRequired("token") /** * Last four digits of the card number * - * @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 lastFour(): Optional = lastFour.getOptional("last_four") + fun lastFour(): String = lastFour.getRequired("last_four") /** - * Customizable name to identify the card. We recommend against using this field to store - * JSON data as it can cause unexpected behavior. + * Customizable name to identify the card * - * @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 memo(): Optional = memo.getOptional("memo") + fun memo(): String = memo.getRequired("memo") /** * Amount (in cents) to limit approved authorizations. Purchase requests above the spend @@ -2755,33 +2732,33 @@ private constructor( * Spend limits also cannot block force posted charges (i.e., when a merchant sends a * clearing message without a prior authorization). * - * @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 spendLimit(): Optional = spendLimit.getOptional("spend_limit") + fun spendLimit(): Long = spendLimit.getRequired("spend_limit") /** * Note that to support recurring monthly payments, which can occur on different day every * month, the time window we consider for MONTHLY velocity starts 6 days after the current * calendar date one month prior. * - * @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 spendLimitDuration(): Optional = - spendLimitDuration.getOptional("spend_limit_duration") + fun spendLimitDuration(): SpendLimitDuration = + spendLimitDuration.getRequired("spend_limit_duration") /** - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun state(): Optional = state.getOptional("state") + fun state(): State = state.getRequired("state") /** - * @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 type(): Optional = type.getOptional("type") + fun type(): CardType = type.getRequired("type") /** * Returns the raw JSON value of [token]. @@ -2790,13 +2767,6 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token - /** - * Returns the raw JSON value of [hostname]. - * - * Unlike [hostname], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("hostname") @ExcludeMissing fun _hostname(): JsonField = hostname - /** * Returns the raw JSON value of [lastFour]. * @@ -2856,27 +2826,38 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [AsaRequestCard]. */ + /** + * Returns a mutable builder for constructing an instance of [AsaRequestCard]. + * + * The following fields are required: + * ```java + * .token() + * .lastFour() + * .memo() + * .spendLimit() + * .spendLimitDuration() + * .state() + * .type() + * ``` + */ @JvmStatic fun builder() = Builder() } /** A builder for [AsaRequestCard]. */ class Builder internal constructor() { - private var token: JsonField = JsonMissing.of() - private var hostname: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var memo: JsonField = JsonMissing.of() - private var spendLimit: JsonField = JsonMissing.of() - private var spendLimitDuration: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var token: JsonField? = null + private var lastFour: JsonField? = null + private var memo: JsonField? = null + private var spendLimit: JsonField? = null + private var spendLimitDuration: JsonField? = null + private var state: JsonField? = null + private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(asaRequestCard: AsaRequestCard) = apply { token = asaRequestCard.token - hostname = asaRequestCard.hostname lastFour = asaRequestCard.lastFour memo = asaRequestCard.memo spendLimit = asaRequestCard.spendLimit @@ -2898,18 +2879,6 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } - /** Hostname of card’s locked merchant (will be empty if not applicable) */ - fun hostname(hostname: String) = hostname(JsonField.of(hostname)) - - /** - * Sets [Builder.hostname] to an arbitrary JSON value. - * - * You should usually call [Builder.hostname] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun hostname(hostname: JsonField) = apply { this.hostname = hostname } - /** Last four digits of the card number */ fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) @@ -2922,10 +2891,7 @@ private constructor( */ fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } - /** - * Customizable name to identify the card. We recommend against using this field to - * store JSON data as it can cause unexpected behavior. - */ + /** Customizable name to identify the card */ fun memo(memo: String) = memo(JsonField.of(memo)) /** @@ -3021,17 +2987,29 @@ private constructor( * Returns an immutable instance of [AsaRequestCard]. * * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .token() + * .lastFour() + * .memo() + * .spendLimit() + * .spendLimitDuration() + * .state() + * .type() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ fun build(): AsaRequestCard = AsaRequestCard( - token, - hostname, - lastFour, - memo, - spendLimit, - spendLimitDuration, - state, - type, + checkRequired("token", token), + checkRequired("lastFour", lastFour), + checkRequired("memo", memo), + checkRequired("spendLimit", spendLimit), + checkRequired("spendLimitDuration", spendLimitDuration), + checkRequired("state", state), + checkRequired("type", type), additionalProperties.toMutableMap(), ) } @@ -3044,13 +3022,12 @@ private constructor( } token() - hostname() lastFour() memo() spendLimit() - spendLimitDuration().ifPresent { it.validate() } - state().ifPresent { it.validate() } - type().ifPresent { it.validate() } + spendLimitDuration().validate() + state().validate() + type().validate() validated = true } @@ -3071,7 +3048,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (token.asKnown().isPresent) 1 else 0) + - (if (hostname.asKnown().isPresent) 1 else 0) + (if (lastFour.asKnown().isPresent) 1 else 0) + (if (memo.asKnown().isPresent) 1 else 0) + (if (spendLimit.asKnown().isPresent) 1 else 0) + @@ -3538,7 +3514,6 @@ private constructor( return other is AsaRequestCard && token == other.token && - hostname == other.hostname && lastFour == other.lastFour && memo == other.memo && spendLimit == other.spendLimit && @@ -3551,7 +3526,6 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( token, - hostname, lastFour, memo, spendLimit, @@ -3565,7 +3539,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AsaRequestCard{token=$token, hostname=$hostname, lastFour=$lastFour, memo=$memo, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, type=$type, additionalProperties=$additionalProperties}" + "AsaRequestCard{token=$token, lastFour=$lastFour, memo=$memo, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, type=$type, additionalProperties=$additionalProperties}" } class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt index 77945d77..e15a9abd 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt @@ -61,7 +61,6 @@ internal class CardAuthorizationApprovalRequestWebhookEventTest { .card( CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) @@ -237,7 +236,7 @@ internal class CardAuthorizationApprovalRequestWebhookEventTest { .Type .ADMINISTRATIVE ) - .acceptorTerminalId(" r 0K9tW") + .acceptorTerminalId("5([<,yN%") .build() ) .build() @@ -296,7 +295,6 @@ internal class CardAuthorizationApprovalRequestWebhookEventTest { .isEqualTo( CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) @@ -480,7 +478,7 @@ internal class CardAuthorizationApprovalRequestWebhookEventTest { CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal.Type .ADMINISTRATIVE ) - .acceptorTerminalId(" r 0K9tW") + .acceptorTerminalId("5([<,yN%") .build() ) .build() @@ -543,7 +541,6 @@ internal class CardAuthorizationApprovalRequestWebhookEventTest { .card( CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) @@ -719,7 +716,7 @@ internal class CardAuthorizationApprovalRequestWebhookEventTest { .Type .ADMINISTRATIVE ) - .acceptorTerminalId(" r 0K9tW") + .acceptorTerminalId("5([<,yN%") .build() ) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index 14272219..0f5528d5 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt @@ -918,7 +918,6 @@ internal class ParsedWebhookEventTest { .card( CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) @@ -1094,7 +1093,7 @@ internal class ParsedWebhookEventTest { .Type .ADMINISTRATIVE ) - .acceptorTerminalId(" r 0K9tW") + .acceptorTerminalId("5([<,yN%") .build() ) .build() @@ -1224,7 +1223,6 @@ internal class ParsedWebhookEventTest { .card( CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) @@ -1412,7 +1410,7 @@ internal class ParsedWebhookEventTest { .Type .ADMINISTRATIVE ) - .acceptorTerminalId(" r 0K9tW") + .acceptorTerminalId("5([<,yN%") .build() ) .build() From a06a49406fc967ebb0047ea96a2e6b2f5405d101 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:06:18 +0000 Subject: [PATCH 09/14] feat(api): add INTERCHANGE, CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT to financial account types --- .stats.yml | 4 ++-- .../com/lithic/api/models/FinancialAccount.kt | 18 ++++++++++++++++++ .../api/models/InstanceFinancialAccountType.kt | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 236957bc..b8ebefe6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-0340e93de3d3691236aa19c800980112e05dc61fa13f8d8d7ca72e335720a31b.yml -openapi_spec_hash: a271f7753dd6e560fcee7dd8b9e17927 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-968332d811097ed493d8cc12d89a29b66f993fe106f5f786998a9e04358584d1.yml +openapi_spec_hash: a68060c43dc156d25ef4d68dfe73e55d config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt index cc76be9c..52bec7f1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt @@ -1573,6 +1573,12 @@ private constructor( @JvmField val EARLY_DIRECT_DEPOSIT_FLOAT = of("EARLY_DIRECT_DEPOSIT_FLOAT") + @JvmField val INTERCHANGE = of("INTERCHANGE") + + @JvmField val CHARGEBACK = of("CHARGEBACK") + + @JvmField val PROVISIONAL_CREDIT_ACCOUNT = of("PROVISIONAL_CREDIT_ACCOUNT") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1589,6 +1595,9 @@ private constructor( COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, + INTERCHANGE, + CHARGEBACK, + PROVISIONAL_CREDIT_ACCOUNT, } /** @@ -1612,6 +1621,9 @@ private constructor( COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, + INTERCHANGE, + CHARGEBACK, + PROVISIONAL_CREDIT_ACCOUNT, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1636,6 +1648,9 @@ private constructor( COLLECTION -> Value.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Value.EARLY_DIRECT_DEPOSIT_FLOAT + INTERCHANGE -> Value.INTERCHANGE + CHARGEBACK -> Value.CHARGEBACK + PROVISIONAL_CREDIT_ACCOUNT -> Value.PROVISIONAL_CREDIT_ACCOUNT else -> Value._UNKNOWN } @@ -1661,6 +1676,9 @@ private constructor( COLLECTION -> Known.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Known.EARLY_DIRECT_DEPOSIT_FLOAT + INTERCHANGE -> Known.INTERCHANGE + CHARGEBACK -> Known.CHARGEBACK + PROVISIONAL_CREDIT_ACCOUNT -> Known.PROVISIONAL_CREDIT_ACCOUNT else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt index 25988529..b7108d13 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt @@ -45,6 +45,12 @@ private constructor(private val value: JsonField) : Enum { @JvmField val EARLY_DIRECT_DEPOSIT_FLOAT = of("EARLY_DIRECT_DEPOSIT_FLOAT") + @JvmField val INTERCHANGE = of("INTERCHANGE") + + @JvmField val CHARGEBACK = of("CHARGEBACK") + + @JvmField val PROVISIONAL_CREDIT_ACCOUNT = of("PROVISIONAL_CREDIT_ACCOUNT") + @JvmStatic fun of(value: String) = InstanceFinancialAccountType(JsonField.of(value)) } @@ -61,6 +67,9 @@ private constructor(private val value: JsonField) : Enum { COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, + INTERCHANGE, + CHARGEBACK, + PROVISIONAL_CREDIT_ACCOUNT, } /** @@ -86,6 +95,9 @@ private constructor(private val value: JsonField) : Enum { COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, + INTERCHANGE, + CHARGEBACK, + PROVISIONAL_CREDIT_ACCOUNT, /** * An enum member indicating that [InstanceFinancialAccountType] was instantiated with an * unknown value. @@ -113,6 +125,9 @@ private constructor(private val value: JsonField) : Enum { COLLECTION -> Value.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Value.EARLY_DIRECT_DEPOSIT_FLOAT + INTERCHANGE -> Value.INTERCHANGE + CHARGEBACK -> Value.CHARGEBACK + PROVISIONAL_CREDIT_ACCOUNT -> Value.PROVISIONAL_CREDIT_ACCOUNT else -> Value._UNKNOWN } @@ -137,6 +152,9 @@ private constructor(private val value: JsonField) : Enum { COLLECTION -> Known.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Known.EARLY_DIRECT_DEPOSIT_FLOAT + INTERCHANGE -> Known.INTERCHANGE + CHARGEBACK -> Known.CHARGEBACK + PROVISIONAL_CREDIT_ACCOUNT -> Known.PROVISIONAL_CREDIT_ACCOUNT else -> throw LithicInvalidDataException("Unknown InstanceFinancialAccountType: $value") } From 21b74ec6a8478a4cbe3ea665f3f46496eba09402 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:53:10 +0000 Subject: [PATCH 10/14] fix(types): remove INTERCHANGE and CHARGEBACK from FinancialAccount and InstanceFinancialAccountType --- .stats.yml | 4 ++-- .../kotlin/com/lithic/api/models/FinancialAccount.kt | 12 ------------ .../api/models/InstanceFinancialAccountType.kt | 12 ------------ 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index b8ebefe6..382ab5a6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-968332d811097ed493d8cc12d89a29b66f993fe106f5f786998a9e04358584d1.yml -openapi_spec_hash: a68060c43dc156d25ef4d68dfe73e55d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bce16144ab1915776bd58c413ad5226451e06d1ab10b8329a0954d65020defb7.yml +openapi_spec_hash: ee2dded6efa47929d7fde4aed56e141d config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt index 52bec7f1..ae6f5a5d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt @@ -1573,10 +1573,6 @@ private constructor( @JvmField val EARLY_DIRECT_DEPOSIT_FLOAT = of("EARLY_DIRECT_DEPOSIT_FLOAT") - @JvmField val INTERCHANGE = of("INTERCHANGE") - - @JvmField val CHARGEBACK = of("CHARGEBACK") - @JvmField val PROVISIONAL_CREDIT_ACCOUNT = of("PROVISIONAL_CREDIT_ACCOUNT") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) @@ -1595,8 +1591,6 @@ private constructor( COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, - INTERCHANGE, - CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT, } @@ -1621,8 +1615,6 @@ private constructor( COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, - INTERCHANGE, - CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, @@ -1648,8 +1640,6 @@ private constructor( COLLECTION -> Value.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Value.EARLY_DIRECT_DEPOSIT_FLOAT - INTERCHANGE -> Value.INTERCHANGE - CHARGEBACK -> Value.CHARGEBACK PROVISIONAL_CREDIT_ACCOUNT -> Value.PROVISIONAL_CREDIT_ACCOUNT else -> Value._UNKNOWN } @@ -1676,8 +1666,6 @@ private constructor( COLLECTION -> Known.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Known.EARLY_DIRECT_DEPOSIT_FLOAT - INTERCHANGE -> Known.INTERCHANGE - CHARGEBACK -> Known.CHARGEBACK PROVISIONAL_CREDIT_ACCOUNT -> Known.PROVISIONAL_CREDIT_ACCOUNT else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt index b7108d13..efaaa124 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt @@ -45,10 +45,6 @@ private constructor(private val value: JsonField) : Enum { @JvmField val EARLY_DIRECT_DEPOSIT_FLOAT = of("EARLY_DIRECT_DEPOSIT_FLOAT") - @JvmField val INTERCHANGE = of("INTERCHANGE") - - @JvmField val CHARGEBACK = of("CHARGEBACK") - @JvmField val PROVISIONAL_CREDIT_ACCOUNT = of("PROVISIONAL_CREDIT_ACCOUNT") @JvmStatic fun of(value: String) = InstanceFinancialAccountType(JsonField.of(value)) @@ -67,8 +63,6 @@ private constructor(private val value: JsonField) : Enum { COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, - INTERCHANGE, - CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT, } @@ -95,8 +89,6 @@ private constructor(private val value: JsonField) : Enum { COLLECTION, PROGRAM_BANK_ACCOUNTS_PAYABLE, EARLY_DIRECT_DEPOSIT_FLOAT, - INTERCHANGE, - CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT, /** * An enum member indicating that [InstanceFinancialAccountType] was instantiated with an @@ -125,8 +117,6 @@ private constructor(private val value: JsonField) : Enum { COLLECTION -> Value.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Value.EARLY_DIRECT_DEPOSIT_FLOAT - INTERCHANGE -> Value.INTERCHANGE - CHARGEBACK -> Value.CHARGEBACK PROVISIONAL_CREDIT_ACCOUNT -> Value.PROVISIONAL_CREDIT_ACCOUNT else -> Value._UNKNOWN } @@ -152,8 +142,6 @@ private constructor(private val value: JsonField) : Enum { COLLECTION -> Known.COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE EARLY_DIRECT_DEPOSIT_FLOAT -> Known.EARLY_DIRECT_DEPOSIT_FLOAT - INTERCHANGE -> Known.INTERCHANGE - CHARGEBACK -> Known.CHARGEBACK PROVISIONAL_CREDIT_ACCOUNT -> Known.PROVISIONAL_CREDIT_ACCOUNT else -> throw LithicInvalidDataException("Unknown InstanceFinancialAccountType: $value") } From 5bf85e90787b46c68077f7107165580991bbec97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 10:17:35 +0000 Subject: [PATCH 11/14] feat(api): add transaction_token to authorization/authentication3ds/tokenization/ach results --- .stats.yml | 4 +- .../api/models/V2ListResultsResponse.kt | 228 +++++++++++++++++- .../AuthRuleV2ListResultsPageResponseTest.kt | 3 + .../api/models/V2ListResultsResponseTest.kt | 8 + 4 files changed, 233 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 382ab5a6..63e9c8c6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bce16144ab1915776bd58c413ad5226451e06d1ab10b8329a0954d65020defb7.yml -openapi_spec_hash: ee2dded6efa47929d7fde4aed56e141d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fde7dad9bd08702d5db270fdd3cb533bc927387c4ea5aa19b11c67dd3ea643d4.yml +openapi_spec_hash: bf4c200978915ccdf7f4a5734e796a07 config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt index e4db2a28..219b0ba9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt @@ -292,6 +292,7 @@ private constructor( private val eventToken: JsonField, private val mode: JsonField, private val ruleVersion: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -317,6 +318,9 @@ private constructor( @JsonProperty("rule_version") @ExcludeMissing ruleVersion: JsonField = JsonMissing.of(), + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), ) : this( token, actions, @@ -326,6 +330,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, mutableMapOf(), ) @@ -393,6 +398,14 @@ private constructor( */ fun ruleVersion(): Long = ruleVersion.getRequired("rule_version") + /** + * The token of the transaction that triggered the rule evaluation + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionToken(): Optional = transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [token]. * @@ -461,6 +474,16 @@ private constructor( @ExcludeMissing fun _ruleVersion(): JsonField = ruleVersion + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -488,6 +511,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` */ @JvmStatic fun builder() = Builder() @@ -504,6 +528,7 @@ private constructor( private var eventToken: JsonField? = null private var mode: JsonField? = null private var ruleVersion: JsonField? = null + private var transactionToken: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -516,6 +541,7 @@ private constructor( eventToken = authorizationResult.eventToken mode = authorizationResult.mode ruleVersion = authorizationResult.ruleVersion + transactionToken = authorizationResult.transactionToken additionalProperties = authorizationResult.additionalProperties.toMutableMap() } @@ -650,6 +676,27 @@ private constructor( */ fun ruleVersion(ruleVersion: JsonField) = apply { this.ruleVersion = ruleVersion } + /** The token of the transaction that triggered the rule evaluation */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -684,6 +731,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` * * @throws IllegalStateException if any required field is unset. @@ -698,6 +746,7 @@ private constructor( checkRequired("eventToken", eventToken), checkRequired("mode", mode), checkRequired("ruleVersion", ruleVersion), + checkRequired("transactionToken", transactionToken), additionalProperties.toMutableMap(), ) } @@ -717,6 +766,7 @@ private constructor( eventToken() mode().validate() ruleVersion() + transactionToken() validated = true } @@ -743,7 +793,8 @@ private constructor( (eventStream.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + (mode.asKnown().getOrNull()?.validity() ?: 0) + - (if (ruleVersion.asKnown().isPresent) 1 else 0) + (if (ruleVersion.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) @JsonDeserialize(using = Action.Deserializer::class) @JsonSerialize(using = Action.Serializer::class) @@ -2447,6 +2498,7 @@ private constructor( eventToken == other.eventToken && mode == other.mode && ruleVersion == other.ruleVersion && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } @@ -2460,6 +2512,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, additionalProperties, ) } @@ -2467,7 +2520,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AuthorizationResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, additionalProperties=$additionalProperties}" + "AuthorizationResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } class Authentication3dsResult @@ -2481,6 +2534,7 @@ private constructor( private val eventToken: JsonField, private val mode: JsonField, private val ruleVersion: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -2506,6 +2560,9 @@ private constructor( @JsonProperty("rule_version") @ExcludeMissing ruleVersion: JsonField = JsonMissing.of(), + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), ) : this( token, actions, @@ -2515,6 +2572,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, mutableMapOf(), ) @@ -2582,6 +2640,14 @@ private constructor( */ fun ruleVersion(): Long = ruleVersion.getRequired("rule_version") + /** + * The token of the transaction that triggered the rule evaluation + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionToken(): Optional = transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [token]. * @@ -2650,6 +2716,16 @@ private constructor( @ExcludeMissing fun _ruleVersion(): JsonField = ruleVersion + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -2677,6 +2753,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` */ @JvmStatic fun builder() = Builder() @@ -2693,6 +2770,7 @@ private constructor( private var eventToken: JsonField? = null private var mode: JsonField? = null private var ruleVersion: JsonField? = null + private var transactionToken: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -2705,6 +2783,7 @@ private constructor( eventToken = authentication3dsResult.eventToken mode = authentication3dsResult.mode ruleVersion = authentication3dsResult.ruleVersion + transactionToken = authentication3dsResult.transactionToken additionalProperties = authentication3dsResult.additionalProperties.toMutableMap() } @@ -2825,6 +2904,27 @@ private constructor( */ fun ruleVersion(ruleVersion: JsonField) = apply { this.ruleVersion = ruleVersion } + /** The token of the transaction that triggered the rule evaluation */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -2859,6 +2959,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` * * @throws IllegalStateException if any required field is unset. @@ -2873,6 +2974,7 @@ private constructor( checkRequired("eventToken", eventToken), checkRequired("mode", mode), checkRequired("ruleVersion", ruleVersion), + checkRequired("transactionToken", transactionToken), additionalProperties.toMutableMap(), ) } @@ -2892,6 +2994,7 @@ private constructor( eventToken() mode().validate() ruleVersion() + transactionToken() validated = true } @@ -2918,7 +3021,8 @@ private constructor( (eventStream.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + (mode.asKnown().getOrNull()?.validity() ?: 0) + - (if (ruleVersion.asKnown().isPresent) 1 else 0) + (if (ruleVersion.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) class Action @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3539,6 +3643,7 @@ private constructor( eventToken == other.eventToken && mode == other.mode && ruleVersion == other.ruleVersion && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } @@ -3552,6 +3657,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, additionalProperties, ) } @@ -3559,7 +3665,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Authentication3dsResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, additionalProperties=$additionalProperties}" + "Authentication3dsResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } class TokenizationResult @@ -3573,6 +3679,7 @@ private constructor( private val eventToken: JsonField, private val mode: JsonField, private val ruleVersion: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -3598,6 +3705,9 @@ private constructor( @JsonProperty("rule_version") @ExcludeMissing ruleVersion: JsonField = JsonMissing.of(), + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), ) : this( token, actions, @@ -3607,6 +3717,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, mutableMapOf(), ) @@ -3674,6 +3785,14 @@ private constructor( */ fun ruleVersion(): Long = ruleVersion.getRequired("rule_version") + /** + * The token of the transaction that triggered the rule evaluation + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionToken(): Optional = transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [token]. * @@ -3742,6 +3861,16 @@ private constructor( @ExcludeMissing fun _ruleVersion(): JsonField = ruleVersion + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -3769,6 +3898,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` */ @JvmStatic fun builder() = Builder() @@ -3785,6 +3915,7 @@ private constructor( private var eventToken: JsonField? = null private var mode: JsonField? = null private var ruleVersion: JsonField? = null + private var transactionToken: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -3797,6 +3928,7 @@ private constructor( eventToken = tokenizationResult.eventToken mode = tokenizationResult.mode ruleVersion = tokenizationResult.ruleVersion + transactionToken = tokenizationResult.transactionToken additionalProperties = tokenizationResult.additionalProperties.toMutableMap() } @@ -3928,6 +4060,27 @@ private constructor( */ fun ruleVersion(ruleVersion: JsonField) = apply { this.ruleVersion = ruleVersion } + /** The token of the transaction that triggered the rule evaluation */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -3962,6 +4115,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` * * @throws IllegalStateException if any required field is unset. @@ -3976,6 +4130,7 @@ private constructor( checkRequired("eventToken", eventToken), checkRequired("mode", mode), checkRequired("ruleVersion", ruleVersion), + checkRequired("transactionToken", transactionToken), additionalProperties.toMutableMap(), ) } @@ -3995,6 +4150,7 @@ private constructor( eventToken() mode().validate() ruleVersion() + transactionToken() validated = true } @@ -4021,7 +4177,8 @@ private constructor( (eventStream.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + (mode.asKnown().getOrNull()?.validity() ?: 0) + - (if (ruleVersion.asKnown().isPresent) 1 else 0) + (if (ruleVersion.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) @JsonDeserialize(using = Action.Deserializer::class) @JsonSerialize(using = Action.Serializer::class) @@ -5660,6 +5817,7 @@ private constructor( eventToken == other.eventToken && mode == other.mode && ruleVersion == other.ruleVersion && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } @@ -5673,6 +5831,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, additionalProperties, ) } @@ -5680,7 +5839,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TokenizationResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, additionalProperties=$additionalProperties}" + "TokenizationResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } class AchResult @@ -5694,6 +5853,7 @@ private constructor( private val eventToken: JsonField, private val mode: JsonField, private val ruleVersion: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -5719,6 +5879,9 @@ private constructor( @JsonProperty("rule_version") @ExcludeMissing ruleVersion: JsonField = JsonMissing.of(), + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), ) : this( token, actions, @@ -5728,6 +5891,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, mutableMapOf(), ) @@ -5795,6 +5959,14 @@ private constructor( */ fun ruleVersion(): Long = ruleVersion.getRequired("rule_version") + /** + * The token of the transaction that triggered the rule evaluation + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionToken(): Optional = transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [token]. * @@ -5863,6 +6035,16 @@ private constructor( @ExcludeMissing fun _ruleVersion(): JsonField = ruleVersion + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -5890,6 +6072,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` */ @JvmStatic fun builder() = Builder() @@ -5906,6 +6089,7 @@ private constructor( private var eventToken: JsonField? = null private var mode: JsonField? = null private var ruleVersion: JsonField? = null + private var transactionToken: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -5918,6 +6102,7 @@ private constructor( eventToken = achResult.eventToken mode = achResult.mode ruleVersion = achResult.ruleVersion + transactionToken = achResult.transactionToken additionalProperties = achResult.additionalProperties.toMutableMap() } @@ -6046,6 +6231,27 @@ private constructor( */ fun ruleVersion(ruleVersion: JsonField) = apply { this.ruleVersion = ruleVersion } + /** The token of the transaction that triggered the rule evaluation */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -6080,6 +6286,7 @@ private constructor( * .eventToken() * .mode() * .ruleVersion() + * .transactionToken() * ``` * * @throws IllegalStateException if any required field is unset. @@ -6094,6 +6301,7 @@ private constructor( checkRequired("eventToken", eventToken), checkRequired("mode", mode), checkRequired("ruleVersion", ruleVersion), + checkRequired("transactionToken", transactionToken), additionalProperties.toMutableMap(), ) } @@ -6113,6 +6321,7 @@ private constructor( eventToken() mode().validate() ruleVersion() + transactionToken() validated = true } @@ -6139,7 +6348,8 @@ private constructor( (eventStream.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + (mode.asKnown().getOrNull()?.validity() ?: 0) + - (if (ruleVersion.asKnown().isPresent) 1 else 0) + (if (ruleVersion.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) @JsonDeserialize(using = Action.Deserializer::class) @JsonSerialize(using = Action.Serializer::class) @@ -7867,6 +8077,7 @@ private constructor( eventToken == other.eventToken && mode == other.mode && ruleVersion == other.ruleVersion && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } @@ -7880,6 +8091,7 @@ private constructor( eventToken, mode, ruleVersion, + transactionToken, additionalProperties, ) } @@ -7887,6 +8099,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AchResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, additionalProperties=$additionalProperties}" + "AchResult{token=$token, actions=$actions, authRuleToken=$authRuleToken, evaluationTime=$evaluationTime, eventStream=$eventStream, eventToken=$eventToken, mode=$mode, ruleVersion=$ruleVersion, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponseTest.kt index c0b2782c..f438b125 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListResultsPageResponseTest.kt @@ -44,6 +44,7 @@ internal class AuthRuleV2ListResultsPageResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AuthorizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .hasMore(true) @@ -81,6 +82,7 @@ internal class AuthRuleV2ListResultsPageResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AuthorizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) ) @@ -122,6 +124,7 @@ internal class AuthRuleV2ListResultsPageResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AuthorizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .hasMore(true) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResultsResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResultsResponseTest.kt index 88a7d41c..f803957d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResultsResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResultsResponseTest.kt @@ -44,6 +44,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AuthorizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val v2ListResultsResponse = V2ListResultsResponse.ofAuthorizationResult(authorizationResult) @@ -87,6 +88,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AuthorizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -123,6 +125,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.Authentication3dsResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val v2ListResultsResponse = @@ -161,6 +164,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.Authentication3dsResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -202,6 +206,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.TokenizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val v2ListResultsResponse = V2ListResultsResponse.ofTokenizationResult(tokenizationResult) @@ -243,6 +248,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.TokenizationResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -272,6 +278,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AchResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val v2ListResultsResponse = V2ListResultsResponse.ofAchResult(achResult) @@ -303,6 +310,7 @@ internal class V2ListResultsResponseTest { .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .mode(V2ListResultsResponse.AchResult.AuthRuleState.ACTIVE) .ruleVersion(0L) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) From b4209cb157f545e04f1dab41185c7d4e0aae4628 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:04:55 +0000 Subject: [PATCH 12/14] feat(api): add transaction_token field to BacktestStats/ReportStats examples --- .stats.yml | 4 +- .../com/lithic/api/models/BacktestStats.kt | 64 ++++++++++++++-- .../com/lithic/api/models/ReportStats.kt | 73 ++++++++++++++++++- .../api/models/V2RetrieveReportResponse.kt | 65 ++++++++++++++++- ...esBacktestReportCreatedWebhookEventTest.kt | 6 ++ .../lithic/api/models/BacktestResultsTest.kt | 6 ++ .../lithic/api/models/BacktestStatsTest.kt | 3 + .../api/models/ParsedWebhookEventTest.kt | 8 ++ .../com/lithic/api/models/ReportStatsTest.kt | 3 + .../models/V2RetrieveReportResponseTest.kt | 9 +++ 10 files changed, 226 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 63e9c8c6..06e8c95a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fde7dad9bd08702d5db270fdd3cb533bc927387c4ea5aa19b11c67dd3ea643d4.yml -openapi_spec_hash: bf4c200978915ccdf7f4a5734e796a07 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bc1866f92f50e1de35c16e782a13052913aeedc56723b13de396dea7c754889b.yml +openapi_spec_hash: d7110a33edc390903093258735ee0cfb config_hash: edbdfefeb0d3d927c2f9fe3402793215 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt index 53c43e84..f26fbdc6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BacktestStats.kt @@ -320,6 +320,7 @@ private constructor( private val decision: JsonField, private val eventToken: JsonField, private val timestamp: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -334,7 +335,10 @@ private constructor( @JsonProperty("timestamp") @ExcludeMissing timestamp: JsonField = JsonMissing.of(), - ) : this(decision, eventToken, timestamp, mutableMapOf()) + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), + ) : this(decision, eventToken, timestamp, transactionToken, mutableMapOf()) /** * The decision made by the rule for this event. @@ -360,6 +364,14 @@ private constructor( */ fun timestamp(): Optional = timestamp.getOptional("timestamp") + /** + * The token of the transaction associated with the event + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionToken(): Optional = transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [decision]. * @@ -385,6 +397,16 @@ private constructor( @ExcludeMissing fun _timestamp(): JsonField = timestamp + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -409,6 +431,7 @@ private constructor( private var decision: JsonField = JsonMissing.of() private var eventToken: JsonField = JsonMissing.of() private var timestamp: JsonField = JsonMissing.of() + private var transactionToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -416,6 +439,7 @@ private constructor( decision = example.decision eventToken = example.eventToken timestamp = example.timestamp + transactionToken = example.transactionToken additionalProperties = example.additionalProperties.toMutableMap() } @@ -457,6 +481,27 @@ private constructor( this.timestamp = timestamp } + /** The token of the transaction associated with the event */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -482,7 +527,13 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): Example = - Example(decision, eventToken, timestamp, additionalProperties.toMutableMap()) + Example( + decision, + eventToken, + timestamp, + transactionToken, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -495,6 +546,7 @@ private constructor( decision().ifPresent { it.validate() } eventToken() timestamp() + transactionToken() validated = true } @@ -516,7 +568,8 @@ private constructor( internal fun validity(): Int = (decision.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + - (if (timestamp.asKnown().isPresent) 1 else 0) + (if (timestamp.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) /** The decision made by the rule for this event. */ class Decision @JsonCreator private constructor(private val value: JsonField) : @@ -664,17 +717,18 @@ private constructor( decision == other.decision && eventToken == other.eventToken && timestamp == other.timestamp && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(decision, eventToken, timestamp, additionalProperties) + Objects.hash(decision, eventToken, timestamp, transactionToken, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Example{decision=$decision, eventToken=$eventToken, timestamp=$timestamp, additionalProperties=$additionalProperties}" + "Example{decision=$decision, eventToken=$eventToken, timestamp=$timestamp, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt index 9ec9d2f6..e273a935 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt @@ -468,6 +468,7 @@ private constructor( private val decision: JsonField, private val eventToken: JsonField, private val timestamp: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -488,7 +489,18 @@ private constructor( @JsonProperty("timestamp") @ExcludeMissing timestamp: JsonField = JsonMissing.of(), - ) : this(actions, approved, decision, eventToken, timestamp, mutableMapOf()) + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), + ) : this( + actions, + approved, + decision, + eventToken, + timestamp, + transactionToken, + mutableMapOf(), + ) /** * The actions taken by the rule for this event. @@ -532,6 +544,14 @@ private constructor( */ fun timestamp(): Optional = timestamp.getOptional("timestamp") + /** + * The token of the transaction associated with the event + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionToken(): Optional = transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [actions]. * @@ -577,6 +597,16 @@ private constructor( @ExcludeMissing fun _timestamp(): JsonField = timestamp + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -603,6 +633,7 @@ private constructor( private var decision: JsonField = JsonMissing.of() private var eventToken: JsonField = JsonMissing.of() private var timestamp: JsonField = JsonMissing.of() + private var transactionToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -612,6 +643,7 @@ private constructor( decision = example.decision eventToken = example.eventToken timestamp = example.timestamp + transactionToken = example.transactionToken additionalProperties = example.additionalProperties.toMutableMap() } @@ -735,6 +767,27 @@ private constructor( this.timestamp = timestamp } + /** The token of the transaction associated with the event */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -766,6 +819,7 @@ private constructor( decision, eventToken, timestamp, + transactionToken, additionalProperties.toMutableMap(), ) } @@ -782,6 +836,7 @@ private constructor( decision().ifPresent { it.validate() } eventToken() timestamp() + transactionToken() validated = true } @@ -805,7 +860,8 @@ private constructor( (if (approved.asKnown().isPresent) 1 else 0) + (decision.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + - (if (timestamp.asKnown().isPresent) 1 else 0) + (if (timestamp.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) @JsonDeserialize(using = Action.Deserializer::class) @JsonSerialize(using = Action.Serializer::class) @@ -5041,17 +5097,26 @@ private constructor( decision == other.decision && eventToken == other.eventToken && timestamp == other.timestamp && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(actions, approved, decision, eventToken, timestamp, additionalProperties) + Objects.hash( + actions, + approved, + decision, + eventToken, + timestamp, + transactionToken, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Example{actions=$actions, approved=$approved, decision=$decision, eventToken=$eventToken, timestamp=$timestamp, additionalProperties=$additionalProperties}" + "Example{actions=$actions, approved=$approved, decision=$decision, eventToken=$eventToken, timestamp=$timestamp, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt index f8afaea1..cea61a9d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt @@ -1023,6 +1023,7 @@ private constructor( private val actions: JsonField>, private val eventToken: JsonField, private val timestamp: JsonField, + private val transactionToken: JsonField, private val additionalProperties: MutableMap, ) { @@ -1037,7 +1038,10 @@ private constructor( @JsonProperty("timestamp") @ExcludeMissing timestamp: JsonField = JsonMissing.of(), - ) : this(actions, eventToken, timestamp, mutableMapOf()) + @JsonProperty("transaction_token") + @ExcludeMissing + transactionToken: JsonField = JsonMissing.of(), + ) : this(actions, eventToken, timestamp, transactionToken, mutableMapOf()) /** * The actions taken by this version for this event. @@ -1066,6 +1070,15 @@ private constructor( */ fun timestamp(): OffsetDateTime = timestamp.getRequired("timestamp") + /** + * The token of the transaction associated with the event + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun transactionToken(): Optional = + transactionToken.getOptional("transaction_token") + /** * Returns the raw JSON value of [actions]. * @@ -1096,6 +1109,16 @@ private constructor( @ExcludeMissing fun _timestamp(): JsonField = timestamp + /** + * Returns the raw JSON value of [transactionToken]. + * + * Unlike [transactionToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun _transactionToken(): JsonField = transactionToken + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1129,6 +1152,7 @@ private constructor( private var actions: JsonField>? = null private var eventToken: JsonField? = null private var timestamp: JsonField? = null + private var transactionToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1136,6 +1160,7 @@ private constructor( actions = example.actions.map { it.toMutableList() } eventToken = example.eventToken timestamp = example.timestamp + transactionToken = example.transactionToken additionalProperties = example.additionalProperties.toMutableMap() } @@ -1240,6 +1265,28 @@ private constructor( this.timestamp = timestamp } + /** The token of the transaction associated with the event */ + fun transactionToken(transactionToken: String?) = + transactionToken(JsonField.ofNullable(transactionToken)) + + /** + * Alias for calling [Builder.transactionToken] with + * `transactionToken.orElse(null)`. + */ + fun transactionToken(transactionToken: Optional) = + transactionToken(transactionToken.getOrNull()) + + /** + * Sets [Builder.transactionToken] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1281,6 +1328,7 @@ private constructor( checkRequired("actions", actions).map { it.toImmutable() }, checkRequired("eventToken", eventToken), checkRequired("timestamp", timestamp), + transactionToken, additionalProperties.toMutableMap(), ) } @@ -1295,6 +1343,7 @@ private constructor( actions().forEach { it.validate() } eventToken() timestamp() + transactionToken() validated = true } @@ -1316,7 +1365,8 @@ private constructor( internal fun validity(): Int = (actions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + - (if (timestamp.asKnown().isPresent) 1 else 0) + (if (timestamp.asKnown().isPresent) 1 else 0) + + (if (transactionToken.asKnown().isPresent) 1 else 0) @JsonDeserialize(using = Action.Deserializer::class) @JsonSerialize(using = Action.Serializer::class) @@ -5570,17 +5620,24 @@ private constructor( actions == other.actions && eventToken == other.eventToken && timestamp == other.timestamp && + transactionToken == other.transactionToken && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(actions, eventToken, timestamp, additionalProperties) + Objects.hash( + actions, + eventToken, + timestamp, + transactionToken, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Example{actions=$actions, eventToken=$eventToken, timestamp=$timestamp, additionalProperties=$additionalProperties}" + "Example{actions=$actions, eventToken=$eventToken, timestamp=$timestamp, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } /** The evaluation mode of this version during the reported period. */ diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEventTest.kt index 444bfb5c..98bd4fe3 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEventTest.kt @@ -27,6 +27,7 @@ internal class AuthRulesBacktestReportCreatedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -42,6 +43,7 @@ internal class AuthRulesBacktestReportCreatedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -76,6 +78,7 @@ internal class AuthRulesBacktestReportCreatedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -91,6 +94,7 @@ internal class AuthRulesBacktestReportCreatedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -130,6 +134,7 @@ internal class AuthRulesBacktestReportCreatedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -145,6 +150,7 @@ internal class AuthRulesBacktestReportCreatedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestResultsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestResultsTest.kt index ba09bb45..9d38d8be 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestResultsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestResultsTest.kt @@ -27,6 +27,7 @@ internal class BacktestResultsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -42,6 +43,7 @@ internal class BacktestResultsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -72,6 +74,7 @@ internal class BacktestResultsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -87,6 +90,7 @@ internal class BacktestResultsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -121,6 +125,7 @@ internal class BacktestResultsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -136,6 +141,7 @@ internal class BacktestResultsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestStatsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestStatsTest.kt index 41bcacf6..225f292c 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestStatsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestStatsTest.kt @@ -23,6 +23,7 @@ internal class BacktestStatsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -37,6 +38,7 @@ internal class BacktestStatsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) assertThat(backtestStats.version()).contains(0L) @@ -55,6 +57,7 @@ internal class BacktestStatsTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index 0f5528d5..2a12d757 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt @@ -1448,6 +1448,7 @@ internal class ParsedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -1463,6 +1464,7 @@ internal class ParsedWebhookEventTest { .decision(BacktestStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .version(0L) @@ -1568,6 +1570,9 @@ internal class ParsedWebhookEventTest { .timestamp( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .transactionToken( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) .build() ) .version(0L) @@ -1585,6 +1590,9 @@ internal class ParsedWebhookEventTest { .timestamp( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .transactionToken( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) .build() ) .version(0L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt index f3ee4f3b..fe3e66d1 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt @@ -43,6 +43,7 @@ internal class ReportStatsTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -74,6 +75,7 @@ internal class ReportStatsTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) } @@ -110,6 +112,7 @@ internal class ReportStatsTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt index f425322d..05de24e5 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt @@ -53,6 +53,7 @@ internal class V2RetrieveReportResponseTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -91,6 +92,7 @@ internal class V2RetrieveReportResponseTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -135,6 +137,7 @@ internal class V2RetrieveReportResponseTest { ) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .state( @@ -189,6 +192,7 @@ internal class V2RetrieveReportResponseTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -227,6 +231,7 @@ internal class V2RetrieveReportResponseTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -270,6 +275,7 @@ internal class V2RetrieveReportResponseTest { ) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .state( @@ -327,6 +333,7 @@ internal class V2RetrieveReportResponseTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -365,6 +372,7 @@ internal class V2RetrieveReportResponseTest { .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .build() @@ -409,6 +417,7 @@ internal class V2RetrieveReportResponseTest { ) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) .state( From 634a6e237a00f443864fd8e4b8b26344dc83160d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 07:29:18 +0000 Subject: [PATCH 13/14] chore(types): [breaking] remove deprecated fields from ReportStats and Example models --- .stats.yml | 6 +- .../com/lithic/api/models/ReportStats.kt | 667 +- .../api/models/V2RetrieveReportResponse.kt | 5368 +---------------- .../com/lithic/api/models/ReportStatsTest.kt | 26 +- .../models/V2RetrieveReportResponseTest.kt | 287 +- 5 files changed, 309 insertions(+), 6045 deletions(-) diff --git a/.stats.yml b/.stats.yml index 06e8c95a..3481820f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bc1866f92f50e1de35c16e782a13052913aeedc56723b13de396dea7c754889b.yml -openapi_spec_hash: d7110a33edc390903093258735ee0cfb -config_hash: edbdfefeb0d3d927c2f9fe3402793215 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-df28ee30a3bd4fa595befc2048216e1ee1d3845fcfcf179c1c694ba58fd5e4ed.yml +openapi_spec_hash: 79bfc19d85c7f03754684d794653e333 +config_hash: 5eca052bb23d273fa970eac3127dd919 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt index e273a935..f2dabce8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportStats.kt @@ -36,10 +36,9 @@ class ReportStats @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val actionCounts: JsonField, - private val approved: JsonField, - private val challenged: JsonField, - private val declined: JsonField, private val examples: JsonField>, + private val state: JsonField, + private val version: JsonField, private val additionalProperties: MutableMap, ) { @@ -48,63 +47,49 @@ private constructor( @JsonProperty("action_counts") @ExcludeMissing actionCounts: JsonField = JsonMissing.of(), - @JsonProperty("approved") @ExcludeMissing approved: JsonField = JsonMissing.of(), - @JsonProperty("challenged") @ExcludeMissing challenged: JsonField = JsonMissing.of(), - @JsonProperty("declined") @ExcludeMissing declined: JsonField = JsonMissing.of(), @JsonProperty("examples") @ExcludeMissing examples: JsonField> = JsonMissing.of(), - ) : this(actionCounts, approved, challenged, declined, examples, mutableMapOf()) - - /** - * A mapping of action types to the number of times that action was returned by this rule during - * the relevant period. Actions are the possible outcomes of a rule evaluation, such as DECLINE, - * CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger any action, it's counted under - * NO_ACTION key. - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun actionCounts(): Optional = actionCounts.getOptional("action_counts") + @JsonProperty("state") + @ExcludeMissing + state: JsonField = JsonMissing.of(), + @JsonProperty("version") @ExcludeMissing version: JsonField = JsonMissing.of(), + ) : this(actionCounts, examples, state, version, mutableMapOf()) /** - * The total number of historical transactions approved by this rule during the relevant period, - * or the number of transactions that would have been approved if the rule was evaluated in - * shadow mode. + * A mapping of action types to the number of times that action was returned by this version + * during the relevant period. Actions are the possible outcomes of a rule evaluation, such as + * DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger any action, it's counted + * under NO_ACTION key. * - * @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). */ - @Deprecated("deprecated") fun approved(): Optional = approved.getOptional("approved") + fun actionCounts(): ActionCounts = actionCounts.getRequired("action_counts") /** - * The total number of historical transactions challenged by this rule during the relevant - * period, or the number of transactions that would have been challenged if the rule was - * evaluated in shadow mode. Currently applicable only for 3DS Auth Rules. + * Example events and their outcomes for this version. * - * @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). */ - @Deprecated("deprecated") - fun challenged(): Optional = challenged.getOptional("challenged") + fun examples(): List = examples.getRequired("examples") /** - * The total number of historical transactions declined by this rule during the relevant period, - * or the number of transactions that would have been declined if the rule was evaluated in - * shadow mode. + * The evaluation mode of this version during the reported period. * - * @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). */ - @Deprecated("deprecated") fun declined(): Optional = declined.getOptional("declined") + fun state(): AuthRuleVersionState = state.getRequired("state") /** - * Example events and their outcomes. + * The rule version number. * - * @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 examples(): Optional> = examples.getOptional("examples") + fun version(): Long = version.getRequired("version") /** * Returns the raw JSON value of [actionCounts]. @@ -116,41 +101,25 @@ private constructor( fun _actionCounts(): JsonField = actionCounts /** - * Returns the raw JSON value of [approved]. + * Returns the raw JSON value of [examples]. * - * Unlike [approved], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [examples], this method doesn't throw if the JSON field has an unexpected type. */ - @Deprecated("deprecated") - @JsonProperty("approved") - @ExcludeMissing - fun _approved(): JsonField = approved + @JsonProperty("examples") @ExcludeMissing fun _examples(): JsonField> = examples /** - * Returns the raw JSON value of [challenged]. + * Returns the raw JSON value of [state]. * - * Unlike [challenged], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [state], this method doesn't throw if the JSON field has an unexpected type. */ - @Deprecated("deprecated") - @JsonProperty("challenged") - @ExcludeMissing - fun _challenged(): JsonField = challenged + @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state /** - * Returns the raw JSON value of [declined]. + * Returns the raw JSON value of [version]. * - * Unlike [declined], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [version], this method doesn't throw if the JSON field has an unexpected type. */ - @Deprecated("deprecated") - @JsonProperty("declined") - @ExcludeMissing - fun _declined(): JsonField = declined - - /** - * Returns the raw JSON value of [examples]. - * - * Unlike [examples], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("examples") @ExcludeMissing fun _examples(): JsonField> = examples + @JsonProperty("version") @ExcludeMissing fun _version(): JsonField = version @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -166,32 +135,40 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [ReportStats]. */ + /** + * Returns a mutable builder for constructing an instance of [ReportStats]. + * + * The following fields are required: + * ```java + * .actionCounts() + * .examples() + * .state() + * .version() + * ``` + */ @JvmStatic fun builder() = Builder() } /** A builder for [ReportStats]. */ class Builder internal constructor() { - private var actionCounts: JsonField = JsonMissing.of() - private var approved: JsonField = JsonMissing.of() - private var challenged: JsonField = JsonMissing.of() - private var declined: JsonField = JsonMissing.of() + private var actionCounts: JsonField? = null private var examples: JsonField>? = null + private var state: JsonField? = null + private var version: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(reportStats: ReportStats) = apply { actionCounts = reportStats.actionCounts - approved = reportStats.approved - challenged = reportStats.challenged - declined = reportStats.declined examples = reportStats.examples.map { it.toMutableList() } + state = reportStats.state + version = reportStats.version additionalProperties = reportStats.additionalProperties.toMutableMap() } /** - * A mapping of action types to the number of times that action was returned by this rule + * A mapping of action types to the number of times that action was returned by this version * during the relevant period. Actions are the possible outcomes of a rule evaluation, such * as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger any action, it's * counted under NO_ACTION key. @@ -209,56 +186,7 @@ private constructor( this.actionCounts = actionCounts } - /** - * The total number of historical transactions approved by this rule during the relevant - * period, or the number of transactions that would have been approved if the rule was - * evaluated in shadow mode. - */ - @Deprecated("deprecated") fun approved(approved: Long) = approved(JsonField.of(approved)) - - /** - * Sets [Builder.approved] to an arbitrary JSON value. - * - * You should usually call [Builder.approved] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - @Deprecated("deprecated") - fun approved(approved: JsonField) = apply { this.approved = approved } - - /** - * The total number of historical transactions challenged by this rule during the relevant - * period, or the number of transactions that would have been challenged if the rule was - * evaluated in shadow mode. Currently applicable only for 3DS Auth Rules. - */ - @Deprecated("deprecated") - fun challenged(challenged: Long) = challenged(JsonField.of(challenged)) - - /** - * Sets [Builder.challenged] to an arbitrary JSON value. - * - * You should usually call [Builder.challenged] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - @Deprecated("deprecated") - fun challenged(challenged: JsonField) = apply { this.challenged = challenged } - - /** - * The total number of historical transactions declined by this rule during the relevant - * period, or the number of transactions that would have been declined if the rule was - * evaluated in shadow mode. - */ - @Deprecated("deprecated") fun declined(declined: Long) = declined(JsonField.of(declined)) - - /** - * Sets [Builder.declined] to an arbitrary JSON value. - * - * You should usually call [Builder.declined] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - @Deprecated("deprecated") - fun declined(declined: JsonField) = apply { this.declined = declined } - - /** Example events and their outcomes. */ + /** Example events and their outcomes for this version. */ fun examples(examples: List) = examples(JsonField.of(examples)) /** @@ -284,6 +212,29 @@ private constructor( } } + /** The evaluation mode of this version during the reported period. */ + fun state(state: AuthRuleVersionState) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [AuthRuleVersionState] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The rule version number. */ + fun version(version: Long) = version(JsonField.of(version)) + + /** + * Sets [Builder.version] to an arbitrary JSON value. + * + * You should usually call [Builder.version] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun version(version: JsonField) = apply { this.version = version } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -307,14 +258,23 @@ private constructor( * Returns an immutable instance of [ReportStats]. * * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .actionCounts() + * .examples() + * .state() + * .version() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ fun build(): ReportStats = ReportStats( - actionCounts, - approved, - challenged, - declined, - (examples ?: JsonMissing.of()).map { it.toImmutable() }, + checkRequired("actionCounts", actionCounts), + checkRequired("examples", examples).map { it.toImmutable() }, + checkRequired("state", state), + checkRequired("version", version), additionalProperties.toMutableMap(), ) } @@ -326,11 +286,10 @@ private constructor( return@apply } - actionCounts().ifPresent { it.validate() } - approved() - challenged() - declined() - examples().ifPresent { it.forEach { it.validate() } } + actionCounts().validate() + examples().forEach { it.validate() } + state().validate() + version() validated = true } @@ -350,16 +309,15 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (actionCounts.asKnown().getOrNull()?.validity() ?: 0) + - (if (approved.asKnown().isPresent) 1 else 0) + - (if (challenged.asKnown().isPresent) 1 else 0) + - (if (declined.asKnown().isPresent) 1 else 0) + - (examples.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (examples.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (state.asKnown().getOrNull()?.validity() ?: 0) + + (if (version.asKnown().isPresent) 1 else 0) /** - * A mapping of action types to the number of times that action was returned by this rule during - * the relevant period. Actions are the possible outcomes of a rule evaluation, such as DECLINE, - * CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger any action, it's counted under - * NO_ACTION key. + * A mapping of action types to the number of times that action was returned by this version + * during the relevant period. Actions are the possible outcomes of a rule evaluation, such as + * DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger any action, it's counted + * under NO_ACTION key. */ class ActionCounts @JsonCreator @@ -464,8 +422,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val actions: JsonField>, - private val approved: JsonField, - private val decision: JsonField, private val eventToken: JsonField, private val timestamp: JsonField, private val transactionToken: JsonField, @@ -477,12 +433,6 @@ private constructor( @JsonProperty("actions") @ExcludeMissing actions: JsonField> = JsonMissing.of(), - @JsonProperty("approved") - @ExcludeMissing - approved: JsonField = JsonMissing.of(), - @JsonProperty("decision") - @ExcludeMissing - decision: JsonField = JsonMissing.of(), @JsonProperty("event_token") @ExcludeMissing eventToken: JsonField = JsonMissing.of(), @@ -492,57 +442,31 @@ private constructor( @JsonProperty("transaction_token") @ExcludeMissing transactionToken: JsonField = JsonMissing.of(), - ) : this( - actions, - approved, - decision, - eventToken, - timestamp, - transactionToken, - mutableMapOf(), - ) + ) : this(actions, eventToken, timestamp, transactionToken, mutableMapOf()) /** - * The actions taken by the rule for this event. + * The actions taken by this version for this event. * - * @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 actions(): Optional> = actions.getOptional("actions") - - /** - * Whether the rule would have approved the request. - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun approved(): Optional = approved.getOptional("approved") - - /** - * The decision made by the rule for this event. - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun decision(): Optional = decision.getOptional("decision") + fun actions(): List = actions.getRequired("actions") /** * The event token. * - * @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 eventToken(): Optional = eventToken.getOptional("event_token") + fun eventToken(): String = eventToken.getRequired("event_token") /** * The timestamp of the event. * - * @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 timestamp(): Optional = timestamp.getOptional("timestamp") + fun timestamp(): OffsetDateTime = timestamp.getRequired("timestamp") /** * The token of the transaction associated with the event @@ -559,26 +483,6 @@ private constructor( */ @JsonProperty("actions") @ExcludeMissing fun _actions(): JsonField> = actions - /** - * Returns the raw JSON value of [approved]. - * - * Unlike [approved], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("approved") - @ExcludeMissing - fun _approved(): JsonField = approved - - /** - * Returns the raw JSON value of [decision]. - * - * Unlike [decision], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("decision") - @ExcludeMissing - fun _decision(): JsonField = decision - /** * Returns the raw JSON value of [eventToken]. * @@ -621,7 +525,16 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [Example]. */ + /** + * Returns a mutable builder for constructing an instance of [Example]. + * + * The following fields are required: + * ```java + * .actions() + * .eventToken() + * .timestamp() + * ``` + */ @JvmStatic fun builder() = Builder() } @@ -629,25 +542,21 @@ private constructor( class Builder internal constructor() { private var actions: JsonField>? = null - private var approved: JsonField = JsonMissing.of() - private var decision: JsonField = JsonMissing.of() - private var eventToken: JsonField = JsonMissing.of() - private var timestamp: JsonField = JsonMissing.of() + private var eventToken: JsonField? = null + private var timestamp: JsonField? = null private var transactionToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(example: Example) = apply { actions = example.actions.map { it.toMutableList() } - approved = example.approved - decision = example.decision eventToken = example.eventToken timestamp = example.timestamp transactionToken = example.transactionToken additionalProperties = example.additionalProperties.toMutableMap() } - /** The actions taken by the rule for this event. */ + /** The actions taken by this version for this event. */ fun actions(actions: List) = actions(JsonField.of(actions)) /** @@ -713,34 +622,6 @@ private constructor( fun addAction(returnAction: Action.ReturnAction) = addAction(Action.ofReturnAction(returnAction)) - /** Whether the rule would have approved the request. */ - @Deprecated("deprecated") - fun approved(approved: Boolean) = approved(JsonField.of(approved)) - - /** - * Sets [Builder.approved] to an arbitrary JSON value. - * - * You should usually call [Builder.approved] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun approved(approved: JsonField) = apply { this.approved = approved } - - /** The decision made by the rule for this event. */ - @Deprecated("deprecated") - fun decision(decision: Decision) = decision(JsonField.of(decision)) - - /** - * Sets [Builder.decision] to an arbitrary JSON value. - * - * You should usually call [Builder.decision] with a well-typed [Decision] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun decision(decision: JsonField) = apply { this.decision = decision } - /** The event token. */ fun eventToken(eventToken: String) = eventToken(JsonField.of(eventToken)) @@ -811,14 +692,21 @@ private constructor( * Returns an immutable instance of [Example]. * * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .actions() + * .eventToken() + * .timestamp() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ fun build(): Example = Example( - (actions ?: JsonMissing.of()).map { it.toImmutable() }, - approved, - decision, - eventToken, - timestamp, + checkRequired("actions", actions).map { it.toImmutable() }, + checkRequired("eventToken", eventToken), + checkRequired("timestamp", timestamp), transactionToken, additionalProperties.toMutableMap(), ) @@ -831,9 +719,7 @@ private constructor( return@apply } - actions().ifPresent { it.forEach { it.validate() } } - approved() - decision().ifPresent { it.validate() } + actions().forEach { it.validate() } eventToken() timestamp() transactionToken() @@ -857,8 +743,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (actions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (approved.asKnown().isPresent) 1 else 0) + - (decision.asKnown().getOrNull()?.validity() ?: 0) + (if (eventToken.asKnown().isPresent) 1 else 0) + (if (timestamp.asKnown().isPresent) 1 else 0) + (if (transactionToken.asKnown().isPresent) 1 else 0) @@ -4948,175 +4832,165 @@ private constructor( } } - /** The decision made by the rule for this event. */ - @Deprecated("deprecated") - class Decision @JsonCreator private constructor(private val value: JsonField) : - Enum { + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** - * 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 + return other is Example && + actions == other.actions && + eventToken == other.eventToken && + timestamp == other.timestamp && + transactionToken == other.transactionToken && + additionalProperties == other.additionalProperties + } - companion object { + private val hashCode: Int by lazy { + Objects.hash(actions, eventToken, timestamp, transactionToken, additionalProperties) + } - @JvmField val APPROVED = of("APPROVED") + override fun hashCode(): Int = hashCode - @JvmField val DECLINED = of("DECLINED") + override fun toString() = + "Example{actions=$actions, eventToken=$eventToken, timestamp=$timestamp, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" + } - @JvmField val CHALLENGED = of("CHALLENGED") + /** The evaluation mode of this version during the reported period. */ + class AuthRuleVersionState + @JsonCreator + private constructor(private val value: JsonField) : Enum { - @JvmStatic fun of(value: String) = Decision(JsonField.of(value)) - } + /** + * 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 - /** An enum containing [Decision]'s known values. */ - enum class Known { - APPROVED, - DECLINED, - CHALLENGED, - } + companion object { - /** - * An enum containing [Decision]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Decision] 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, - CHALLENGED, - /** - * An enum member indicating that [Decision] was instantiated with an unknown value. - */ - _UNKNOWN, - } + @JvmField val ACTIVE = of("ACTIVE") - /** - * 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 - CHALLENGED -> Value.CHALLENGED - else -> Value._UNKNOWN - } + @JvmField val SHADOW = of("SHADOW") - /** - * 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 - CHALLENGED -> Known.CHALLENGED - else -> throw LithicInvalidDataException("Unknown Decision: $value") - } + @JvmField val INACTIVE = of("INACTIVE") - /** - * 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") - } + @JvmStatic fun of(value: String) = AuthRuleVersionState(JsonField.of(value)) + } - private var validated: Boolean = false + /** An enum containing [AuthRuleVersionState]'s known values. */ + enum class Known { + ACTIVE, + SHADOW, + INACTIVE, + } - fun validate(): Decision = apply { - if (validated) { - return@apply - } + /** + * An enum containing [AuthRuleVersionState]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AuthRuleVersionState] 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 { + ACTIVE, + SHADOW, + INACTIVE, + /** + * An enum member indicating that [AuthRuleVersionState] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } - known() - validated = true + /** + * 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) { + ACTIVE -> Value.ACTIVE + SHADOW -> Value.SHADOW + INACTIVE -> Value.INACTIVE + else -> Value._UNKNOWN } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } + /** + * 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) { + ACTIVE -> Known.ACTIVE + SHADOW -> Known.SHADOW + INACTIVE -> Known.INACTIVE + else -> throw LithicInvalidDataException("Unknown AuthRuleVersionState: $value") + } - /** - * 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 + /** + * 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") } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is Decision && value == other.value + fun validate(): AuthRuleVersionState = apply { + if (validated) { + return@apply } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + 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 Example && - actions == other.actions && - approved == other.approved && - decision == other.decision && - eventToken == other.eventToken && - timestamp == other.timestamp && - transactionToken == other.transactionToken && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - actions, - approved, - decision, - eventToken, - timestamp, - transactionToken, - additionalProperties, - ) + return other is AuthRuleVersionState && value == other.value } - override fun hashCode(): Int = hashCode + override fun hashCode() = value.hashCode() - override fun toString() = - "Example{actions=$actions, approved=$approved, decision=$decision, eventToken=$eventToken, timestamp=$timestamp, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -5126,19 +5000,18 @@ private constructor( return other is ReportStats && actionCounts == other.actionCounts && - approved == other.approved && - challenged == other.challenged && - declined == other.declined && examples == other.examples && + state == other.state && + version == other.version && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(actionCounts, approved, challenged, declined, examples, additionalProperties) + Objects.hash(actionCounts, examples, state, version, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ReportStats{actionCounts=$actionCounts, approved=$approved, challenged=$challenged, declined=$declined, examples=$examples, additionalProperties=$additionalProperties}" + "ReportStats{actionCounts=$actionCounts, examples=$examples, state=$state, version=$version, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt index cea61a9d..5c82063f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveReportResponse.kt @@ -6,31 +6,17 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.core.JsonGenerator -import com.fasterxml.jackson.core.ObjectCodec -import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.SerializerProvider -import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import com.fasterxml.jackson.databind.annotation.JsonSerialize -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.lithic.api.core.BaseDeserializer -import com.lithic.api.core.BaseSerializer -import com.lithic.api.core.Enum import com.lithic.api.core.ExcludeMissing import com.lithic.api.core.JsonField import com.lithic.api.core.JsonMissing import com.lithic.api.core.JsonValue -import com.lithic.api.core.allMaxBy import com.lithic.api.core.checkKnown import com.lithic.api.core.checkRequired -import com.lithic.api.core.getOrThrow import com.lithic.api.core.toImmutable import com.lithic.api.errors.LithicInvalidDataException import java.time.LocalDate -import java.time.OffsetDateTime import java.util.Collections import java.util.Objects -import java.util.Optional import kotlin.jvm.optionals.getOrNull class V2RetrieveReportResponse @@ -309,35 +295,18 @@ private constructor( class DailyStatistic @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val currentVersionStatistics: JsonField, private val date: JsonField, - private val draftVersionStatistics: JsonField, - private val versions: JsonField>, + private val versions: JsonField>, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("current_version_statistics") - @ExcludeMissing - currentVersionStatistics: JsonField = JsonMissing.of(), @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(), - @JsonProperty("draft_version_statistics") - @ExcludeMissing - draftVersionStatistics: JsonField = JsonMissing.of(), @JsonProperty("versions") @ExcludeMissing - versions: JsonField> = JsonMissing.of(), - ) : this(currentVersionStatistics, date, draftVersionStatistics, versions, mutableMapOf()) - - /** - * Detailed statistics for the current version of the rule. - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun currentVersionStatistics(): Optional = - currentVersionStatistics.getOptional("current_version_statistics") + versions: JsonField> = JsonMissing.of(), + ) : this(date, versions, mutableMapOf()) /** * The date (UTC) for which the statistics are reported. @@ -347,32 +316,13 @@ private constructor( */ fun date(): LocalDate = date.getRequired("date") - /** - * Detailed statistics for the draft version of the rule. - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun draftVersionStatistics(): Optional = - draftVersionStatistics.getOptional("draft_version_statistics") - /** * Statistics for each version of the rule that was evaluated during the reported day. * * @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 versions(): List = versions.getRequired("versions") - - /** - * Returns the raw JSON value of [currentVersionStatistics]. - * - * Unlike [currentVersionStatistics], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("current_version_statistics") - @ExcludeMissing - fun _currentVersionStatistics(): JsonField = currentVersionStatistics + fun versions(): List = versions.getRequired("versions") /** * Returns the raw JSON value of [date]. @@ -381,16 +331,6 @@ private constructor( */ @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date - /** - * Returns the raw JSON value of [draftVersionStatistics]. - * - * Unlike [draftVersionStatistics], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("draft_version_statistics") - @ExcludeMissing - fun _draftVersionStatistics(): JsonField = draftVersionStatistics - /** * Returns the raw JSON value of [versions]. * @@ -398,7 +338,7 @@ private constructor( */ @JsonProperty("versions") @ExcludeMissing - fun _versions(): JsonField> = versions + fun _versions(): JsonField> = versions @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -419,9 +359,7 @@ private constructor( * * The following fields are required: * ```java - * .currentVersionStatistics() * .date() - * .draftVersionStatistics() * .versions() * ``` */ @@ -431,43 +369,17 @@ private constructor( /** A builder for [DailyStatistic]. */ class Builder internal constructor() { - private var currentVersionStatistics: JsonField? = null private var date: JsonField? = null - private var draftVersionStatistics: JsonField? = null - private var versions: JsonField>? = null + private var versions: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(dailyStatistic: DailyStatistic) = apply { - currentVersionStatistics = dailyStatistic.currentVersionStatistics date = dailyStatistic.date - draftVersionStatistics = dailyStatistic.draftVersionStatistics versions = dailyStatistic.versions.map { it.toMutableList() } additionalProperties = dailyStatistic.additionalProperties.toMutableMap() } - /** Detailed statistics for the current version of the rule. */ - fun currentVersionStatistics(currentVersionStatistics: ReportStats?) = - currentVersionStatistics(JsonField.ofNullable(currentVersionStatistics)) - - /** - * Alias for calling [Builder.currentVersionStatistics] with - * `currentVersionStatistics.orElse(null)`. - */ - fun currentVersionStatistics(currentVersionStatistics: Optional) = - currentVersionStatistics(currentVersionStatistics.getOrNull()) - - /** - * Sets [Builder.currentVersionStatistics] to an arbitrary JSON value. - * - * You should usually call [Builder.currentVersionStatistics] with a well-typed - * [ReportStats] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun currentVersionStatistics(currentVersionStatistics: JsonField) = apply { - this.currentVersionStatistics = currentVersionStatistics - } - /** The date (UTC) for which the statistics are reported. */ fun date(date: LocalDate) = date(JsonField.of(date)) @@ -480,50 +392,28 @@ private constructor( */ fun date(date: JsonField) = apply { this.date = date } - /** Detailed statistics for the draft version of the rule. */ - fun draftVersionStatistics(draftVersionStatistics: ReportStats?) = - draftVersionStatistics(JsonField.ofNullable(draftVersionStatistics)) - - /** - * Alias for calling [Builder.draftVersionStatistics] with - * `draftVersionStatistics.orElse(null)`. - */ - fun draftVersionStatistics(draftVersionStatistics: Optional) = - draftVersionStatistics(draftVersionStatistics.getOrNull()) - - /** - * Sets [Builder.draftVersionStatistics] to an arbitrary JSON value. - * - * You should usually call [Builder.draftVersionStatistics] with a well-typed - * [ReportStats] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun draftVersionStatistics(draftVersionStatistics: JsonField) = apply { - this.draftVersionStatistics = draftVersionStatistics - } - /** * Statistics for each version of the rule that was evaluated during the reported day. */ - fun versions(versions: List) = versions(JsonField.of(versions)) + fun versions(versions: List) = versions(JsonField.of(versions)) /** * Sets [Builder.versions] to an arbitrary JSON value. * - * You should usually call [Builder.versions] with a well-typed `List` + * You should usually call [Builder.versions] with a well-typed `List` * value instead. This method is primarily for setting the field to an undocumented or * not yet supported value. */ - fun versions(versions: JsonField>) = apply { + fun versions(versions: JsonField>) = apply { this.versions = versions.map { it.toMutableList() } } /** - * Adds a single [ReportStatsV2] to [versions]. + * Adds a single [ReportStats] to [versions]. * * @throws IllegalStateException if the field was previously set to a non-list. */ - fun addVersion(version: ReportStatsV2) = apply { + fun addVersion(version: ReportStats) = apply { versions = (versions ?: JsonField.of(mutableListOf())).also { checkKnown("versions", it).add(version) @@ -556,9 +446,7 @@ private constructor( * * The following fields are required: * ```java - * .currentVersionStatistics() * .date() - * .draftVersionStatistics() * .versions() * ``` * @@ -566,9 +454,7 @@ private constructor( */ fun build(): DailyStatistic = DailyStatistic( - checkRequired("currentVersionStatistics", currentVersionStatistics), checkRequired("date", date), - checkRequired("draftVersionStatistics", draftVersionStatistics), checkRequired("versions", versions).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) @@ -581,9 +467,7 @@ private constructor( return@apply } - currentVersionStatistics().ifPresent { it.validate() } date() - draftVersionStatistics().ifPresent { it.validate() } versions().forEach { it.validate() } validated = true } @@ -604,5234 +488,26 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (currentVersionStatistics.asKnown().getOrNull()?.validity() ?: 0) + - (if (date.asKnown().isPresent) 1 else 0) + - (draftVersionStatistics.asKnown().getOrNull()?.validity() ?: 0) + + (if (date.asKnown().isPresent) 1 else 0) + (versions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) - class ReportStatsV2 - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val actionCounts: JsonField, - private val examples: JsonField>, - private val state: JsonField, - private val version: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("action_counts") - @ExcludeMissing - actionCounts: JsonField = JsonMissing.of(), - @JsonProperty("examples") - @ExcludeMissing - examples: JsonField> = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - state: JsonField = JsonMissing.of(), - @JsonProperty("version") @ExcludeMissing version: JsonField = JsonMissing.of(), - ) : this(actionCounts, examples, state, version, mutableMapOf()) - - /** - * A mapping of action types to the number of times that action was returned by this - * version during the relevant period. Actions are the possible outcomes of a rule - * evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger - * any action, it's counted under NO_ACTION key. - * - * @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 actionCounts(): ActionCounts = actionCounts.getRequired("action_counts") - - /** - * Example events and their outcomes for this version. - * - * @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 examples(): List = examples.getRequired("examples") - - /** - * The evaluation mode of this version during the reported period. - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun state(): AuthRuleVersionState = state.getRequired("state") - - /** - * The rule version number. - * - * @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 version(): Long = version.getRequired("version") - - /** - * Returns the raw JSON value of [actionCounts]. - * - * Unlike [actionCounts], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("action_counts") - @ExcludeMissing - fun _actionCounts(): JsonField = actionCounts - - /** - * Returns the raw JSON value of [examples]. - * - * Unlike [examples], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("examples") - @ExcludeMissing - fun _examples(): JsonField> = examples - - /** - * Returns the raw JSON value of [state]. - * - * Unlike [state], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("state") - @ExcludeMissing - fun _state(): JsonField = state - - /** - * Returns the raw JSON value of [version]. - * - * Unlike [version], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("version") @ExcludeMissing fun _version(): JsonField = version - - @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 [ReportStatsV2]. - * - * The following fields are required: - * ```java - * .actionCounts() - * .examples() - * .state() - * .version() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ReportStatsV2]. */ - class Builder internal constructor() { - - private var actionCounts: JsonField? = null - private var examples: JsonField>? = null - private var state: JsonField? = null - private var version: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(reportStatsV2: ReportStatsV2) = apply { - actionCounts = reportStatsV2.actionCounts - examples = reportStatsV2.examples.map { it.toMutableList() } - state = reportStatsV2.state - version = reportStatsV2.version - additionalProperties = reportStatsV2.additionalProperties.toMutableMap() - } - - /** - * A mapping of action types to the number of times that action was returned by this - * version during the relevant period. Actions are the possible outcomes of a rule - * evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule didn't - * trigger any action, it's counted under NO_ACTION key. - */ - fun actionCounts(actionCounts: ActionCounts) = - actionCounts(JsonField.of(actionCounts)) - - /** - * Sets [Builder.actionCounts] to an arbitrary JSON value. - * - * You should usually call [Builder.actionCounts] with a well-typed [ActionCounts] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun actionCounts(actionCounts: JsonField) = apply { - this.actionCounts = actionCounts - } - - /** Example events and their outcomes for this version. */ - fun examples(examples: List) = examples(JsonField.of(examples)) - - /** - * Sets [Builder.examples] to an arbitrary JSON value. - * - * You should usually call [Builder.examples] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun examples(examples: JsonField>) = apply { - this.examples = examples.map { it.toMutableList() } - } - - /** - * Adds a single [Example] to [examples]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addExample(example: Example) = apply { - examples = - (examples ?: JsonField.of(mutableListOf())).also { - checkKnown("examples", it).add(example) - } - } - - /** The evaluation mode of this version during the reported period. */ - fun state(state: AuthRuleVersionState) = state(JsonField.of(state)) - - /** - * Sets [Builder.state] to an arbitrary JSON value. - * - * You should usually call [Builder.state] with a well-typed [AuthRuleVersionState] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun state(state: JsonField) = apply { this.state = state } - - /** The rule version number. */ - fun version(version: Long) = version(JsonField.of(version)) - - /** - * Sets [Builder.version] to an arbitrary JSON value. - * - * You should usually call [Builder.version] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun version(version: JsonField) = apply { this.version = version } - - 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 [ReportStatsV2]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .actionCounts() - * .examples() - * .state() - * .version() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ReportStatsV2 = - ReportStatsV2( - checkRequired("actionCounts", actionCounts), - checkRequired("examples", examples).map { it.toImmutable() }, - checkRequired("state", state), - checkRequired("version", version), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): ReportStatsV2 = apply { - if (validated) { - return@apply - } - - actionCounts().validate() - examples().forEach { it.validate() } - state().validate() - version() - 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 = - (actionCounts.asKnown().getOrNull()?.validity() ?: 0) + - (examples.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (state.asKnown().getOrNull()?.validity() ?: 0) + - (if (version.asKnown().isPresent) 1 else 0) - - /** - * A mapping of action types to the number of times that action was returned by this - * version during the relevant period. Actions are the possible outcomes of a rule - * evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule didn't trigger - * any action, it's counted under NO_ACTION key. - */ - class ActionCounts - @JsonCreator - private constructor( - @com.fasterxml.jackson.annotation.JsonValue - private val additionalProperties: Map - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun toBuilder() = Builder().from(this) - - companion object { - - /** Returns a mutable builder for constructing an instance of [ActionCounts]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ActionCounts]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(actionCounts: ActionCounts) = apply { - additionalProperties = actionCounts.additionalProperties.toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [ActionCounts]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): ActionCounts = ActionCounts(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - fun validate(): ActionCounts = apply { - if (validated) { - return@apply - } - - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - additionalProperties.count { (_, value) -> - !value.isNull() && !value.isMissing() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ActionCounts && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = "ActionCounts{additionalProperties=$additionalProperties}" + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - class Example - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val actions: JsonField>, - private val eventToken: JsonField, - private val timestamp: JsonField, - private val transactionToken: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("actions") - @ExcludeMissing - actions: JsonField> = JsonMissing.of(), - @JsonProperty("event_token") - @ExcludeMissing - eventToken: JsonField = JsonMissing.of(), - @JsonProperty("timestamp") - @ExcludeMissing - timestamp: JsonField = JsonMissing.of(), - @JsonProperty("transaction_token") - @ExcludeMissing - transactionToken: JsonField = JsonMissing.of(), - ) : this(actions, eventToken, timestamp, transactionToken, mutableMapOf()) - - /** - * The actions taken by this version for this event. - * - * @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 actions(): List = actions.getRequired("actions") - - /** - * The event token. - * - * @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 eventToken(): String = eventToken.getRequired("event_token") - - /** - * The timestamp of the event. - * - * @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 timestamp(): OffsetDateTime = timestamp.getRequired("timestamp") - - /** - * The token of the transaction associated with the event - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun transactionToken(): Optional = - transactionToken.getOptional("transaction_token") - - /** - * Returns the raw JSON value of [actions]. - * - * Unlike [actions], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("actions") - @ExcludeMissing - fun _actions(): JsonField> = actions - - /** - * Returns the raw JSON value of [eventToken]. - * - * Unlike [eventToken], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("event_token") - @ExcludeMissing - fun _eventToken(): JsonField = eventToken - - /** - * Returns the raw JSON value of [timestamp]. - * - * Unlike [timestamp], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("timestamp") - @ExcludeMissing - fun _timestamp(): JsonField = timestamp - - /** - * Returns the raw JSON value of [transactionToken]. - * - * Unlike [transactionToken], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("transaction_token") - @ExcludeMissing - fun _transactionToken(): JsonField = transactionToken - - @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 [Example]. - * - * The following fields are required: - * ```java - * .actions() - * .eventToken() - * .timestamp() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [Example]. */ - class Builder internal constructor() { - - private var actions: JsonField>? = null - private var eventToken: JsonField? = null - private var timestamp: JsonField? = null - private var transactionToken: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(example: Example) = apply { - actions = example.actions.map { it.toMutableList() } - eventToken = example.eventToken - timestamp = example.timestamp - transactionToken = example.transactionToken - additionalProperties = example.additionalProperties.toMutableMap() - } - - /** The actions taken by this version for this event. */ - fun actions(actions: List) = actions(JsonField.of(actions)) - - /** - * Sets [Builder.actions] to an arbitrary JSON value. - * - * You should usually call [Builder.actions] with a well-typed `List` - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun actions(actions: JsonField>) = apply { - this.actions = actions.map { it.toMutableList() } - } - - /** - * Adds a single [Action] to [actions]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addAction(action: Action) = apply { - actions = - (actions ?: JsonField.of(mutableListOf())).also { - checkKnown("actions", it).add(action) - } - } - - /** - * Alias for calling [addAction] with - * `Action.ofDeclineActionAuthorization(declineActionAuthorization)`. - */ - fun addAction(declineActionAuthorization: Action.DeclineActionAuthorization) = - addAction(Action.ofDeclineActionAuthorization(declineActionAuthorization)) - - /** - * Alias for calling [addAction] with - * `Action.ofChallengeActionAuthorization(challengeActionAuthorization)`. - */ - fun addAction( - challengeActionAuthorization: Action.ChallengeActionAuthorization - ) = - addAction( - Action.ofChallengeActionAuthorization(challengeActionAuthorization) - ) - - /** - * Alias for calling [addAction] with - * `Action.ofResultAuthentication3ds(resultAuthentication3ds)`. - */ - fun addAction(resultAuthentication3ds: Action.ResultAuthentication3dsAction) = - addAction(Action.ofResultAuthentication3ds(resultAuthentication3ds)) - - /** - * Alias for calling [addAction] with - * `Action.ofDeclineActionTokenization(declineActionTokenization)`. - */ - fun addAction(declineActionTokenization: Action.DeclineActionTokenization) = - addAction(Action.ofDeclineActionTokenization(declineActionTokenization)) - - /** Alias for calling [addAction] with `Action.ofRequireTfa(requireTfa)`. */ - fun addAction(requireTfa: Action.RequireTfaAction) = - addAction(Action.ofRequireTfa(requireTfa)) - - /** - * Alias for calling [addAction] with - * `Action.ofApproveActionAch(approveActionAch)`. - */ - fun addAction(approveActionAch: Action.ApproveActionAch) = - addAction(Action.ofApproveActionAch(approveActionAch)) - - /** Alias for calling [addAction] with `Action.ofReturnAction(returnAction)`. */ - fun addAction(returnAction: Action.ReturnAction) = - addAction(Action.ofReturnAction(returnAction)) - - /** The event token. */ - fun eventToken(eventToken: String) = eventToken(JsonField.of(eventToken)) - - /** - * Sets [Builder.eventToken] to an arbitrary JSON value. - * - * You should usually call [Builder.eventToken] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun eventToken(eventToken: JsonField) = apply { - this.eventToken = eventToken - } - - /** The timestamp of the event. */ - fun timestamp(timestamp: OffsetDateTime) = timestamp(JsonField.of(timestamp)) - - /** - * Sets [Builder.timestamp] to an arbitrary JSON value. - * - * You should usually call [Builder.timestamp] with a well-typed - * [OffsetDateTime] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun timestamp(timestamp: JsonField) = apply { - this.timestamp = timestamp - } - - /** The token of the transaction associated with the event */ - fun transactionToken(transactionToken: String?) = - transactionToken(JsonField.ofNullable(transactionToken)) - - /** - * Alias for calling [Builder.transactionToken] with - * `transactionToken.orElse(null)`. - */ - fun transactionToken(transactionToken: Optional) = - transactionToken(transactionToken.getOrNull()) - - /** - * Sets [Builder.transactionToken] to an arbitrary JSON value. - * - * You should usually call [Builder.transactionToken] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun transactionToken(transactionToken: JsonField) = apply { - this.transactionToken = transactionToken - } - - 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 [Example]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .actions() - * .eventToken() - * .timestamp() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): Example = - Example( - checkRequired("actions", actions).map { it.toImmutable() }, - checkRequired("eventToken", eventToken), - checkRequired("timestamp", timestamp), - transactionToken, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): Example = apply { - if (validated) { - return@apply - } - - actions().forEach { it.validate() } - eventToken() - timestamp() - transactionToken() - 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 = - (actions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (eventToken.asKnown().isPresent) 1 else 0) + - (if (timestamp.asKnown().isPresent) 1 else 0) + - (if (transactionToken.asKnown().isPresent) 1 else 0) - - @JsonDeserialize(using = Action.Deserializer::class) - @JsonSerialize(using = Action.Serializer::class) - class Action - private constructor( - private val declineActionAuthorization: DeclineActionAuthorization? = null, - private val challengeActionAuthorization: ChallengeActionAuthorization? = null, - private val resultAuthentication3ds: ResultAuthentication3dsAction? = null, - private val declineActionTokenization: DeclineActionTokenization? = null, - private val requireTfa: RequireTfaAction? = null, - private val approveActionAch: ApproveActionAch? = null, - private val returnAction: ReturnAction? = null, - private val _json: JsonValue? = null, - ) { - - fun declineActionAuthorization(): Optional = - Optional.ofNullable(declineActionAuthorization) - - fun challengeActionAuthorization(): Optional = - Optional.ofNullable(challengeActionAuthorization) - - fun resultAuthentication3ds(): Optional = - Optional.ofNullable(resultAuthentication3ds) - - fun declineActionTokenization(): Optional = - Optional.ofNullable(declineActionTokenization) - - fun requireTfa(): Optional = Optional.ofNullable(requireTfa) - - fun approveActionAch(): Optional = - Optional.ofNullable(approveActionAch) - - fun returnAction(): Optional = Optional.ofNullable(returnAction) - - fun isDeclineActionAuthorization(): Boolean = declineActionAuthorization != null - - fun isChallengeActionAuthorization(): Boolean = - challengeActionAuthorization != null - - fun isResultAuthentication3ds(): Boolean = resultAuthentication3ds != null - - fun isDeclineActionTokenization(): Boolean = declineActionTokenization != null - - fun isRequireTfa(): Boolean = requireTfa != null - - fun isApproveActionAch(): Boolean = approveActionAch != null - - fun isReturnAction(): Boolean = returnAction != null - - fun asDeclineActionAuthorization(): DeclineActionAuthorization = - declineActionAuthorization.getOrThrow("declineActionAuthorization") - - fun asChallengeActionAuthorization(): ChallengeActionAuthorization = - challengeActionAuthorization.getOrThrow("challengeActionAuthorization") - - fun asResultAuthentication3ds(): ResultAuthentication3dsAction = - resultAuthentication3ds.getOrThrow("resultAuthentication3ds") - - fun asDeclineActionTokenization(): DeclineActionTokenization = - declineActionTokenization.getOrThrow("declineActionTokenization") - - fun asRequireTfa(): RequireTfaAction = requireTfa.getOrThrow("requireTfa") - - fun asApproveActionAch(): ApproveActionAch = - approveActionAch.getOrThrow("approveActionAch") - - fun asReturnAction(): ReturnAction = returnAction.getOrThrow("returnAction") - - fun _json(): Optional = Optional.ofNullable(_json) - - fun accept(visitor: Visitor): T = - when { - declineActionAuthorization != null -> - visitor.visitDeclineActionAuthorization(declineActionAuthorization) - challengeActionAuthorization != null -> - visitor.visitChallengeActionAuthorization( - challengeActionAuthorization - ) - resultAuthentication3ds != null -> - visitor.visitResultAuthentication3ds(resultAuthentication3ds) - declineActionTokenization != null -> - visitor.visitDeclineActionTokenization(declineActionTokenization) - requireTfa != null -> visitor.visitRequireTfa(requireTfa) - approveActionAch != null -> - visitor.visitApproveActionAch(approveActionAch) - returnAction != null -> visitor.visitReturnAction(returnAction) - else -> visitor.unknown(_json) - } + return other is DailyStatistic && + date == other.date && + versions == other.versions && + additionalProperties == other.additionalProperties + } - private var validated: Boolean = false - - fun validate(): Action = apply { - if (validated) { - return@apply - } - - accept( - object : Visitor { - override fun visitDeclineActionAuthorization( - declineActionAuthorization: DeclineActionAuthorization - ) { - declineActionAuthorization.validate() - } - - override fun visitChallengeActionAuthorization( - challengeActionAuthorization: ChallengeActionAuthorization - ) { - challengeActionAuthorization.validate() - } - - override fun visitResultAuthentication3ds( - resultAuthentication3ds: ResultAuthentication3dsAction - ) { - resultAuthentication3ds.validate() - } - - override fun visitDeclineActionTokenization( - declineActionTokenization: DeclineActionTokenization - ) { - declineActionTokenization.validate() - } - - override fun visitRequireTfa(requireTfa: RequireTfaAction) { - requireTfa.validate() - } - - override fun visitApproveActionAch( - approveActionAch: ApproveActionAch - ) { - approveActionAch.validate() - } - - override fun visitReturnAction(returnAction: ReturnAction) { - returnAction.validate() - } - } - ) - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - accept( - object : Visitor { - override fun visitDeclineActionAuthorization( - declineActionAuthorization: DeclineActionAuthorization - ) = declineActionAuthorization.validity() - - override fun visitChallengeActionAuthorization( - challengeActionAuthorization: ChallengeActionAuthorization - ) = challengeActionAuthorization.validity() - - override fun visitResultAuthentication3ds( - resultAuthentication3ds: ResultAuthentication3dsAction - ) = resultAuthentication3ds.validity() - - override fun visitDeclineActionTokenization( - declineActionTokenization: DeclineActionTokenization - ) = declineActionTokenization.validity() - - override fun visitRequireTfa(requireTfa: RequireTfaAction) = - requireTfa.validity() - - override fun visitApproveActionAch( - approveActionAch: ApproveActionAch - ) = approveActionAch.validity() - - override fun visitReturnAction(returnAction: ReturnAction) = - returnAction.validity() - - override fun unknown(json: JsonValue?) = 0 - } - ) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Action && - declineActionAuthorization == other.declineActionAuthorization && - challengeActionAuthorization == other.challengeActionAuthorization && - resultAuthentication3ds == other.resultAuthentication3ds && - declineActionTokenization == other.declineActionTokenization && - requireTfa == other.requireTfa && - approveActionAch == other.approveActionAch && - returnAction == other.returnAction - } - - override fun hashCode(): Int = - Objects.hash( - declineActionAuthorization, - challengeActionAuthorization, - resultAuthentication3ds, - declineActionTokenization, - requireTfa, - approveActionAch, - returnAction, - ) - - override fun toString(): String = - when { - declineActionAuthorization != null -> - "Action{declineActionAuthorization=$declineActionAuthorization}" - challengeActionAuthorization != null -> - "Action{challengeActionAuthorization=$challengeActionAuthorization}" - resultAuthentication3ds != null -> - "Action{resultAuthentication3ds=$resultAuthentication3ds}" - declineActionTokenization != null -> - "Action{declineActionTokenization=$declineActionTokenization}" - requireTfa != null -> "Action{requireTfa=$requireTfa}" - approveActionAch != null -> "Action{approveActionAch=$approveActionAch}" - returnAction != null -> "Action{returnAction=$returnAction}" - _json != null -> "Action{_unknown=$_json}" - else -> throw IllegalStateException("Invalid Action") - } - - companion object { - - @JvmStatic - fun ofDeclineActionAuthorization( - declineActionAuthorization: DeclineActionAuthorization - ) = Action(declineActionAuthorization = declineActionAuthorization) - - @JvmStatic - fun ofChallengeActionAuthorization( - challengeActionAuthorization: ChallengeActionAuthorization - ) = Action(challengeActionAuthorization = challengeActionAuthorization) - - @JvmStatic - fun ofResultAuthentication3ds( - resultAuthentication3ds: ResultAuthentication3dsAction - ) = Action(resultAuthentication3ds = resultAuthentication3ds) - - @JvmStatic - fun ofDeclineActionTokenization( - declineActionTokenization: DeclineActionTokenization - ) = Action(declineActionTokenization = declineActionTokenization) - - @JvmStatic - fun ofRequireTfa(requireTfa: RequireTfaAction) = - Action(requireTfa = requireTfa) - - @JvmStatic - fun ofApproveActionAch(approveActionAch: ApproveActionAch) = - Action(approveActionAch = approveActionAch) - - @JvmStatic - fun ofReturnAction(returnAction: ReturnAction) = - Action(returnAction = returnAction) - } - - /** - * An interface that defines how to map each variant of [Action] to a value of - * type [T]. - */ - interface Visitor { - - fun visitDeclineActionAuthorization( - declineActionAuthorization: DeclineActionAuthorization - ): T - - fun visitChallengeActionAuthorization( - challengeActionAuthorization: ChallengeActionAuthorization - ): T - - fun visitResultAuthentication3ds( - resultAuthentication3ds: ResultAuthentication3dsAction - ): T - - fun visitDeclineActionTokenization( - declineActionTokenization: DeclineActionTokenization - ): T - - fun visitRequireTfa(requireTfa: RequireTfaAction): T - - fun visitApproveActionAch(approveActionAch: ApproveActionAch): T - - fun visitReturnAction(returnAction: ReturnAction): T - - /** - * Maps an unknown variant of [Action] to a value of type [T]. - * - * An instance of [Action] 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 Action: $json") - } - } - - internal class Deserializer : BaseDeserializer(Action::class) { - - override fun ObjectCodec.deserialize(node: JsonNode): Action { - val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Action( - declineActionAuthorization = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Action( - challengeActionAuthorization = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Action(resultAuthentication3ds = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Action(declineActionTokenization = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Action(requireTfa = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Action(approveActionAch = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - Action(returnAction = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely - // incompatible with all the possible variants (e.g. deserializing - // from boolean). - 0 -> Action(_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(Action::class) { - - override fun serialize( - value: Action, - generator: JsonGenerator, - provider: SerializerProvider, - ) { - when { - value.declineActionAuthorization != null -> - generator.writeObject(value.declineActionAuthorization) - value.challengeActionAuthorization != null -> - generator.writeObject(value.challengeActionAuthorization) - value.resultAuthentication3ds != null -> - generator.writeObject(value.resultAuthentication3ds) - value.declineActionTokenization != null -> - generator.writeObject(value.declineActionTokenization) - value.requireTfa != null -> generator.writeObject(value.requireTfa) - value.approveActionAch != null -> - generator.writeObject(value.approveActionAch) - value.returnAction != null -> - generator.writeObject(value.returnAction) - value._json != null -> generator.writeObject(value._json) - else -> throw IllegalStateException("Invalid Action") - } - } - } - - class DeclineActionAuthorization - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val code: JsonField, - private val type: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("code") - @ExcludeMissing - code: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of(), - ) : this(code, type, mutableMapOf()) - - /** - * The detailed result code explaining the specific reason for the decline - * - * @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 code(): DetailedResult = code.getRequired("code") - - /** - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type or is unexpectedly missing or null (e.g. if the server responded - * with an unexpected value). - */ - fun type(): Type = type.getRequired("type") - - /** - * Returns the raw JSON value of [code]. - * - * Unlike [code], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("code") - @ExcludeMissing - fun _code(): JsonField = code - - /** - * 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 - * [DeclineActionAuthorization]. - * - * The following fields are required: - * ```java - * .code() - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [DeclineActionAuthorization]. */ - class Builder internal constructor() { - - private var code: JsonField? = null - private var type: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - declineActionAuthorization: DeclineActionAuthorization - ) = apply { - code = declineActionAuthorization.code - type = declineActionAuthorization.type - additionalProperties = - declineActionAuthorization.additionalProperties.toMutableMap() - } - - /** - * The detailed result code explaining the specific reason for the - * decline - */ - fun code(code: DetailedResult) = code(JsonField.of(code)) - - /** - * Sets [Builder.code] to an arbitrary JSON value. - * - * You should usually call [Builder.code] with a well-typed - * [DetailedResult] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun code(code: JsonField) = apply { this.code = code } - - fun type(type: Type) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [DeclineActionAuthorization]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .code() - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): DeclineActionAuthorization = - DeclineActionAuthorization( - checkRequired("code", code), - checkRequired("type", type), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): DeclineActionAuthorization = apply { - if (validated) { - return@apply - } - - code().validate() - type().validate() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this - * object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (code.asKnown().getOrNull()?.validity() ?: 0) + - (type.asKnown().getOrNull()?.validity() ?: 0) - - /** - * The detailed result code explaining the specific reason for the decline - */ - class DetailedResult - @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 ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = - of("ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED") - - @JvmField val ACCOUNT_DELINQUENT = of("ACCOUNT_DELINQUENT") - - @JvmField val ACCOUNT_INACTIVE = of("ACCOUNT_INACTIVE") - - @JvmField - val ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = - of("ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED") - - @JvmField - val ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = - of("ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED") - - @JvmField val ACCOUNT_PAUSED = of("ACCOUNT_PAUSED") - - @JvmField val ACCOUNT_UNDER_REVIEW = of("ACCOUNT_UNDER_REVIEW") - - @JvmField val ADDRESS_INCORRECT = of("ADDRESS_INCORRECT") - - @JvmField val APPROVED = of("APPROVED") - - @JvmField - val AUTH_RULE_ALLOWED_COUNTRY = of("AUTH_RULE_ALLOWED_COUNTRY") - - @JvmField val AUTH_RULE_ALLOWED_MCC = of("AUTH_RULE_ALLOWED_MCC") - - @JvmField - val AUTH_RULE_BLOCKED_COUNTRY = of("AUTH_RULE_BLOCKED_COUNTRY") - - @JvmField val AUTH_RULE_BLOCKED_MCC = of("AUTH_RULE_BLOCKED_MCC") - - @JvmField val AUTH_RULE = of("AUTH_RULE") - - @JvmField val CARD_CLOSED = of("CARD_CLOSED") - - @JvmField - val CARD_CRYPTOGRAM_VALIDATION_FAILURE = - of("CARD_CRYPTOGRAM_VALIDATION_FAILURE") - - @JvmField val CARD_EXPIRED = of("CARD_EXPIRED") - - @JvmField - val CARD_EXPIRY_DATE_INCORRECT = of("CARD_EXPIRY_DATE_INCORRECT") - - @JvmField val CARD_INVALID = of("CARD_INVALID") - - @JvmField val CARD_NOT_ACTIVATED = of("CARD_NOT_ACTIVATED") - - @JvmField val CARD_PAUSED = of("CARD_PAUSED") - - @JvmField val CARD_PIN_INCORRECT = of("CARD_PIN_INCORRECT") - - @JvmField val CARD_RESTRICTED = of("CARD_RESTRICTED") - - @JvmField - val CARD_SECURITY_CODE_INCORRECT = - of("CARD_SECURITY_CODE_INCORRECT") - - @JvmField - val CARD_SPEND_LIMIT_EXCEEDED = of("CARD_SPEND_LIMIT_EXCEEDED") - - @JvmField val CONTACT_CARD_ISSUER = of("CONTACT_CARD_ISSUER") - - @JvmField val CUSTOMER_ASA_TIMEOUT = of("CUSTOMER_ASA_TIMEOUT") - - @JvmField val CUSTOM_ASA_RESULT = of("CUSTOM_ASA_RESULT") - - @JvmField val DECLINED = of("DECLINED") - - @JvmField val DO_NOT_HONOR = of("DO_NOT_HONOR") - - @JvmField val DRIVER_NUMBER_INVALID = of("DRIVER_NUMBER_INVALID") - - @JvmField val FORMAT_ERROR = of("FORMAT_ERROR") - - @JvmField - val INSUFFICIENT_FUNDING_SOURCE_BALANCE = - of("INSUFFICIENT_FUNDING_SOURCE_BALANCE") - - @JvmField val INSUFFICIENT_FUNDS = of("INSUFFICIENT_FUNDS") - - @JvmField val LITHIC_SYSTEM_ERROR = of("LITHIC_SYSTEM_ERROR") - - @JvmField - val LITHIC_SYSTEM_RATE_LIMIT = of("LITHIC_SYSTEM_RATE_LIMIT") - - @JvmField val MALFORMED_ASA_RESPONSE = of("MALFORMED_ASA_RESPONSE") - - @JvmField val MERCHANT_INVALID = of("MERCHANT_INVALID") - - @JvmField - val MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = - of("MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE") - - @JvmField val MERCHANT_NOT_PERMITTED = of("MERCHANT_NOT_PERMITTED") - - @JvmField - val OVER_REVERSAL_ATTEMPTED = of("OVER_REVERSAL_ATTEMPTED") - - @JvmField val PIN_BLOCKED = of("PIN_BLOCKED") - - @JvmField - val PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = - of("PROGRAM_CARD_SPEND_LIMIT_EXCEEDED") - - @JvmField val PROGRAM_SUSPENDED = of("PROGRAM_SUSPENDED") - - @JvmField - val PROGRAM_USAGE_RESTRICTION = of("PROGRAM_USAGE_RESTRICTION") - - @JvmField val REVERSAL_UNMATCHED = of("REVERSAL_UNMATCHED") - - @JvmField val SECURITY_VIOLATION = of("SECURITY_VIOLATION") - - @JvmField - val SINGLE_USE_CARD_REATTEMPTED = of("SINGLE_USE_CARD_REATTEMPTED") - - @JvmField val SUSPECTED_FRAUD = of("SUSPECTED_FRAUD") - - @JvmField val TRANSACTION_INVALID = of("TRANSACTION_INVALID") - - @JvmField - val TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = - of("TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL") - - @JvmField - val TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = - of("TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER") - - @JvmField - val TRANSACTION_PREVIOUSLY_COMPLETED = - of("TRANSACTION_PREVIOUSLY_COMPLETED") - - @JvmField val UNAUTHORIZED_MERCHANT = of("UNAUTHORIZED_MERCHANT") - - @JvmField val VEHICLE_NUMBER_INVALID = of("VEHICLE_NUMBER_INVALID") - - @JvmField val CARDHOLDER_CHALLENGED = of("CARDHOLDER_CHALLENGED") - - @JvmField - val CARDHOLDER_CHALLENGE_FAILED = of("CARDHOLDER_CHALLENGE_FAILED") - - @JvmStatic - fun of(value: String) = DetailedResult(JsonField.of(value)) - } - - /** An enum containing [DetailedResult]'s known values. */ - enum class Known { - ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, - ACCOUNT_DELINQUENT, - ACCOUNT_INACTIVE, - ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, - ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, - ACCOUNT_PAUSED, - ACCOUNT_UNDER_REVIEW, - ADDRESS_INCORRECT, - APPROVED, - AUTH_RULE_ALLOWED_COUNTRY, - AUTH_RULE_ALLOWED_MCC, - AUTH_RULE_BLOCKED_COUNTRY, - AUTH_RULE_BLOCKED_MCC, - AUTH_RULE, - CARD_CLOSED, - CARD_CRYPTOGRAM_VALIDATION_FAILURE, - CARD_EXPIRED, - CARD_EXPIRY_DATE_INCORRECT, - CARD_INVALID, - CARD_NOT_ACTIVATED, - CARD_PAUSED, - CARD_PIN_INCORRECT, - CARD_RESTRICTED, - CARD_SECURITY_CODE_INCORRECT, - CARD_SPEND_LIMIT_EXCEEDED, - CONTACT_CARD_ISSUER, - CUSTOMER_ASA_TIMEOUT, - CUSTOM_ASA_RESULT, - DECLINED, - DO_NOT_HONOR, - DRIVER_NUMBER_INVALID, - FORMAT_ERROR, - INSUFFICIENT_FUNDING_SOURCE_BALANCE, - INSUFFICIENT_FUNDS, - LITHIC_SYSTEM_ERROR, - LITHIC_SYSTEM_RATE_LIMIT, - MALFORMED_ASA_RESPONSE, - MERCHANT_INVALID, - MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, - MERCHANT_NOT_PERMITTED, - OVER_REVERSAL_ATTEMPTED, - PIN_BLOCKED, - PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, - PROGRAM_SUSPENDED, - PROGRAM_USAGE_RESTRICTION, - REVERSAL_UNMATCHED, - SECURITY_VIOLATION, - SINGLE_USE_CARD_REATTEMPTED, - SUSPECTED_FRAUD, - TRANSACTION_INVALID, - TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, - TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, - TRANSACTION_PREVIOUSLY_COMPLETED, - UNAUTHORIZED_MERCHANT, - VEHICLE_NUMBER_INVALID, - CARDHOLDER_CHALLENGED, - CARDHOLDER_CHALLENGE_FAILED, - } - - /** - * An enum containing [DetailedResult]'s known values, as well as an - * [_UNKNOWN] member. - * - * An instance of [DetailedResult] 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 { - ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, - ACCOUNT_DELINQUENT, - ACCOUNT_INACTIVE, - ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, - ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, - ACCOUNT_PAUSED, - ACCOUNT_UNDER_REVIEW, - ADDRESS_INCORRECT, - APPROVED, - AUTH_RULE_ALLOWED_COUNTRY, - AUTH_RULE_ALLOWED_MCC, - AUTH_RULE_BLOCKED_COUNTRY, - AUTH_RULE_BLOCKED_MCC, - AUTH_RULE, - CARD_CLOSED, - CARD_CRYPTOGRAM_VALIDATION_FAILURE, - CARD_EXPIRED, - CARD_EXPIRY_DATE_INCORRECT, - CARD_INVALID, - CARD_NOT_ACTIVATED, - CARD_PAUSED, - CARD_PIN_INCORRECT, - CARD_RESTRICTED, - CARD_SECURITY_CODE_INCORRECT, - CARD_SPEND_LIMIT_EXCEEDED, - CONTACT_CARD_ISSUER, - CUSTOMER_ASA_TIMEOUT, - CUSTOM_ASA_RESULT, - DECLINED, - DO_NOT_HONOR, - DRIVER_NUMBER_INVALID, - FORMAT_ERROR, - INSUFFICIENT_FUNDING_SOURCE_BALANCE, - INSUFFICIENT_FUNDS, - LITHIC_SYSTEM_ERROR, - LITHIC_SYSTEM_RATE_LIMIT, - MALFORMED_ASA_RESPONSE, - MERCHANT_INVALID, - MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, - MERCHANT_NOT_PERMITTED, - OVER_REVERSAL_ATTEMPTED, - PIN_BLOCKED, - PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, - PROGRAM_SUSPENDED, - PROGRAM_USAGE_RESTRICTION, - REVERSAL_UNMATCHED, - SECURITY_VIOLATION, - SINGLE_USE_CARD_REATTEMPTED, - SUSPECTED_FRAUD, - TRANSACTION_INVALID, - TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, - TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, - TRANSACTION_PREVIOUSLY_COMPLETED, - UNAUTHORIZED_MERCHANT, - VEHICLE_NUMBER_INVALID, - CARDHOLDER_CHALLENGED, - CARDHOLDER_CHALLENGE_FAILED, - /** - * An enum member indicating that [DetailedResult] 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) { - ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED -> - Value.ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED - ACCOUNT_DELINQUENT -> Value.ACCOUNT_DELINQUENT - ACCOUNT_INACTIVE -> Value.ACCOUNT_INACTIVE - ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED -> - Value.ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED - ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED -> - Value.ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED - ACCOUNT_PAUSED -> Value.ACCOUNT_PAUSED - ACCOUNT_UNDER_REVIEW -> Value.ACCOUNT_UNDER_REVIEW - ADDRESS_INCORRECT -> Value.ADDRESS_INCORRECT - APPROVED -> Value.APPROVED - AUTH_RULE_ALLOWED_COUNTRY -> Value.AUTH_RULE_ALLOWED_COUNTRY - AUTH_RULE_ALLOWED_MCC -> Value.AUTH_RULE_ALLOWED_MCC - AUTH_RULE_BLOCKED_COUNTRY -> Value.AUTH_RULE_BLOCKED_COUNTRY - AUTH_RULE_BLOCKED_MCC -> Value.AUTH_RULE_BLOCKED_MCC - AUTH_RULE -> Value.AUTH_RULE - CARD_CLOSED -> Value.CARD_CLOSED - CARD_CRYPTOGRAM_VALIDATION_FAILURE -> - Value.CARD_CRYPTOGRAM_VALIDATION_FAILURE - CARD_EXPIRED -> Value.CARD_EXPIRED - CARD_EXPIRY_DATE_INCORRECT -> Value.CARD_EXPIRY_DATE_INCORRECT - CARD_INVALID -> Value.CARD_INVALID - CARD_NOT_ACTIVATED -> Value.CARD_NOT_ACTIVATED - CARD_PAUSED -> Value.CARD_PAUSED - CARD_PIN_INCORRECT -> Value.CARD_PIN_INCORRECT - CARD_RESTRICTED -> Value.CARD_RESTRICTED - CARD_SECURITY_CODE_INCORRECT -> - Value.CARD_SECURITY_CODE_INCORRECT - CARD_SPEND_LIMIT_EXCEEDED -> Value.CARD_SPEND_LIMIT_EXCEEDED - CONTACT_CARD_ISSUER -> Value.CONTACT_CARD_ISSUER - CUSTOMER_ASA_TIMEOUT -> Value.CUSTOMER_ASA_TIMEOUT - CUSTOM_ASA_RESULT -> Value.CUSTOM_ASA_RESULT - DECLINED -> Value.DECLINED - DO_NOT_HONOR -> Value.DO_NOT_HONOR - DRIVER_NUMBER_INVALID -> Value.DRIVER_NUMBER_INVALID - FORMAT_ERROR -> Value.FORMAT_ERROR - INSUFFICIENT_FUNDING_SOURCE_BALANCE -> - Value.INSUFFICIENT_FUNDING_SOURCE_BALANCE - INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS - LITHIC_SYSTEM_ERROR -> Value.LITHIC_SYSTEM_ERROR - LITHIC_SYSTEM_RATE_LIMIT -> Value.LITHIC_SYSTEM_RATE_LIMIT - MALFORMED_ASA_RESPONSE -> Value.MALFORMED_ASA_RESPONSE - MERCHANT_INVALID -> Value.MERCHANT_INVALID - MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE -> - Value.MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE - MERCHANT_NOT_PERMITTED -> Value.MERCHANT_NOT_PERMITTED - OVER_REVERSAL_ATTEMPTED -> Value.OVER_REVERSAL_ATTEMPTED - PIN_BLOCKED -> Value.PIN_BLOCKED - PROGRAM_CARD_SPEND_LIMIT_EXCEEDED -> - Value.PROGRAM_CARD_SPEND_LIMIT_EXCEEDED - PROGRAM_SUSPENDED -> Value.PROGRAM_SUSPENDED - PROGRAM_USAGE_RESTRICTION -> Value.PROGRAM_USAGE_RESTRICTION - REVERSAL_UNMATCHED -> Value.REVERSAL_UNMATCHED - SECURITY_VIOLATION -> Value.SECURITY_VIOLATION - SINGLE_USE_CARD_REATTEMPTED -> Value.SINGLE_USE_CARD_REATTEMPTED - SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD - TRANSACTION_INVALID -> Value.TRANSACTION_INVALID - TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL -> - Value.TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL - TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER -> - Value.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER - TRANSACTION_PREVIOUSLY_COMPLETED -> - Value.TRANSACTION_PREVIOUSLY_COMPLETED - UNAUTHORIZED_MERCHANT -> Value.UNAUTHORIZED_MERCHANT - VEHICLE_NUMBER_INVALID -> Value.VEHICLE_NUMBER_INVALID - CARDHOLDER_CHALLENGED -> Value.CARDHOLDER_CHALLENGED - CARDHOLDER_CHALLENGE_FAILED -> Value.CARDHOLDER_CHALLENGE_FAILED - 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) { - ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED -> - Known.ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED - ACCOUNT_DELINQUENT -> Known.ACCOUNT_DELINQUENT - ACCOUNT_INACTIVE -> Known.ACCOUNT_INACTIVE - ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED -> - Known.ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED - ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED -> - Known.ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED - ACCOUNT_PAUSED -> Known.ACCOUNT_PAUSED - ACCOUNT_UNDER_REVIEW -> Known.ACCOUNT_UNDER_REVIEW - ADDRESS_INCORRECT -> Known.ADDRESS_INCORRECT - APPROVED -> Known.APPROVED - AUTH_RULE_ALLOWED_COUNTRY -> Known.AUTH_RULE_ALLOWED_COUNTRY - AUTH_RULE_ALLOWED_MCC -> Known.AUTH_RULE_ALLOWED_MCC - AUTH_RULE_BLOCKED_COUNTRY -> Known.AUTH_RULE_BLOCKED_COUNTRY - AUTH_RULE_BLOCKED_MCC -> Known.AUTH_RULE_BLOCKED_MCC - AUTH_RULE -> Known.AUTH_RULE - CARD_CLOSED -> Known.CARD_CLOSED - CARD_CRYPTOGRAM_VALIDATION_FAILURE -> - Known.CARD_CRYPTOGRAM_VALIDATION_FAILURE - CARD_EXPIRED -> Known.CARD_EXPIRED - CARD_EXPIRY_DATE_INCORRECT -> Known.CARD_EXPIRY_DATE_INCORRECT - CARD_INVALID -> Known.CARD_INVALID - CARD_NOT_ACTIVATED -> Known.CARD_NOT_ACTIVATED - CARD_PAUSED -> Known.CARD_PAUSED - CARD_PIN_INCORRECT -> Known.CARD_PIN_INCORRECT - CARD_RESTRICTED -> Known.CARD_RESTRICTED - CARD_SECURITY_CODE_INCORRECT -> - Known.CARD_SECURITY_CODE_INCORRECT - CARD_SPEND_LIMIT_EXCEEDED -> Known.CARD_SPEND_LIMIT_EXCEEDED - CONTACT_CARD_ISSUER -> Known.CONTACT_CARD_ISSUER - CUSTOMER_ASA_TIMEOUT -> Known.CUSTOMER_ASA_TIMEOUT - CUSTOM_ASA_RESULT -> Known.CUSTOM_ASA_RESULT - DECLINED -> Known.DECLINED - DO_NOT_HONOR -> Known.DO_NOT_HONOR - DRIVER_NUMBER_INVALID -> Known.DRIVER_NUMBER_INVALID - FORMAT_ERROR -> Known.FORMAT_ERROR - INSUFFICIENT_FUNDING_SOURCE_BALANCE -> - Known.INSUFFICIENT_FUNDING_SOURCE_BALANCE - INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS - LITHIC_SYSTEM_ERROR -> Known.LITHIC_SYSTEM_ERROR - LITHIC_SYSTEM_RATE_LIMIT -> Known.LITHIC_SYSTEM_RATE_LIMIT - MALFORMED_ASA_RESPONSE -> Known.MALFORMED_ASA_RESPONSE - MERCHANT_INVALID -> Known.MERCHANT_INVALID - MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE -> - Known.MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE - MERCHANT_NOT_PERMITTED -> Known.MERCHANT_NOT_PERMITTED - OVER_REVERSAL_ATTEMPTED -> Known.OVER_REVERSAL_ATTEMPTED - PIN_BLOCKED -> Known.PIN_BLOCKED - PROGRAM_CARD_SPEND_LIMIT_EXCEEDED -> - Known.PROGRAM_CARD_SPEND_LIMIT_EXCEEDED - PROGRAM_SUSPENDED -> Known.PROGRAM_SUSPENDED - PROGRAM_USAGE_RESTRICTION -> Known.PROGRAM_USAGE_RESTRICTION - REVERSAL_UNMATCHED -> Known.REVERSAL_UNMATCHED - SECURITY_VIOLATION -> Known.SECURITY_VIOLATION - SINGLE_USE_CARD_REATTEMPTED -> Known.SINGLE_USE_CARD_REATTEMPTED - SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD - TRANSACTION_INVALID -> Known.TRANSACTION_INVALID - TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL -> - Known.TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL - TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER -> - Known.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER - TRANSACTION_PREVIOUSLY_COMPLETED -> - Known.TRANSACTION_PREVIOUSLY_COMPLETED - UNAUTHORIZED_MERCHANT -> Known.UNAUTHORIZED_MERCHANT - VEHICLE_NUMBER_INVALID -> Known.VEHICLE_NUMBER_INVALID - CARDHOLDER_CHALLENGED -> Known.CARDHOLDER_CHALLENGED - CARDHOLDER_CHALLENGE_FAILED -> Known.CARDHOLDER_CHALLENGE_FAILED - else -> - throw LithicInvalidDataException( - "Unknown DetailedResult: $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(): DetailedResult = 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 DetailedResult && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - class Type - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from - * data that doesn't match any known member, and you want to know that - * value. For example, if the SDK is on an older version than the API, - * then the API may respond with new members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val DECLINE = of("DECLINE") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - DECLINE - } - - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Type] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. - * For example, if the SDK is on an older version than the API, then - * the API may respond with new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - DECLINE, - /** - * An enum member indicating that [Type] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, - * or [Value._UNKNOWN] if the class was instantiated with an unknown - * value. - * - * Use the [known] method instead if you're certain the value is always - * known or if you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - DECLINE -> Value.DECLINE - 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) { - DECLINE -> Known.DECLINE - else -> throw LithicInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is - * primarily for debugging and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value - * does not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LithicInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in - * this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DeclineActionAuthorization && - code == other.code && - type == other.type && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(code, type, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "DeclineActionAuthorization{code=$code, type=$type, additionalProperties=$additionalProperties}" - } - - class ChallengeActionAuthorization - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val type: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of() - ) : this(type, 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 type(): Type = type.getRequired("type") - - /** - * 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 - * [ChallengeActionAuthorization]. - * - * The following fields are required: - * ```java - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ChallengeActionAuthorization]. */ - class Builder internal constructor() { - - private var type: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - challengeActionAuthorization: ChallengeActionAuthorization - ) = apply { - type = challengeActionAuthorization.type - additionalProperties = - challengeActionAuthorization.additionalProperties.toMutableMap() - } - - fun type(type: Type) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [ChallengeActionAuthorization]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ChallengeActionAuthorization = - ChallengeActionAuthorization( - checkRequired("type", type), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): ChallengeActionAuthorization = apply { - if (validated) { - return@apply - } - - type().validate() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this - * object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = (type.asKnown().getOrNull()?.validity() ?: 0) - - class Type - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from - * data that doesn't match any known member, and you want to know that - * value. For example, if the SDK is on an older version than the API, - * then the API may respond with new members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val CHALLENGE = of("CHALLENGE") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - CHALLENGE - } - - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Type] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. - * For example, if the SDK is on an older version than the API, then - * the API may respond with new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - CHALLENGE, - /** - * An enum member indicating that [Type] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, - * or [Value._UNKNOWN] if the class was instantiated with an unknown - * value. - * - * Use the [known] method instead if you're certain the value is always - * known or if you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - CHALLENGE -> Value.CHALLENGE - 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) { - CHALLENGE -> Known.CHALLENGE - else -> throw LithicInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is - * primarily for debugging and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value - * does not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LithicInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in - * this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ChallengeActionAuthorization && - type == other.type && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(type, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ChallengeActionAuthorization{type=$type, additionalProperties=$additionalProperties}" - } - - class ResultAuthentication3dsAction - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val type: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of() - ) : this(type, 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 type(): Authentication3dsAction = type.getRequired("type") - - /** - * 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 - * [ResultAuthentication3dsAction]. - * - * The following fields are required: - * ```java - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ResultAuthentication3dsAction]. */ - class Builder internal constructor() { - - private var type: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - resultAuthentication3dsAction: ResultAuthentication3dsAction - ) = apply { - type = resultAuthentication3dsAction.type - additionalProperties = - resultAuthentication3dsAction.additionalProperties - .toMutableMap() - } - - fun type(type: Authentication3dsAction) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed - * [Authentication3dsAction] 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 [ResultAuthentication3dsAction]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ResultAuthentication3dsAction = - ResultAuthentication3dsAction( - checkRequired("type", type), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): ResultAuthentication3dsAction = apply { - if (validated) { - return@apply - } - - type().validate() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this - * object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = (type.asKnown().getOrNull()?.validity() ?: 0) - - class Authentication3dsAction - @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 DECLINE = of("DECLINE") - - @JvmField val CHALLENGE = of("CHALLENGE") - - @JvmStatic - fun of(value: String) = Authentication3dsAction(JsonField.of(value)) - } - - /** An enum containing [Authentication3dsAction]'s known values. */ - enum class Known { - DECLINE, - CHALLENGE, - } - - /** - * An enum containing [Authentication3dsAction]'s known values, as well - * as an [_UNKNOWN] member. - * - * An instance of [Authentication3dsAction] 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 { - DECLINE, - CHALLENGE, - /** - * An enum member indicating that [Authentication3dsAction] 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) { - DECLINE -> Value.DECLINE - CHALLENGE -> Value.CHALLENGE - 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) { - DECLINE -> Known.DECLINE - CHALLENGE -> Known.CHALLENGE - else -> - throw LithicInvalidDataException( - "Unknown Authentication3dsAction: $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(): Authentication3dsAction = 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 Authentication3dsAction && 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 ResultAuthentication3dsAction && - type == other.type && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(type, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ResultAuthentication3dsAction{type=$type, additionalProperties=$additionalProperties}" - } - - class DeclineActionTokenization - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val type: JsonField, - private val reason: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - ) : this(type, reason, mutableMapOf()) - - /** - * Decline the tokenization request - * - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type or is unexpectedly missing or null (e.g. if the server responded - * with an unexpected value). - */ - fun type(): Type = type.getRequired("type") - - /** - * Reason code for declining the tokenization request - * - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type (e.g. if the server responded with an unexpected value). - */ - fun reason(): Optional = reason.getOptional("reason") - - /** - * Returns the raw JSON value of [type]. - * - * Unlike [type], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - - /** - * Returns the raw JSON value of [reason]. - * - * Unlike [reason], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("reason") - @ExcludeMissing - fun _reason(): JsonField = reason - - @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 - * [DeclineActionTokenization]. - * - * The following fields are required: - * ```java - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [DeclineActionTokenization]. */ - class Builder internal constructor() { - - private var type: JsonField? = null - private var reason: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - declineActionTokenization: DeclineActionTokenization - ) = apply { - type = declineActionTokenization.type - reason = declineActionTokenization.reason - additionalProperties = - declineActionTokenization.additionalProperties.toMutableMap() - } - - /** Decline the tokenization request */ - fun type(type: Type) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - /** Reason code for declining the tokenization request */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) - - /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [Reason] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun reason(reason: JsonField) = apply { this.reason = reason } - - 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 [DeclineActionTokenization]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): DeclineActionTokenization = - DeclineActionTokenization( - checkRequired("type", type), - reason, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): DeclineActionTokenization = apply { - if (validated) { - return@apply - } - - type().validate() - reason().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 = - (type.asKnown().getOrNull()?.validity() ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) - - /** Decline the tokenization request */ - class Type - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from - * data that doesn't match any known member, and you want to know that - * value. For example, if the SDK is on an older version than the API, - * then the API may respond with new members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val DECLINE = of("DECLINE") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - DECLINE - } - - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Type] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. - * For example, if the SDK is on an older version than the API, then - * the API may respond with new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - DECLINE, - /** - * An enum member indicating that [Type] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, - * or [Value._UNKNOWN] if the class was instantiated with an unknown - * value. - * - * Use the [known] method instead if you're certain the value is always - * known or if you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - DECLINE -> Value.DECLINE - 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) { - DECLINE -> Known.DECLINE - else -> throw LithicInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is - * primarily for debugging and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value - * does not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LithicInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in - * this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** Reason code for declining the tokenization request */ - class Reason - @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 ACCOUNT_SCORE_1 = of("ACCOUNT_SCORE_1") - - @JvmField val DEVICE_SCORE_1 = of("DEVICE_SCORE_1") - - @JvmField - val ALL_WALLET_DECLINE_REASONS_PRESENT = - of("ALL_WALLET_DECLINE_REASONS_PRESENT") - - @JvmField - val WALLET_RECOMMENDED_DECISION_RED = - of("WALLET_RECOMMENDED_DECISION_RED") - - @JvmField val CVC_MISMATCH = of("CVC_MISMATCH") - - @JvmField - val CARD_EXPIRY_MONTH_MISMATCH = of("CARD_EXPIRY_MONTH_MISMATCH") - - @JvmField - val CARD_EXPIRY_YEAR_MISMATCH = of("CARD_EXPIRY_YEAR_MISMATCH") - - @JvmField val CARD_INVALID_STATE = of("CARD_INVALID_STATE") - - @JvmField val CUSTOMER_RED_PATH = of("CUSTOMER_RED_PATH") - - @JvmField - val INVALID_CUSTOMER_RESPONSE = of("INVALID_CUSTOMER_RESPONSE") - - @JvmField val NETWORK_FAILURE = of("NETWORK_FAILURE") - - @JvmField val GENERIC_DECLINE = of("GENERIC_DECLINE") - - @JvmField - val DIGITAL_CARD_ART_REQUIRED = of("DIGITAL_CARD_ART_REQUIRED") - - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } - - /** An enum containing [Reason]'s known values. */ - enum class Known { - ACCOUNT_SCORE_1, - DEVICE_SCORE_1, - ALL_WALLET_DECLINE_REASONS_PRESENT, - WALLET_RECOMMENDED_DECISION_RED, - CVC_MISMATCH, - CARD_EXPIRY_MONTH_MISMATCH, - CARD_EXPIRY_YEAR_MISMATCH, - CARD_INVALID_STATE, - CUSTOMER_RED_PATH, - INVALID_CUSTOMER_RESPONSE, - NETWORK_FAILURE, - GENERIC_DECLINE, - DIGITAL_CARD_ART_REQUIRED, - } - - /** - * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Reason] 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 { - ACCOUNT_SCORE_1, - DEVICE_SCORE_1, - ALL_WALLET_DECLINE_REASONS_PRESENT, - WALLET_RECOMMENDED_DECISION_RED, - CVC_MISMATCH, - CARD_EXPIRY_MONTH_MISMATCH, - CARD_EXPIRY_YEAR_MISMATCH, - CARD_INVALID_STATE, - CUSTOMER_RED_PATH, - INVALID_CUSTOMER_RESPONSE, - NETWORK_FAILURE, - GENERIC_DECLINE, - DIGITAL_CARD_ART_REQUIRED, - /** - * An enum member indicating that [Reason] 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) { - ACCOUNT_SCORE_1 -> Value.ACCOUNT_SCORE_1 - DEVICE_SCORE_1 -> Value.DEVICE_SCORE_1 - ALL_WALLET_DECLINE_REASONS_PRESENT -> - Value.ALL_WALLET_DECLINE_REASONS_PRESENT - WALLET_RECOMMENDED_DECISION_RED -> - Value.WALLET_RECOMMENDED_DECISION_RED - CVC_MISMATCH -> Value.CVC_MISMATCH - CARD_EXPIRY_MONTH_MISMATCH -> Value.CARD_EXPIRY_MONTH_MISMATCH - CARD_EXPIRY_YEAR_MISMATCH -> Value.CARD_EXPIRY_YEAR_MISMATCH - CARD_INVALID_STATE -> Value.CARD_INVALID_STATE - CUSTOMER_RED_PATH -> Value.CUSTOMER_RED_PATH - INVALID_CUSTOMER_RESPONSE -> Value.INVALID_CUSTOMER_RESPONSE - NETWORK_FAILURE -> Value.NETWORK_FAILURE - GENERIC_DECLINE -> Value.GENERIC_DECLINE - DIGITAL_CARD_ART_REQUIRED -> Value.DIGITAL_CARD_ART_REQUIRED - 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) { - ACCOUNT_SCORE_1 -> Known.ACCOUNT_SCORE_1 - DEVICE_SCORE_1 -> Known.DEVICE_SCORE_1 - ALL_WALLET_DECLINE_REASONS_PRESENT -> - Known.ALL_WALLET_DECLINE_REASONS_PRESENT - WALLET_RECOMMENDED_DECISION_RED -> - Known.WALLET_RECOMMENDED_DECISION_RED - CVC_MISMATCH -> Known.CVC_MISMATCH - CARD_EXPIRY_MONTH_MISMATCH -> Known.CARD_EXPIRY_MONTH_MISMATCH - CARD_EXPIRY_YEAR_MISMATCH -> Known.CARD_EXPIRY_YEAR_MISMATCH - CARD_INVALID_STATE -> Known.CARD_INVALID_STATE - CUSTOMER_RED_PATH -> Known.CUSTOMER_RED_PATH - INVALID_CUSTOMER_RESPONSE -> Known.INVALID_CUSTOMER_RESPONSE - NETWORK_FAILURE -> Known.NETWORK_FAILURE - GENERIC_DECLINE -> Known.GENERIC_DECLINE - DIGITAL_CARD_ART_REQUIRED -> Known.DIGITAL_CARD_ART_REQUIRED - else -> - throw LithicInvalidDataException("Unknown Reason: $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(): Reason = 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 Reason && 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 DeclineActionTokenization && - type == other.type && - reason == other.reason && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(type, reason, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "DeclineActionTokenization{type=$type, reason=$reason, additionalProperties=$additionalProperties}" - } - - class RequireTfaAction - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val type: JsonField, - private val reason: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - ) : this(type, reason, mutableMapOf()) - - /** - * Require two-factor authentication for the tokenization request - * - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type or is unexpectedly missing or null (e.g. if the server responded - * with an unexpected value). - */ - fun type(): Type = type.getRequired("type") - - /** - * Reason code for requiring two-factor authentication - * - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type (e.g. if the server responded with an unexpected value). - */ - fun reason(): Optional = reason.getOptional("reason") - - /** - * Returns the raw JSON value of [type]. - * - * Unlike [type], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - - /** - * Returns the raw JSON value of [reason]. - * - * Unlike [reason], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("reason") - @ExcludeMissing - fun _reason(): JsonField = reason - - @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 - * [RequireTfaAction]. - * - * The following fields are required: - * ```java - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [RequireTfaAction]. */ - class Builder internal constructor() { - - private var type: JsonField? = null - private var reason: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from(requireTfaAction: RequireTfaAction) = apply { - type = requireTfaAction.type - reason = requireTfaAction.reason - additionalProperties = - requireTfaAction.additionalProperties.toMutableMap() - } - - /** Require two-factor authentication for the tokenization request */ - fun type(type: Type) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - /** Reason code for requiring two-factor authentication */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) - - /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [Reason] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun reason(reason: JsonField) = apply { this.reason = reason } - - 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 [RequireTfaAction]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): RequireTfaAction = - RequireTfaAction( - checkRequired("type", type), - reason, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): RequireTfaAction = apply { - if (validated) { - return@apply - } - - type().validate() - reason().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 = - (type.asKnown().getOrNull()?.validity() ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) - - /** Require two-factor authentication for the tokenization request */ - class Type - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from - * data that doesn't match any known member, and you want to know that - * value. For example, if the SDK is on an older version than the API, - * then the API may respond with new members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val REQUIRE_TFA = of("REQUIRE_TFA") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - REQUIRE_TFA - } - - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Type] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. - * For example, if the SDK is on an older version than the API, then - * the API may respond with new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - REQUIRE_TFA, - /** - * An enum member indicating that [Type] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, - * or [Value._UNKNOWN] if the class was instantiated with an unknown - * value. - * - * Use the [known] method instead if you're certain the value is always - * known or if you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - REQUIRE_TFA -> Value.REQUIRE_TFA - 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) { - REQUIRE_TFA -> Known.REQUIRE_TFA - else -> throw LithicInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is - * primarily for debugging and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value - * does not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LithicInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in - * this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** Reason code for requiring two-factor authentication */ - class Reason - @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 WALLET_RECOMMENDED_TFA = of("WALLET_RECOMMENDED_TFA") - - @JvmField val SUSPICIOUS_ACTIVITY = of("SUSPICIOUS_ACTIVITY") - - @JvmField val DEVICE_RECENTLY_LOST = of("DEVICE_RECENTLY_LOST") - - @JvmField - val TOO_MANY_RECENT_ATTEMPTS = of("TOO_MANY_RECENT_ATTEMPTS") - - @JvmField val TOO_MANY_RECENT_TOKENS = of("TOO_MANY_RECENT_TOKENS") - - @JvmField - val TOO_MANY_DIFFERENT_CARDHOLDERS = - of("TOO_MANY_DIFFERENT_CARDHOLDERS") - - @JvmField val OUTSIDE_HOME_TERRITORY = of("OUTSIDE_HOME_TERRITORY") - - @JvmField val HAS_SUSPENDED_TOKENS = of("HAS_SUSPENDED_TOKENS") - - @JvmField val HIGH_RISK = of("HIGH_RISK") - - @JvmField val ACCOUNT_SCORE_LOW = of("ACCOUNT_SCORE_LOW") - - @JvmField val DEVICE_SCORE_LOW = of("DEVICE_SCORE_LOW") - - @JvmField val CARD_STATE_TFA = of("CARD_STATE_TFA") - - @JvmField val HARDCODED_TFA = of("HARDCODED_TFA") - - @JvmField val CUSTOMER_RULE_TFA = of("CUSTOMER_RULE_TFA") - - @JvmField - val DEVICE_HOST_CARD_EMULATION = of("DEVICE_HOST_CARD_EMULATION") - - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } - - /** An enum containing [Reason]'s known values. */ - enum class Known { - WALLET_RECOMMENDED_TFA, - SUSPICIOUS_ACTIVITY, - DEVICE_RECENTLY_LOST, - TOO_MANY_RECENT_ATTEMPTS, - TOO_MANY_RECENT_TOKENS, - TOO_MANY_DIFFERENT_CARDHOLDERS, - OUTSIDE_HOME_TERRITORY, - HAS_SUSPENDED_TOKENS, - HIGH_RISK, - ACCOUNT_SCORE_LOW, - DEVICE_SCORE_LOW, - CARD_STATE_TFA, - HARDCODED_TFA, - CUSTOMER_RULE_TFA, - DEVICE_HOST_CARD_EMULATION, - } - - /** - * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Reason] 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 { - WALLET_RECOMMENDED_TFA, - SUSPICIOUS_ACTIVITY, - DEVICE_RECENTLY_LOST, - TOO_MANY_RECENT_ATTEMPTS, - TOO_MANY_RECENT_TOKENS, - TOO_MANY_DIFFERENT_CARDHOLDERS, - OUTSIDE_HOME_TERRITORY, - HAS_SUSPENDED_TOKENS, - HIGH_RISK, - ACCOUNT_SCORE_LOW, - DEVICE_SCORE_LOW, - CARD_STATE_TFA, - HARDCODED_TFA, - CUSTOMER_RULE_TFA, - DEVICE_HOST_CARD_EMULATION, - /** - * An enum member indicating that [Reason] 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) { - WALLET_RECOMMENDED_TFA -> Value.WALLET_RECOMMENDED_TFA - SUSPICIOUS_ACTIVITY -> Value.SUSPICIOUS_ACTIVITY - DEVICE_RECENTLY_LOST -> Value.DEVICE_RECENTLY_LOST - TOO_MANY_RECENT_ATTEMPTS -> Value.TOO_MANY_RECENT_ATTEMPTS - TOO_MANY_RECENT_TOKENS -> Value.TOO_MANY_RECENT_TOKENS - TOO_MANY_DIFFERENT_CARDHOLDERS -> - Value.TOO_MANY_DIFFERENT_CARDHOLDERS - OUTSIDE_HOME_TERRITORY -> Value.OUTSIDE_HOME_TERRITORY - HAS_SUSPENDED_TOKENS -> Value.HAS_SUSPENDED_TOKENS - HIGH_RISK -> Value.HIGH_RISK - ACCOUNT_SCORE_LOW -> Value.ACCOUNT_SCORE_LOW - DEVICE_SCORE_LOW -> Value.DEVICE_SCORE_LOW - CARD_STATE_TFA -> Value.CARD_STATE_TFA - HARDCODED_TFA -> Value.HARDCODED_TFA - CUSTOMER_RULE_TFA -> Value.CUSTOMER_RULE_TFA - DEVICE_HOST_CARD_EMULATION -> Value.DEVICE_HOST_CARD_EMULATION - 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) { - WALLET_RECOMMENDED_TFA -> Known.WALLET_RECOMMENDED_TFA - SUSPICIOUS_ACTIVITY -> Known.SUSPICIOUS_ACTIVITY - DEVICE_RECENTLY_LOST -> Known.DEVICE_RECENTLY_LOST - TOO_MANY_RECENT_ATTEMPTS -> Known.TOO_MANY_RECENT_ATTEMPTS - TOO_MANY_RECENT_TOKENS -> Known.TOO_MANY_RECENT_TOKENS - TOO_MANY_DIFFERENT_CARDHOLDERS -> - Known.TOO_MANY_DIFFERENT_CARDHOLDERS - OUTSIDE_HOME_TERRITORY -> Known.OUTSIDE_HOME_TERRITORY - HAS_SUSPENDED_TOKENS -> Known.HAS_SUSPENDED_TOKENS - HIGH_RISK -> Known.HIGH_RISK - ACCOUNT_SCORE_LOW -> Known.ACCOUNT_SCORE_LOW - DEVICE_SCORE_LOW -> Known.DEVICE_SCORE_LOW - CARD_STATE_TFA -> Known.CARD_STATE_TFA - HARDCODED_TFA -> Known.HARDCODED_TFA - CUSTOMER_RULE_TFA -> Known.CUSTOMER_RULE_TFA - DEVICE_HOST_CARD_EMULATION -> Known.DEVICE_HOST_CARD_EMULATION - else -> - throw LithicInvalidDataException("Unknown Reason: $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(): Reason = 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 Reason && 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 RequireTfaAction && - type == other.type && - reason == other.reason && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(type, reason, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "RequireTfaAction{type=$type, reason=$reason, additionalProperties=$additionalProperties}" - } - - class ApproveActionAch - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val type: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of() - ) : this(type, mutableMapOf()) - - /** - * Approve the ACH transaction - * - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type or is unexpectedly missing or null (e.g. if the server responded - * with an unexpected value). - */ - fun type(): Type = type.getRequired("type") - - /** - * Returns the raw JSON value of [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 - * [ApproveActionAch]. - * - * The following fields are required: - * ```java - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ApproveActionAch]. */ - class Builder internal constructor() { - - private var type: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from(approveActionAch: ApproveActionAch) = apply { - type = approveActionAch.type - additionalProperties = - approveActionAch.additionalProperties.toMutableMap() - } - - /** Approve the ACH transaction */ - fun type(type: Type) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [ApproveActionAch]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ApproveActionAch = - ApproveActionAch( - checkRequired("type", type), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): ApproveActionAch = apply { - if (validated) { - return@apply - } - - type().validate() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this - * object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = (type.asKnown().getOrNull()?.validity() ?: 0) - - /** Approve the ACH transaction */ - class Type - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from - * data that doesn't match any known member, and you want to know that - * value. For example, if the SDK is on an older version than the API, - * then the API may respond with new members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val APPROVE = of("APPROVE") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - APPROVE - } - - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Type] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. - * For example, if the SDK is on an older version than the API, then - * the API may respond with new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - APPROVE, - /** - * An enum member indicating that [Type] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, - * or [Value._UNKNOWN] if the class was instantiated with an unknown - * value. - * - * Use the [known] method instead if you're certain the value is always - * known or if you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - APPROVE -> Value.APPROVE - 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) { - APPROVE -> Known.APPROVE - else -> throw LithicInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is - * primarily for debugging and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value - * does not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LithicInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in - * this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ApproveActionAch && - type == other.type && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(type, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ApproveActionAch{type=$type, additionalProperties=$additionalProperties}" - } - - class ReturnAction - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val code: JsonField, - private val type: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("code") - @ExcludeMissing - code: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - type: JsonField = JsonMissing.of(), - ) : this(code, type, mutableMapOf()) - - /** - * NACHA return code to use when returning the transaction. Note that the - * list of available return codes is subject to an allowlist configured at - * the program level - * - * @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 code(): Code = code.getRequired("code") - - /** - * Return the ACH transaction - * - * @throws LithicInvalidDataException if the JSON field has an unexpected - * type or is unexpectedly missing or null (e.g. if the server responded - * with an unexpected value). - */ - fun type(): Type = type.getRequired("type") - - /** - * Returns the raw JSON value of [code]. - * - * Unlike [code], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("code") @ExcludeMissing fun _code(): JsonField = code - - /** - * 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 - * [ReturnAction]. - * - * The following fields are required: - * ```java - * .code() - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ReturnAction]. */ - class Builder internal constructor() { - - private var code: JsonField? = null - private var type: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from(returnAction: ReturnAction) = apply { - code = returnAction.code - type = returnAction.type - additionalProperties = - returnAction.additionalProperties.toMutableMap() - } - - /** - * NACHA return code to use when returning the transaction. Note that - * the list of available return codes is subject to an allowlist - * configured at the program level - */ - fun code(code: Code) = code(JsonField.of(code)) - - /** - * Sets [Builder.code] to an arbitrary JSON value. - * - * You should usually call [Builder.code] with a well-typed [Code] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun code(code: JsonField) = apply { this.code = code } - - /** Return the ACH transaction */ - fun type(type: Type) = type(JsonField.of(type)) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [ReturnAction]. - * - * Further updates to this [Builder] will not mutate the returned - * instance. - * - * The following fields are required: - * ```java - * .code() - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ReturnAction = - ReturnAction( - checkRequired("code", code), - checkRequired("type", type), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): ReturnAction = apply { - if (validated) { - return@apply - } - - code().validate() - type().validate() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this - * object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (code.asKnown().getOrNull()?.validity() ?: 0) + - (type.asKnown().getOrNull()?.validity() ?: 0) - - /** - * NACHA return code to use when returning the transaction. Note that the - * list of available return codes is subject to an allowlist configured at - * the program level - */ - class Code - @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 R01 = of("R01") - - @JvmField val R02 = of("R02") - - @JvmField val R03 = of("R03") - - @JvmField val R04 = of("R04") - - @JvmField val R05 = of("R05") - - @JvmField val R06 = of("R06") - - @JvmField val R07 = of("R07") - - @JvmField val R08 = of("R08") - - @JvmField val R09 = of("R09") - - @JvmField val R10 = of("R10") - - @JvmField val R11 = of("R11") - - @JvmField val R12 = of("R12") - - @JvmField val R13 = of("R13") - - @JvmField val R14 = of("R14") - - @JvmField val R15 = of("R15") - - @JvmField val R16 = of("R16") - - @JvmField val R17 = of("R17") - - @JvmField val R18 = of("R18") - - @JvmField val R19 = of("R19") - - @JvmField val R20 = of("R20") - - @JvmField val R21 = of("R21") - - @JvmField val R22 = of("R22") - - @JvmField val R23 = of("R23") - - @JvmField val R24 = of("R24") - - @JvmField val R25 = of("R25") - - @JvmField val R26 = of("R26") - - @JvmField val R27 = of("R27") - - @JvmField val R28 = of("R28") - - @JvmField val R29 = of("R29") - - @JvmField val R30 = of("R30") - - @JvmField val R31 = of("R31") - - @JvmField val R32 = of("R32") - - @JvmField val R33 = of("R33") - - @JvmField val R34 = of("R34") - - @JvmField val R35 = of("R35") - - @JvmField val R36 = of("R36") - - @JvmField val R37 = of("R37") - - @JvmField val R38 = of("R38") - - @JvmField val R39 = of("R39") - - @JvmField val R40 = of("R40") - - @JvmField val R41 = of("R41") - - @JvmField val R42 = of("R42") - - @JvmField val R43 = of("R43") - - @JvmField val R44 = of("R44") - - @JvmField val R45 = of("R45") - - @JvmField val R46 = of("R46") - - @JvmField val R47 = of("R47") - - @JvmField val R50 = of("R50") - - @JvmField val R51 = of("R51") - - @JvmField val R52 = of("R52") - - @JvmField val R53 = of("R53") - - @JvmField val R61 = of("R61") - - @JvmField val R62 = of("R62") - - @JvmField val R67 = of("R67") - - @JvmField val R68 = of("R68") - - @JvmField val R69 = of("R69") - - @JvmField val R70 = of("R70") - - @JvmField val R71 = of("R71") - - @JvmField val R72 = of("R72") - - @JvmField val R73 = of("R73") - - @JvmField val R74 = of("R74") - - @JvmField val R75 = of("R75") - - @JvmField val R76 = of("R76") - - @JvmField val R77 = of("R77") - - @JvmField val R80 = of("R80") - - @JvmField val R81 = of("R81") - - @JvmField val R82 = of("R82") - - @JvmField val R83 = of("R83") - - @JvmField val R84 = of("R84") - - @JvmField val R85 = of("R85") - - @JvmStatic fun of(value: String) = Code(JsonField.of(value)) - } - - /** An enum containing [Code]'s known values. */ - enum class Known { - R01, - R02, - R03, - R04, - R05, - R06, - R07, - R08, - R09, - R10, - R11, - R12, - R13, - R14, - R15, - R16, - R17, - R18, - R19, - R20, - R21, - R22, - R23, - R24, - R25, - R26, - R27, - R28, - R29, - R30, - R31, - R32, - R33, - R34, - R35, - R36, - R37, - R38, - R39, - R40, - R41, - R42, - R43, - R44, - R45, - R46, - R47, - R50, - R51, - R52, - R53, - R61, - R62, - R67, - R68, - R69, - R70, - R71, - R72, - R73, - R74, - R75, - R76, - R77, - R80, - R81, - R82, - R83, - R84, - R85, - } - - /** - * An enum containing [Code]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Code] 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 { - R01, - R02, - R03, - R04, - R05, - R06, - R07, - R08, - R09, - R10, - R11, - R12, - R13, - R14, - R15, - R16, - R17, - R18, - R19, - R20, - R21, - R22, - R23, - R24, - R25, - R26, - R27, - R28, - R29, - R30, - R31, - R32, - R33, - R34, - R35, - R36, - R37, - R38, - R39, - R40, - R41, - R42, - R43, - R44, - R45, - R46, - R47, - R50, - R51, - R52, - R53, - R61, - R62, - R67, - R68, - R69, - R70, - R71, - R72, - R73, - R74, - R75, - R76, - R77, - R80, - R81, - R82, - R83, - R84, - R85, - /** - * An enum member indicating that [Code] 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) { - R01 -> Value.R01 - R02 -> Value.R02 - R03 -> Value.R03 - R04 -> Value.R04 - R05 -> Value.R05 - R06 -> Value.R06 - R07 -> Value.R07 - R08 -> Value.R08 - R09 -> Value.R09 - R10 -> Value.R10 - R11 -> Value.R11 - R12 -> Value.R12 - R13 -> Value.R13 - R14 -> Value.R14 - R15 -> Value.R15 - R16 -> Value.R16 - R17 -> Value.R17 - R18 -> Value.R18 - R19 -> Value.R19 - R20 -> Value.R20 - R21 -> Value.R21 - R22 -> Value.R22 - R23 -> Value.R23 - R24 -> Value.R24 - R25 -> Value.R25 - R26 -> Value.R26 - R27 -> Value.R27 - R28 -> Value.R28 - R29 -> Value.R29 - R30 -> Value.R30 - R31 -> Value.R31 - R32 -> Value.R32 - R33 -> Value.R33 - R34 -> Value.R34 - R35 -> Value.R35 - R36 -> Value.R36 - R37 -> Value.R37 - R38 -> Value.R38 - R39 -> Value.R39 - R40 -> Value.R40 - R41 -> Value.R41 - R42 -> Value.R42 - R43 -> Value.R43 - R44 -> Value.R44 - R45 -> Value.R45 - R46 -> Value.R46 - R47 -> Value.R47 - R50 -> Value.R50 - R51 -> Value.R51 - R52 -> Value.R52 - R53 -> Value.R53 - R61 -> Value.R61 - R62 -> Value.R62 - R67 -> Value.R67 - R68 -> Value.R68 - R69 -> Value.R69 - R70 -> Value.R70 - R71 -> Value.R71 - R72 -> Value.R72 - R73 -> Value.R73 - R74 -> Value.R74 - R75 -> Value.R75 - R76 -> Value.R76 - R77 -> Value.R77 - R80 -> Value.R80 - R81 -> Value.R81 - R82 -> Value.R82 - R83 -> Value.R83 - R84 -> Value.R84 - R85 -> Value.R85 - 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) { - R01 -> Known.R01 - R02 -> Known.R02 - R03 -> Known.R03 - R04 -> Known.R04 - R05 -> Known.R05 - R06 -> Known.R06 - R07 -> Known.R07 - R08 -> Known.R08 - R09 -> Known.R09 - R10 -> Known.R10 - R11 -> Known.R11 - R12 -> Known.R12 - R13 -> Known.R13 - R14 -> Known.R14 - R15 -> Known.R15 - R16 -> Known.R16 - R17 -> Known.R17 - R18 -> Known.R18 - R19 -> Known.R19 - R20 -> Known.R20 - R21 -> Known.R21 - R22 -> Known.R22 - R23 -> Known.R23 - R24 -> Known.R24 - R25 -> Known.R25 - R26 -> Known.R26 - R27 -> Known.R27 - R28 -> Known.R28 - R29 -> Known.R29 - R30 -> Known.R30 - R31 -> Known.R31 - R32 -> Known.R32 - R33 -> Known.R33 - R34 -> Known.R34 - R35 -> Known.R35 - R36 -> Known.R36 - R37 -> Known.R37 - R38 -> Known.R38 - R39 -> Known.R39 - R40 -> Known.R40 - R41 -> Known.R41 - R42 -> Known.R42 - R43 -> Known.R43 - R44 -> Known.R44 - R45 -> Known.R45 - R46 -> Known.R46 - R47 -> Known.R47 - R50 -> Known.R50 - R51 -> Known.R51 - R52 -> Known.R52 - R53 -> Known.R53 - R61 -> Known.R61 - R62 -> Known.R62 - R67 -> Known.R67 - R68 -> Known.R68 - R69 -> Known.R69 - R70 -> Known.R70 - R71 -> Known.R71 - R72 -> Known.R72 - R73 -> Known.R73 - R74 -> Known.R74 - R75 -> Known.R75 - R76 -> Known.R76 - R77 -> Known.R77 - R80 -> Known.R80 - R81 -> Known.R81 - R82 -> Known.R82 - R83 -> Known.R83 - R84 -> Known.R84 - R85 -> Known.R85 - else -> throw LithicInvalidDataException("Unknown Code: $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(): Code = 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 Code && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** Return the ACH transaction */ - class Type - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from - * data that doesn't match any known member, and you want to know that - * value. For example, if the SDK is on an older version than the API, - * then the API may respond with new members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val RETURN = of("RETURN") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - RETURN - } - - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [Type] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. - * For example, if the SDK is on an older version than the API, then - * the API may respond with new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - RETURN, - /** - * An enum member indicating that [Type] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, - * or [Value._UNKNOWN] if the class was instantiated with an unknown - * value. - * - * Use the [known] method instead if you're certain the value is always - * known or if you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - RETURN -> Value.RETURN - 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) { - RETURN -> Known.RETURN - else -> throw LithicInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is - * primarily for debugging and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value - * does not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LithicInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LithicInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in - * this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ReturnAction && - code == other.code && - type == other.type && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(code, type, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ReturnAction{code=$code, type=$type, additionalProperties=$additionalProperties}" - } - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Example && - actions == other.actions && - eventToken == other.eventToken && - timestamp == other.timestamp && - transactionToken == other.transactionToken && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - actions, - eventToken, - timestamp, - transactionToken, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "Example{actions=$actions, eventToken=$eventToken, timestamp=$timestamp, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" - } - - /** The evaluation mode of this version during the reported period. */ - class AuthRuleVersionState - @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 ACTIVE = of("ACTIVE") - - @JvmField val SHADOW = of("SHADOW") - - @JvmField val INACTIVE = of("INACTIVE") - - @JvmStatic fun of(value: String) = AuthRuleVersionState(JsonField.of(value)) - } - - /** An enum containing [AuthRuleVersionState]'s known values. */ - enum class Known { - ACTIVE, - SHADOW, - INACTIVE, - } - - /** - * An enum containing [AuthRuleVersionState]'s known values, as well as an - * [_UNKNOWN] member. - * - * An instance of [AuthRuleVersionState] 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 { - ACTIVE, - SHADOW, - INACTIVE, - /** - * An enum member indicating that [AuthRuleVersionState] 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) { - ACTIVE -> Value.ACTIVE - SHADOW -> Value.SHADOW - INACTIVE -> Value.INACTIVE - 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) { - ACTIVE -> Known.ACTIVE - SHADOW -> Known.SHADOW - INACTIVE -> Known.INACTIVE - else -> - throw LithicInvalidDataException("Unknown AuthRuleVersionState: $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(): AuthRuleVersionState = 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 AuthRuleVersionState && 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 ReportStatsV2 && - actionCounts == other.actionCounts && - examples == other.examples && - state == other.state && - version == other.version && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(actionCounts, examples, state, version, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ReportStatsV2{actionCounts=$actionCounts, examples=$examples, state=$state, version=$version, additionalProperties=$additionalProperties}" - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DailyStatistic && - currentVersionStatistics == other.currentVersionStatistics && - date == other.date && - draftVersionStatistics == other.draftVersionStatistics && - versions == other.versions && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - currentVersionStatistics, - date, - draftVersionStatistics, - versions, - additionalProperties, - ) - } + private val hashCode: Int by lazy { Objects.hash(date, versions, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "DailyStatistic{currentVersionStatistics=$currentVersionStatistics, date=$date, draftVersionStatistics=$draftVersionStatistics, versions=$versions, additionalProperties=$additionalProperties}" + "DailyStatistic{date=$date, versions=$versions, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt index fe3e66d1..c587d36d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportStatsTest.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.lithic.api.core.JsonValue import com.lithic.api.core.jsonMapper import java.time.OffsetDateTime -import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -21,9 +20,6 @@ internal class ReportStatsTest { .putAdditionalProperty("foo", JsonValue.from(0)) .build() ) - .approved(0L) - .challenged(0L) - .declined(0L) .addExample( ReportStats.Example.builder() .addAction( @@ -39,25 +35,22 @@ internal class ReportStatsTest { ) .build() ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .state(ReportStats.AuthRuleVersionState.ACTIVE) + .version(0L) .build() assertThat(reportStats.actionCounts()) - .contains( + .isEqualTo( ReportStats.ActionCounts.builder() .putAdditionalProperty("foo", JsonValue.from(0)) .build() ) - assertThat(reportStats.approved()).contains(0L) - assertThat(reportStats.challenged()).contains(0L) - assertThat(reportStats.declined()).contains(0L) - assertThat(reportStats.examples().getOrNull()) + assertThat(reportStats.examples()) .containsExactly( ReportStats.Example.builder() .addAction( @@ -71,13 +64,13 @@ internal class ReportStatsTest { ) .build() ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + assertThat(reportStats.state()).isEqualTo(ReportStats.AuthRuleVersionState.ACTIVE) + assertThat(reportStats.version()).isEqualTo(0L) } @Test @@ -90,9 +83,6 @@ internal class ReportStatsTest { .putAdditionalProperty("foo", JsonValue.from(0)) .build() ) - .approved(0L) - .challenged(0L) - .declined(0L) .addExample( ReportStats.Example.builder() .addAction( @@ -108,13 +98,13 @@ internal class ReportStatsTest { ) .build() ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .state(ReportStats.AuthRuleVersionState.ACTIVE) + .version(0L) .build() val roundtrippedReportStats = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt index 05de24e5..996f9625 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveReportResponseTest.kt @@ -20,55 +20,14 @@ internal class V2RetrieveReportResponseTest { .begin(LocalDate.parse("2019-12-27")) .addDailyStatistic( V2RetrieveReportResponse.DailyStatistic.builder() - .currentVersionStatistics( - ReportStats.builder() - .actionCounts( - ReportStats.ActionCounts.builder() - .putAdditionalProperty("foo", JsonValue.from(0)) - .build() - ) - .approved(0L) - .challenged(0L) - .declined(0L) - .addExample( - ReportStats.Example.builder() - .addAction( - ReportStats.Example.Action.DeclineActionAuthorization - .builder() - .code( - ReportStats.Example.Action - .DeclineActionAuthorization - .DetailedResult - .APPROVED - ) - .type( - ReportStats.Example.Action - .DeclineActionAuthorization - .Type - .DECLINE - ) - .build() - ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - .build() - ) .date(LocalDate.parse("2019-12-27")) - .draftVersionStatistics( + .addVersion( ReportStats.builder() .actionCounts( ReportStats.ActionCounts.builder() .putAdditionalProperty("foo", JsonValue.from(0)) .build() ) - .approved(0L) - .challenged(0L) - .declined(0L) .addExample( ReportStats.Example.builder() .addAction( @@ -88,63 +47,12 @@ internal class V2RetrieveReportResponseTest { ) .build() ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - .build() - ) - .addVersion( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.builder() - .actionCounts( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .ActionCounts - .builder() - .putAdditionalProperty("foo", JsonValue.from(0)) - .build() - ) - .addExample( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.Example - .builder() - .addAction( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .builder() - .code( - V2RetrieveReportResponse.DailyStatistic - .ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .DetailedResult - .APPROVED - ) - .type( - V2RetrieveReportResponse.DailyStatistic - .ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .Type - .DECLINE - ) - .build() - ) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - .state( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .AuthRuleVersionState - .ACTIVE - ) + .state(ReportStats.AuthRuleVersionState.ACTIVE) .version(0L) .build() ) @@ -159,55 +67,14 @@ internal class V2RetrieveReportResponseTest { assertThat(v2RetrieveReportResponse.dailyStatistics()) .containsExactly( V2RetrieveReportResponse.DailyStatistic.builder() - .currentVersionStatistics( - ReportStats.builder() - .actionCounts( - ReportStats.ActionCounts.builder() - .putAdditionalProperty("foo", JsonValue.from(0)) - .build() - ) - .approved(0L) - .challenged(0L) - .declined(0L) - .addExample( - ReportStats.Example.builder() - .addAction( - ReportStats.Example.Action.DeclineActionAuthorization - .builder() - .code( - ReportStats.Example.Action - .DeclineActionAuthorization - .DetailedResult - .APPROVED - ) - .type( - ReportStats.Example.Action - .DeclineActionAuthorization - .Type - .DECLINE - ) - .build() - ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - .build() - ) .date(LocalDate.parse("2019-12-27")) - .draftVersionStatistics( + .addVersion( ReportStats.builder() .actionCounts( ReportStats.ActionCounts.builder() .putAdditionalProperty("foo", JsonValue.from(0)) .build() ) - .approved(0L) - .challenged(0L) - .declined(0L) .addExample( ReportStats.Example.builder() .addAction( @@ -227,62 +94,12 @@ internal class V2RetrieveReportResponseTest { ) .build() ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - .build() - ) - .addVersion( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.builder() - .actionCounts( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.ActionCounts - .builder() - .putAdditionalProperty("foo", JsonValue.from(0)) - .build() - ) - .addExample( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.Example - .builder() - .addAction( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .builder() - .code( - V2RetrieveReportResponse.DailyStatistic - .ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .DetailedResult - .APPROVED - ) - .type( - V2RetrieveReportResponse.DailyStatistic - .ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .Type - .DECLINE - ) - .build() - ) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - .state( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .AuthRuleVersionState - .ACTIVE - ) + .state(ReportStats.AuthRuleVersionState.ACTIVE) .version(0L) .build() ) @@ -300,55 +117,14 @@ internal class V2RetrieveReportResponseTest { .begin(LocalDate.parse("2019-12-27")) .addDailyStatistic( V2RetrieveReportResponse.DailyStatistic.builder() - .currentVersionStatistics( - ReportStats.builder() - .actionCounts( - ReportStats.ActionCounts.builder() - .putAdditionalProperty("foo", JsonValue.from(0)) - .build() - ) - .approved(0L) - .challenged(0L) - .declined(0L) - .addExample( - ReportStats.Example.builder() - .addAction( - ReportStats.Example.Action.DeclineActionAuthorization - .builder() - .code( - ReportStats.Example.Action - .DeclineActionAuthorization - .DetailedResult - .APPROVED - ) - .type( - ReportStats.Example.Action - .DeclineActionAuthorization - .Type - .DECLINE - ) - .build() - ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - .build() - ) .date(LocalDate.parse("2019-12-27")) - .draftVersionStatistics( + .addVersion( ReportStats.builder() .actionCounts( ReportStats.ActionCounts.builder() .putAdditionalProperty("foo", JsonValue.from(0)) .build() ) - .approved(0L) - .challenged(0L) - .declined(0L) .addExample( ReportStats.Example.builder() .addAction( @@ -368,63 +144,12 @@ internal class V2RetrieveReportResponseTest { ) .build() ) - .approved(true) - .decision(ReportStats.Example.Decision.APPROVED) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - .build() - ) - .addVersion( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.builder() - .actionCounts( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .ActionCounts - .builder() - .putAdditionalProperty("foo", JsonValue.from(0)) - .build() - ) - .addExample( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2.Example - .builder() - .addAction( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .builder() - .code( - V2RetrieveReportResponse.DailyStatistic - .ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .DetailedResult - .APPROVED - ) - .type( - V2RetrieveReportResponse.DailyStatistic - .ReportStatsV2 - .Example - .Action - .DeclineActionAuthorization - .Type - .DECLINE - ) - .build() - ) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - .state( - V2RetrieveReportResponse.DailyStatistic.ReportStatsV2 - .AuthRuleVersionState - .ACTIVE - ) + .state(ReportStats.AuthRuleVersionState.ACTIVE) .version(0L) .build() ) From 722786333be0861a82118c071f98925f8d661a80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 07:29:45 +0000 Subject: [PATCH 14/14] release: 0.123.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd115b20..58ebf7f2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.122.0" + ".": "0.123.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 836ebac9..7fbdccd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## 0.123.0 (2026-04-10) + +Full Changelog: [v0.122.0...v0.123.0](https://github.com/lithic-com/lithic-java/compare/v0.122.0...v0.123.0) + +### Features + +* **api:** add card decline count values to conditional authorization ([65f1c4b](https://github.com/lithic-com/lithic-java/commit/65f1c4b2a4c28c8a9fbc07a187fb01cf4567461c)) +* **api:** add INTERCHANGE, CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT to financial account types ([a06a494](https://github.com/lithic-com/lithic-java/commit/a06a49406fc967ebb0047ea96a2e6b2f5405d101)) +* **api:** add override_company_name parameter to payment create ([899a3be](https://github.com/lithic-com/lithic-java/commit/899a3be4a06965cf3a37cf4ddf6f8581fac9351a)) +* **api:** add statement_totals field to Statement/StatementsCreatedWebhookEvent ([44d890e](https://github.com/lithic-com/lithic-java/commit/44d890e17988a1e587124a95afe3984c99a3bca0)) +* **api:** add transaction_token field to BacktestStats/ReportStats examples ([b4209cb](https://github.com/lithic-com/lithic-java/commit/b4209cb157f545e04f1dab41185c7d4e0aae4628)) +* **api:** add transaction_token to authorization/authentication3ds/tokenization/ach results ([5bf85e9](https://github.com/lithic-com/lithic-java/commit/5bf85e90787b46c68077f7107165580991bbec97)) + + +### Bug Fixes + +* **types:** make creditProductToken optional in Statement ([f655477](https://github.com/lithic-com/lithic-java/commit/f655477b2d6a9bd20d869599f21dd2910ed3f809)) +* **types:** make data and has_more required in AccountActivityListPageResponse ([5feba92](https://github.com/lithic-com/lithic-java/commit/5feba92cc13a3877fb2769d8808e65959b4b12b9)) +* **types:** remove hostname, make fields required in AsaRequestCard ([67cbf7d](https://github.com/lithic-com/lithic-java/commit/67cbf7d5138afeae5b76339972c28fa63fbc3e30)) +* **types:** remove INTERCHANGE and CHARGEBACK from FinancialAccount and InstanceFinancialAccountType ([21b74ec](https://github.com/lithic-com/lithic-java/commit/21b74ec6a8478a4cbe3ea665f3f46496eba09402)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([c266aa2](https://github.com/lithic-com/lithic-java/commit/c266aa2a776ae772b05a025dab383477ec5c2d0d)) +* **types:** [breaking] remove deprecated fields from ReportStats and Example models ([634a6e2](https://github.com/lithic-com/lithic-java/commit/634a6e237a00f443864fd8e4b8b26344dc83160d)) + + +### Documentation + +* **api:** update natureOfBusiness and qrCodeUrl parameter descriptions ([2fe328d](https://github.com/lithic-com/lithic-java/commit/2fe328dff29b7df2d9096274e5725e1bf37df25f)) + ## 0.122.0 (2026-03-23) Full Changelog: [v0.121.0...v0.122.0](https://github.com/lithic-com/lithic-java/compare/v0.121.0...v0.122.0) diff --git a/README.md b/README.md index 3f07769b..b7fe002a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.122.0) -[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.122.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.122.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.123.0) +[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.123.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.123.0) @@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all -The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.122.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.123.0). @@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic ### Gradle ```kotlin -implementation("com.lithic.api:lithic-java:0.122.0") +implementation("com.lithic.api:lithic-java:0.123.0") ``` ### Maven @@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.122.0") com.lithic.api lithic-java - 0.122.0 + 0.123.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index d37f4f1f..97b99941 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.lithic.api" - version = "0.122.0" // x-release-please-version + version = "0.123.0" // x-release-please-version } subprojects {